Skip to content

Commit

Permalink
chore(config): add sequencer address as required param
Browse files Browse the repository at this point in the history
commit-id:82d3fb9c
  • Loading branch information
Itay-Tsabary-Starkware committed Nov 14, 2024
1 parent d4e1db2 commit 93c64cc
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 2 deletions.
9 changes: 7 additions & 2 deletions config/sequencer/default_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@
},
"batcher_config.block_builder_config.sequencer_address": {
"description": "The address of the sequencer.",
"privacy": "Public",
"value": "0x0"
"pointer_target": "sequencer_address",
"privacy": "Public"
},
"batcher_config.block_builder_config.tx_chunk_size": {
"description": "The size of the transaction chunk.",
Expand Down Expand Up @@ -894,6 +894,11 @@
"privacy": "Public",
"value": ""
},
"sequencer_address": {
"description": "A required param! The sequencer address.",
"param_type": "String",
"privacy": "TemporaryValue"
},
"strk_fee_token_address": {
"description": "A required param! Address of the STRK fee token.",
"param_type": "String",
Expand Down
2 changes: 2 additions & 0 deletions crates/starknet_integration_tests/src/config_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ pub(crate) fn dump_config_file_changes(
dir: PathBuf,
) -> PathBuf {
// Dump config changes file for the sequencer node.
// TODO(Tsabary): auto dump the entirety of RequiredParams fields.
let json_data = config_fields_to_json!(
required_params.chain_id,
required_params.eth_fee_token_address,
required_params.strk_fee_token_address,
required_params.sequencer_address,
config.rpc_state_reader_config.json_rpc_version,
config.rpc_state_reader_config.url,
config.batcher_config.storage.db_config.path_prefix,
Expand Down
1 change: 1 addition & 0 deletions crates/starknet_integration_tests/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ pub async fn create_config(
chain_id,
eth_fee_token_address: fee_token_addresses.eth_fee_token_address,
strk_fee_token_address: fee_token_addresses.strk_fee_token_address,
sequencer_address: ContractAddress::from(1312_u128), // Arbitrary non-zero value.
},
consensus_proposals_channels,
)
Expand Down
9 changes: 9 additions & 0 deletions crates/starknet_sequencer_node/src/config/node_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ pub static REQUIRED_PARAM_CONFIG_POINTERS: LazyLock<ConfigPointers> = LazyLock::
"gateway_config.chain_info.fee_token_addresses.strk_fee_token_address",
]),
),
// TODO(tsabary): set as a regular required parameter.
(
ser_pointer_target_required_param(
"sequencer_address",
SerializationType::String,
"The sequencer address.",
),
set_pointing_param_paths(&["batcher_config.block_builder_config.sequencer_address"]),
),
]
});

Expand Down
4 changes: 4 additions & 0 deletions crates/starknet_sequencer_node/src/config/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pub struct RequiredParams {
pub chain_id: ChainId,
pub eth_fee_token_address: ContractAddress,
pub strk_fee_token_address: ContractAddress,
pub sequencer_address: ContractAddress,
}

impl RequiredParams {
Expand All @@ -19,6 +20,7 @@ impl RequiredParams {
chain_id: ChainId::create_for_testing(),
eth_fee_token_address: ContractAddress::from(2_u128),
strk_fee_token_address: ContractAddress::from(3_u128),
sequencer_address: ContractAddress::from(17_u128),
}
}

Expand All @@ -31,6 +33,8 @@ impl RequiredParams {
self.eth_fee_token_address.to_string(),
"--strk_fee_token_address".to_string(),
self.strk_fee_token_address.to_string(),
"--sequencer_address".to_string(),
self.sequencer_address.to_string(),
];
// Verify all arguments and their values are present.
assert!(
Expand Down

0 comments on commit 93c64cc

Please sign in to comment.