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
  • Loading branch information
ArniStarkware committed Dec 5, 2024
1 parent 4af7f4a commit 06056a5
Show file tree
Hide file tree
Showing 5 changed files with 22 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 @@ -726,8 +726,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 @@ -949,6 +949,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 @@ -46,6 +46,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
2 changes: 2 additions & 0 deletions crates/starknet_integration_tests/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,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::ContractAddress;
use starknet_api::rpc_transaction::RpcTransaction;
use starknet_api::transaction::TransactionHash;
use starknet_batcher::block_builder::BlockBuilderConfig;
Expand Down Expand Up @@ -62,6 +63,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),
},
consensus_proposals_channels,
)
Expand Down
10 changes: 10 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,16 @@ pub static CONFIG_POINTERS: LazyLock<ConfigPointers> = 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(
"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 06056a5

Please sign in to comment.