diff --git a/config/papyrus/default_config.json b/config/papyrus/default_config.json index 228b5a4c83..86a4dca8a7 100644 --- a/config/papyrus/default_config.json +++ b/config/papyrus/default_config.json @@ -184,6 +184,11 @@ "privacy": "Public", "value": 0 }, + "consensus.sync_retry_interval": { + "description": "The duration (seconds) between sync attempts.", + "privacy": "Public", + "value": 1.0 + }, "consensus.timeouts.precommit_timeout": { "description": "The timeout (seconds) for a precommit.", "privacy": "Public", diff --git a/config/sequencer/default_config.json b/config/sequencer/default_config.json index 0d3d8ef4d6..b94a14b9ff 100644 --- a/config/sequencer/default_config.json +++ b/config/sequencer/default_config.json @@ -714,6 +714,11 @@ "privacy": "Public", "value": 0 }, + "consensus_manager_config.consensus_config.sync_retry_interval": { + "description": "The duration (seconds) between sync attempts.", + "privacy": "Public", + "value": 1.0 + }, "consensus_manager_config.consensus_config.timeouts.precommit_timeout": { "description": "The timeout (seconds) for a precommit.", "privacy": "Public", diff --git a/crates/papyrus_node/src/config/snapshots/papyrus_node__config__config_test__dump_default_config.snap b/crates/papyrus_node/src/config/snapshots/papyrus_node__config__config_test__dump_default_config.snap index 26d2b317fd..f30de82518 100644 --- a/crates/papyrus_node/src/config/snapshots/papyrus_node__config__config_test__dump_default_config.snap +++ b/crates/papyrus_node/src/config/snapshots/papyrus_node__config__config_test__dump_default_config.snap @@ -220,6 +220,13 @@ expression: dumped_default_config }, "privacy": "Public" }, + "consensus.sync_retry_interval": { + "description": "The duration (seconds) between sync attempts.", + "value": { + "$serde_json::private::Number": "1.0" + }, + "privacy": "Public" + }, "consensus.timeouts.precommit_timeout": { "description": "The timeout (seconds) for a precommit.", "value": { diff --git a/crates/sequencing/papyrus_consensus/src/config.rs b/crates/sequencing/papyrus_consensus/src/config.rs index fe5f7b182b..8e8cd00290 100644 --- a/crates/sequencing/papyrus_consensus/src/config.rs +++ b/crates/sequencing/papyrus_consensus/src/config.rs @@ -42,6 +42,9 @@ pub struct ConsensusConfig { pub consensus_delay: Duration, /// Timeouts configuration for consensus. pub timeouts: TimeoutsConfig, + /// The duration (seconds) between sync attempts. + #[serde(deserialize_with = "deserialize_float_seconds_to_duration")] + pub sync_retry_interval: Duration, /// The network configuration for the consensus. #[validate] pub network_config: NetworkConfig, @@ -86,6 +89,12 @@ impl SerializeConfig for ConsensusConfig { "Delay (seconds) before starting consensus to give time for network peering.", ParamPrivacyInput::Public, ), + ser_param( + "sync_retry_interval", + &self.sync_retry_interval.as_secs_f64(), + "The duration (seconds) between sync attempts.", + ParamPrivacyInput::Public, + ), ]); config.extend(append_sub_config_name(self.timeouts.dump(), "timeouts")); config.extend(append_sub_config_name(self.network_config.dump(), "network_config")); @@ -108,6 +117,7 @@ impl Default for ConsensusConfig { num_validators: 1, consensus_delay: Duration::from_secs(5), timeouts: TimeoutsConfig::default(), + sync_retry_interval: Duration::from_secs_f64(1.0), network_config, } } diff --git a/crates/sequencing/papyrus_consensus/src/manager.rs b/crates/sequencing/papyrus_consensus/src/manager.rs index cc1579d022..4c3d05f50e 100644 --- a/crates/sequencing/papyrus_consensus/src/manager.rs +++ b/crates/sequencing/papyrus_consensus/src/manager.rs @@ -156,6 +156,7 @@ impl MultiHeightManager { /// - `must_observer`: Whether the node must observe or if it is allowed to be active (assuming /// it is in the validator set). #[instrument(skip(self, context, broadcast_channels, sync_receiver), level = "info")] + #[allow(clippy::too_many_arguments)] pub(crate) async fn run_height( &mut self, context: &mut ContextT,