From 95e18a23098260eb3c836dfc979f732be31002d7 Mon Sep 17 00:00:00 2001 From: Jeb Bearer Date: Fri, 23 Feb 2024 09:51:38 -0500 Subject: [PATCH] Ensure each sequencer gets a different state key pair --- sequencer/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sequencer/src/lib.rs b/sequencer/src/lib.rs index fc4e8b904..be01d25d4 100644 --- a/sequencer/src/lib.rs +++ b/sequencer/src/lib.rs @@ -272,7 +272,7 @@ pub async fn init_node( let private_staking_key = network_params.private_staking_key; let public_staking_key = BLSPubKey::from_private(&private_staking_key); - let (config, wait_for_orchestrator) = match persistence.load_config().await? { + let (mut config, wait_for_orchestrator) = match persistence.load_config().await? { Some(config) => { tracing::info!("loaded network config from storage, rejoining existing network"); (config, false) @@ -317,8 +317,8 @@ pub async fn init_node( let state_ver_keys = (0..num_nodes) .map(|i| StateKeyPair::generate_from_seed_indexed(config.seed, i as u64).ver_key()) .collect::>(); - - let state_key_pair = config.config.my_own_validator_config.state_key_pair.clone(); + let state_key_pair = StateKeyPair::generate_from_seed_indexed(config.seed, node_index); + config.config.my_own_validator_config.state_key_pair = state_key_pair.clone(); // Initialize networking. let networks = Networks {