From b9b707414ecaeadaedb7efe1d22ae940b979fd8c Mon Sep 17 00:00:00 2001 From: Itay Tsabary Date: Thu, 14 Nov 2024 15:14:25 +0200 Subject: [PATCH] chore(config): add sequencer address as required param commit-id:82d3fb9c --- config/sequencer/default_config.json | 9 +++++++-- crates/starknet_integration_tests/src/config_utils.rs | 2 ++ crates/starknet_integration_tests/src/utils.rs | 1 + crates/starknet_sequencer_node/src/config/node_config.rs | 9 +++++++++ crates/starknet_sequencer_node/src/config/test_utils.rs | 4 ++++ 5 files changed, 23 insertions(+), 2 deletions(-) diff --git a/config/sequencer/default_config.json b/config/sequencer/default_config.json index 3f181850f6..b5941df09d 100644 --- a/config/sequencer/default_config.json +++ b/config/sequencer/default_config.json @@ -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.", @@ -899,6 +899,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", diff --git a/crates/starknet_integration_tests/src/config_utils.rs b/crates/starknet_integration_tests/src/config_utils.rs index 3c2bd6568a..40f3f90434 100644 --- a/crates/starknet_integration_tests/src/config_utils.rs +++ b/crates/starknet_integration_tests/src/config_utils.rs @@ -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, diff --git a/crates/starknet_integration_tests/src/utils.rs b/crates/starknet_integration_tests/src/utils.rs index a367ac9859..4f85490f19 100644 --- a/crates/starknet_integration_tests/src/utils.rs +++ b/crates/starknet_integration_tests/src/utils.rs @@ -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, ) diff --git a/crates/starknet_sequencer_node/src/config/node_config.rs b/crates/starknet_sequencer_node/src/config/node_config.rs index 0459d58980..32dfe68cb6 100644 --- a/crates/starknet_sequencer_node/src/config/node_config.rs +++ b/crates/starknet_sequencer_node/src/config/node_config.rs @@ -75,6 +75,15 @@ pub static CONFIG_POINTERS: LazyLock = LazyLock::new(|| { "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"]), + ), ]; let mut common_execution_config = generate_struct_pointer( "versioned_constants_overrides".to_owned(), diff --git a/crates/starknet_sequencer_node/src/config/test_utils.rs b/crates/starknet_sequencer_node/src/config/test_utils.rs index 94f0c8e1bb..9434886f09 100644 --- a/crates/starknet_sequencer_node/src/config/test_utils.rs +++ b/crates/starknet_sequencer_node/src/config/test_utils.rs @@ -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 { @@ -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), } } @@ -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!(