Skip to content

Commit

Permalink
chore(consensus): add config pointer of sequencer address to validato…
Browse files Browse the repository at this point in the history
…r id (#2494)
  • Loading branch information
ArniStarkware authored Dec 10, 2024
1 parent 13a0944 commit 324bdea
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
9 changes: 7 additions & 2 deletions config/sequencer/default_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -671,8 +671,8 @@
},
"consensus_manager_config.consensus_config.validator_id": {
"description": "The validator id of the node.",
"privacy": "Public",
"value": "0x64"
"pointer_target": "validator_id",
"privacy": "Public"
},
"eth_fee_token_address": {
"description": "A required param! Address of the ETH fee token.",
Expand Down Expand Up @@ -899,6 +899,11 @@
"param_type": "String",
"privacy": "TemporaryValue"
},
"validator_id": {
"description": "A required param! The ID of the validator. Also the address of this validator as a starknet contract.",
"param_type": "String",
"privacy": "TemporaryValue"
},
"versioned_constants_overrides.invoke_tx_max_n_steps": {
"description": "Maximum number of steps the invoke function is allowed to run.",
"privacy": "TemporaryValue",
Expand Down
1 change: 1 addition & 0 deletions crates/starknet_integration_tests/src/config_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ pub(crate) fn dump_config_file_changes(
required_params.chain_id,
required_params.eth_fee_token_address,
required_params.strk_fee_token_address,
required_params.validator_id,
config.rpc_state_reader_config.json_rpc_version,
config.rpc_state_reader_config.url,
config.batcher_config.storage.db_config.path_prefix,
Expand Down
3 changes: 2 additions & 1 deletion crates/starknet_integration_tests/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use papyrus_network::network_manager::BroadcastTopicChannels;
use papyrus_protobuf::consensus::{ProposalPart, StreamMessage};
use papyrus_storage::StorageConfig;
use starknet_api::block::BlockNumber;
use starknet_api::core::ChainId;
use starknet_api::core::{ChainId, ContractAddress};
use starknet_api::rpc_transaction::RpcTransaction;
use starknet_api::transaction::TransactionHash;
use starknet_batcher::block_builder::BlockBuilderConfig;
Expand Down Expand Up @@ -75,6 +75,7 @@ pub async fn create_config(
chain_id: chain_info.chain_id,
eth_fee_token_address: fee_token_addresses.eth_fee_token_address,
strk_fee_token_address: fee_token_addresses.strk_fee_token_address,
validator_id: ContractAddress::from(100_u128),
},
)
}
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 @@ -76,6 +76,15 @@ pub static CONFIG_POINTERS: LazyLock<ConfigPointers> = LazyLock::new(|| {
"gateway_config.chain_info.fee_token_addresses.strk_fee_token_address",
]),
),
(
ser_pointer_target_required_param(
"validator_id",
SerializationType::String,
"The ID of the validator. \
Also the address of this validator as a starknet contract.",
),
set_pointing_param_paths(&["consensus_manager_config.consensus_config.validator_id"]),
),
];
let mut common_execution_config = generate_struct_pointer(
"versioned_constants_overrides".to_owned(),
Expand Down
2 changes: 2 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 validator_id: 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),
validator_id: ContractAddress::from(100_u128),
}
}
}
Expand Down

0 comments on commit 324bdea

Please sign in to comment.