From 9ca9ef68a93391cc7e54eb6ce312d6db8ac88f69 Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 29 Jul 2024 10:03:54 +0100 Subject: [PATCH 1/5] feat(consensus): optionally configure max block time --- .../src/consensus_constants.rs | 2 ++ .../tari_validator_node/src/consensus/mod.rs | 13 +++------- dan_layer/consensus/src/hotstuff/config.rs | 1 + dan_layer/consensus/src/hotstuff/pacemaker.rs | 25 +++++++++++++------ dan_layer/consensus/src/hotstuff/worker.rs | 6 ++--- .../src/support/validator/builder.rs | 7 ++---- 6 files changed, 28 insertions(+), 26 deletions(-) diff --git a/applications/tari_dan_app_utilities/src/consensus_constants.rs b/applications/tari_dan_app_utilities/src/consensus_constants.rs index e56fdbe3f..b10dd0be1 100644 --- a/applications/tari_dan_app_utilities/src/consensus_constants.rs +++ b/applications/tari_dan_app_utilities/src/consensus_constants.rs @@ -26,6 +26,7 @@ pub struct ConsensusConstants { pub committee_size: u32, pub max_base_layer_blocks_ahead: u64, pub max_base_layer_blocks_behind: u64, + pub max_block_time_threshold: u64, // GST in seconds for consensus } impl ConsensusConstants { @@ -35,6 +36,7 @@ impl ConsensusConstants { committee_size: 7, max_base_layer_blocks_ahead: 5, max_base_layer_blocks_behind: 5, + max_block_time_threshold: 10, } } } diff --git a/applications/tari_validator_node/src/consensus/mod.rs b/applications/tari_validator_node/src/consensus/mod.rs index 635286a4e..8e7ddfcc1 100644 --- a/applications/tari_validator_node/src/consensus/mod.rs +++ b/applications/tari_validator_node/src/consensus/mod.rs @@ -8,8 +8,7 @@ use tari_consensus::{ traits::ConsensusSpec, }; use tari_dan_app_utilities::{ - consensus_constants::ConsensusConstants, - template_manager::implementation::TemplateManager, + consensus_constants::ConsensusConstants, template_manager::implementation::TemplateManager, transaction_executor::TariDanTransactionProcessor, }; use tari_dan_common_types::PeerAddress; @@ -30,13 +29,8 @@ use crate::{ event_subscription::EventSubscription, p2p::services::messaging::{ConsensusInboundMessaging, ConsensusOutboundMessaging}, transaction_validators::{ - ClaimFeeTransactionValidator, - EpochRangeValidator, - FeeTransactionValidator, - HasInputs, - TemplateExistsValidator, - TransactionSignatureValidator, - TransactionValidationError, + ClaimFeeTransactionValidator, EpochRangeValidator, FeeTransactionValidator, HasInputs, TemplateExistsValidator, + TransactionSignatureValidator, TransactionValidationError, }, validator::{BoxedValidator, Validator}, ValidatorNodeConfig, @@ -99,6 +93,7 @@ pub async fn spawn( HotstuffConfig { max_base_layer_blocks_behind: consensus_constants.max_base_layer_blocks_behind, max_base_layer_blocks_ahead: consensus_constants.max_base_layer_blocks_ahead, + max_block_time_threshold: consensus_constants.max_block_time_threshold, }, ); let current_view = hotstuff_worker.pacemaker().current_view().clone(); diff --git a/dan_layer/consensus/src/hotstuff/config.rs b/dan_layer/consensus/src/hotstuff/config.rs index c36ecde2f..f4f23307b 100644 --- a/dan_layer/consensus/src/hotstuff/config.rs +++ b/dan_layer/consensus/src/hotstuff/config.rs @@ -5,4 +5,5 @@ pub struct HotstuffConfig { pub max_base_layer_blocks_ahead: u64, pub max_base_layer_blocks_behind: u64, + pub max_block_time_threshold: u64, } diff --git a/dan_layer/consensus/src/hotstuff/pacemaker.rs b/dan_layer/consensus/src/hotstuff/pacemaker.rs index 2c119c278..31e14ce81 100644 --- a/dan_layer/consensus/src/hotstuff/pacemaker.rs +++ b/dan_layer/consensus/src/hotstuff/pacemaker.rs @@ -1,5 +1,6 @@ // Copyright 2022 The Tari Project // SPDX-License-Identifier: BSD-3-Clause + use std::{ cmp, time::{Duration, Instant}, @@ -20,17 +21,18 @@ use crate::hotstuff::{ const LOG_TARGET: &str = "tari::dan::consensus::hotstuff::pacemaker"; const MAX_DELTA: Duration = Duration::from_secs(300); -const BLOCK_TIME: Duration = Duration::from_secs(10); +const DEFAULT_BLOCK_TIME: Duration = Duration::from_secs(10); pub struct PaceMaker { pace_maker_handle: PaceMakerHandle, handle_receiver: mpsc::Receiver, current_view: CurrentView, current_high_qc_height: NodeHeight, + block_time: Duration, } impl PaceMaker { - pub fn new() -> Self { + pub fn new(max_block_time_threshold: u64) -> Self { let (sender, receiver) = mpsc::channel(100); let on_beat = OnBeat::new(); @@ -38,6 +40,12 @@ impl PaceMaker { let on_leader_timeout = OnLeaderTimeout::new(); let current_height = CurrentView::new(); + let block_time = if max_block_time_threshold == 0 { + DEFAULT_BLOCK_TIME + } else { + Duration::from_secs(max_block_time_threshold) + }; + Self { handle_receiver: receiver, pace_maker_handle: PaceMakerHandle::new( @@ -49,6 +57,7 @@ impl PaceMaker { ), current_view: current_height, current_high_qc_height: NodeHeight(0), + block_time, } } @@ -101,7 +110,7 @@ impl PaceMaker { info!(target: LOG_TARGET, "Reset! Current height: {}, Delta: {:.2?}", self.current_view, delta); leader_timeout.as_mut().reset(tokio::time::Instant::now() + delta); // set a timer for when we must send a block... - block_timer.as_mut().reset(tokio::time::Instant::now() + BLOCK_TIME); + block_timer.as_mut().reset(tokio::time::Instant::now() + self.block_time); }, PacemakerRequest::Start { high_qc_height } => { info!(target: LOG_TARGET, "🚀 Starting pacemaker at leaf height {} and high QC: {}", self.current_view, high_qc_height); @@ -112,7 +121,7 @@ impl PaceMaker { let delta = self.delta_time(); info!(target: LOG_TARGET, "Reset! Current height: {}, Delta: {:.2?}", self.current_view, delta); leader_timeout.as_mut().reset(tokio::time::Instant::now() + delta); - block_timer.as_mut().reset(tokio::time::Instant::now() + BLOCK_TIME); + block_timer.as_mut().reset(tokio::time::Instant::now() + self.block_time); on_beat.beat(); started = true; } @@ -130,11 +139,11 @@ impl PaceMaker { } }, () = &mut block_timer => { - block_timer.as_mut().reset(tokio::time::Instant::now() + BLOCK_TIME); + block_timer.as_mut().reset(tokio::time::Instant::now() + self.block_time); on_force_beat.beat(None); } () = &mut leader_timeout => { - block_timer.as_mut().reset(tokio::time::Instant::now() + BLOCK_TIME); + block_timer.as_mut().reset(tokio::time::Instant::now() + self.block_time); let delta = self.delta_time(); leader_timeout.as_mut().reset(tokio::time::Instant::now() + delta); @@ -156,7 +165,7 @@ impl PaceMaker { let current_height = self.current_view.get_height(); if current_height.is_zero() || self.current_high_qc_height.is_zero() { // Allow extra time for the first block - return BLOCK_TIME * 2; + return self.block_time * 2; } let exp = u32::try_from(cmp::min( u64::from(u32::MAX), @@ -169,7 +178,7 @@ impl PaceMaker { ); // TODO: get real avg latency let avg_latency = Duration::from_secs(2); - BLOCK_TIME + delta + avg_latency + self.block_time + delta + avg_latency } } diff --git a/dan_layer/consensus/src/hotstuff/worker.rs b/dan_layer/consensus/src/hotstuff/worker.rs index 16d9f64fb..82cfb23e8 100644 --- a/dan_layer/consensus/src/hotstuff/worker.rs +++ b/dan_layer/consensus/src/hotstuff/worker.rs @@ -16,9 +16,7 @@ use tari_transaction::{Transaction, TransactionId}; use tokio::sync::{broadcast, mpsc}; use super::{ - config::HotstuffConfig, - on_receive_new_transaction::OnReceiveNewTransaction, - proposer::Proposer, + config::HotstuffConfig, on_receive_new_transaction::OnReceiveNewTransaction, proposer::Proposer, ProposalValidationError, }; use crate::{ @@ -97,7 +95,7 @@ impl HotstuffWorker { config: HotstuffConfig, ) -> Self { let (tx_missing_transactions, rx_missing_transactions) = mpsc::unbounded_channel(); - let pacemaker = PaceMaker::new(); + let pacemaker = PaceMaker::new(config.max_block_time_threshold); let vote_receiver = VoteReceiver::new( network, state_store.clone(), diff --git a/dan_layer/consensus_tests/src/support/validator/builder.rs b/dan_layer/consensus_tests/src/support/validator/builder.rs index cf215b3bb..22eae558a 100644 --- a/dan_layer/consensus_tests/src/support/validator/builder.rs +++ b/dan_layer/consensus_tests/src/support/validator/builder.rs @@ -21,11 +21,7 @@ use crate::support::{ messaging_impls::{TestInboundMessaging, TestOutboundMessaging}, signing_service::TestVoteSignatureService, sync::AlwaysSyncedSyncManager, - RoundRobinLeaderStrategy, - TestBlockTransactionProcessor, - TestConsensusSpec, - Validator, - ValidatorChannels, + RoundRobinLeaderStrategy, TestBlockTransactionProcessor, TestConsensusSpec, Validator, ValidatorChannels, }; pub struct ValidatorBuilder { @@ -133,6 +129,7 @@ impl ValidatorBuilder { HotstuffConfig { max_base_layer_blocks_ahead: 5, max_base_layer_blocks_behind: 5, + max_block_time_threshold: 10, }, ); From eb794f57e04de4e34b061ef66372ac9c000cf61f Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 29 Jul 2024 10:35:16 +0100 Subject: [PATCH 2/5] chore: cargo fmt --- .../tari_validator_node/src/consensus/mod.rs | 12 +++++++++--- .../tari_validator_node/src/p2p/rpc/service_impl.rs | 4 ++-- .../src/hotstuff/on_receive_local_proposal.rs | 11 +++++------ .../src/hotstuff/substate_store/pending_store.rs | 4 +++- dan_layer/consensus/src/hotstuff/worker.rs | 4 +++- .../consensus_tests/src/support/validator/builder.rs | 6 +++++- dan_layer/engine/src/runtime/working_state.rs | 2 +- 7 files changed, 28 insertions(+), 15 deletions(-) diff --git a/applications/tari_validator_node/src/consensus/mod.rs b/applications/tari_validator_node/src/consensus/mod.rs index 8e7ddfcc1..b97f06290 100644 --- a/applications/tari_validator_node/src/consensus/mod.rs +++ b/applications/tari_validator_node/src/consensus/mod.rs @@ -8,7 +8,8 @@ use tari_consensus::{ traits::ConsensusSpec, }; use tari_dan_app_utilities::{ - consensus_constants::ConsensusConstants, template_manager::implementation::TemplateManager, + consensus_constants::ConsensusConstants, + template_manager::implementation::TemplateManager, transaction_executor::TariDanTransactionProcessor, }; use tari_dan_common_types::PeerAddress; @@ -29,8 +30,13 @@ use crate::{ event_subscription::EventSubscription, p2p::services::messaging::{ConsensusInboundMessaging, ConsensusOutboundMessaging}, transaction_validators::{ - ClaimFeeTransactionValidator, EpochRangeValidator, FeeTransactionValidator, HasInputs, TemplateExistsValidator, - TransactionSignatureValidator, TransactionValidationError, + ClaimFeeTransactionValidator, + EpochRangeValidator, + FeeTransactionValidator, + HasInputs, + TemplateExistsValidator, + TransactionSignatureValidator, + TransactionValidationError, }, validator::{BoxedValidator, Validator}, ValidatorNodeConfig, diff --git a/applications/tari_validator_node/src/p2p/rpc/service_impl.rs b/applications/tari_validator_node/src/p2p/rpc/service_impl.rs index 928643d6a..986dc7ca1 100644 --- a/applications/tari_validator_node/src/p2p/rpc/service_impl.rs +++ b/applications/tari_validator_node/src/p2p/rpc/service_impl.rs @@ -350,8 +350,8 @@ impl ValidatorNodeRpcService for ValidatorNodeRpcServiceImpl { .get_local_committee_info(prev_epoch) .await .optional() - .map_err(RpcStatus::log_internal_error(LOG_TARGET))? else - { + .map_err(RpcStatus::log_internal_error(LOG_TARGET))? + else { return Err(RpcStatus::bad_request(format!( "This validator node is not registered for the previous epoch {prev_epoch}" ))); diff --git a/dan_layer/consensus/src/hotstuff/on_receive_local_proposal.rs b/dan_layer/consensus/src/hotstuff/on_receive_local_proposal.rs index 5f19ab1fa..d6342cd03 100644 --- a/dan_layer/consensus/src/hotstuff/on_receive_local_proposal.rs +++ b/dan_layer/consensus/src/hotstuff/on_receive_local_proposal.rs @@ -564,12 +564,11 @@ impl OnReceiveLocalProposalHandler ReadableSubstateStore for PendingSu } let Some(substate) = SubstateRecord::get(self.read_transaction(), &id.to_substate_address()).optional()? else { - return Err(SubstateStoreError::SubstateNotFound { address: id.to_substate_address() }); + return Err(SubstateStoreError::SubstateNotFound { + address: id.to_substate_address(), + }); }; Ok(substate.into_substate()) } diff --git a/dan_layer/consensus/src/hotstuff/worker.rs b/dan_layer/consensus/src/hotstuff/worker.rs index 82cfb23e8..478980e01 100644 --- a/dan_layer/consensus/src/hotstuff/worker.rs +++ b/dan_layer/consensus/src/hotstuff/worker.rs @@ -16,7 +16,9 @@ use tari_transaction::{Transaction, TransactionId}; use tokio::sync::{broadcast, mpsc}; use super::{ - config::HotstuffConfig, on_receive_new_transaction::OnReceiveNewTransaction, proposer::Proposer, + config::HotstuffConfig, + on_receive_new_transaction::OnReceiveNewTransaction, + proposer::Proposer, ProposalValidationError, }; use crate::{ diff --git a/dan_layer/consensus_tests/src/support/validator/builder.rs b/dan_layer/consensus_tests/src/support/validator/builder.rs index 22eae558a..4578b648d 100644 --- a/dan_layer/consensus_tests/src/support/validator/builder.rs +++ b/dan_layer/consensus_tests/src/support/validator/builder.rs @@ -21,7 +21,11 @@ use crate::support::{ messaging_impls::{TestInboundMessaging, TestOutboundMessaging}, signing_service::TestVoteSignatureService, sync::AlwaysSyncedSyncManager, - RoundRobinLeaderStrategy, TestBlockTransactionProcessor, TestConsensusSpec, Validator, ValidatorChannels, + RoundRobinLeaderStrategy, + TestBlockTransactionProcessor, + TestConsensusSpec, + Validator, + ValidatorChannels, }; pub struct ValidatorBuilder { diff --git a/dan_layer/engine/src/runtime/working_state.rs b/dan_layer/engine/src/runtime/working_state.rs index 5c0c68f35..7e25dc08f 100644 --- a/dan_layer/engine/src/runtime/working_state.rs +++ b/dan_layer/engine/src/runtime/working_state.rs @@ -197,7 +197,7 @@ impl WorkingState { Ok(Some((before, after))) })?; - let Some((before, after))= maybe_before_and_after else { + let Some((before, after)) = maybe_before_and_after else { return Ok(()); }; From e703536c3a452c254dee27b36da3792d85377509 Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 29 Jul 2024 11:05:05 +0100 Subject: [PATCH 3/5] fix(consensus): update naming and remove default base time --- .../tari_dan_app_utilities/src/consensus_constants.rs | 4 ++-- applications/tari_validator_node/src/consensus/mod.rs | 2 +- dan_layer/consensus/src/hotstuff/config.rs | 2 +- dan_layer/consensus/src/hotstuff/pacemaker.rs | 11 ++--------- dan_layer/consensus/src/hotstuff/worker.rs | 2 +- 5 files changed, 7 insertions(+), 14 deletions(-) diff --git a/applications/tari_dan_app_utilities/src/consensus_constants.rs b/applications/tari_dan_app_utilities/src/consensus_constants.rs index b10dd0be1..981dfc17e 100644 --- a/applications/tari_dan_app_utilities/src/consensus_constants.rs +++ b/applications/tari_dan_app_utilities/src/consensus_constants.rs @@ -26,7 +26,7 @@ pub struct ConsensusConstants { pub committee_size: u32, pub max_base_layer_blocks_ahead: u64, pub max_base_layer_blocks_behind: u64, - pub max_block_time_threshold: u64, // GST in seconds for consensus + pub pacemaker_max_base_time: u64, // GST in seconds for consensus } impl ConsensusConstants { @@ -36,7 +36,7 @@ impl ConsensusConstants { committee_size: 7, max_base_layer_blocks_ahead: 5, max_base_layer_blocks_behind: 5, - max_block_time_threshold: 10, + pacemaker_max_base_time: 10, } } } diff --git a/applications/tari_validator_node/src/consensus/mod.rs b/applications/tari_validator_node/src/consensus/mod.rs index b97f06290..22f7076d9 100644 --- a/applications/tari_validator_node/src/consensus/mod.rs +++ b/applications/tari_validator_node/src/consensus/mod.rs @@ -99,7 +99,7 @@ pub async fn spawn( HotstuffConfig { max_base_layer_blocks_behind: consensus_constants.max_base_layer_blocks_behind, max_base_layer_blocks_ahead: consensus_constants.max_base_layer_blocks_ahead, - max_block_time_threshold: consensus_constants.max_block_time_threshold, + pacemaker_max_base_time: consensus_constants.pacemaker_max_base_time, }, ); let current_view = hotstuff_worker.pacemaker().current_view().clone(); diff --git a/dan_layer/consensus/src/hotstuff/config.rs b/dan_layer/consensus/src/hotstuff/config.rs index f4f23307b..25b6987fd 100644 --- a/dan_layer/consensus/src/hotstuff/config.rs +++ b/dan_layer/consensus/src/hotstuff/config.rs @@ -5,5 +5,5 @@ pub struct HotstuffConfig { pub max_base_layer_blocks_ahead: u64, pub max_base_layer_blocks_behind: u64, - pub max_block_time_threshold: u64, + pub pacemaker_max_base_time: u64, } diff --git a/dan_layer/consensus/src/hotstuff/pacemaker.rs b/dan_layer/consensus/src/hotstuff/pacemaker.rs index 31e14ce81..ad7841b4b 100644 --- a/dan_layer/consensus/src/hotstuff/pacemaker.rs +++ b/dan_layer/consensus/src/hotstuff/pacemaker.rs @@ -21,7 +21,6 @@ use crate::hotstuff::{ const LOG_TARGET: &str = "tari::dan::consensus::hotstuff::pacemaker"; const MAX_DELTA: Duration = Duration::from_secs(300); -const DEFAULT_BLOCK_TIME: Duration = Duration::from_secs(10); pub struct PaceMaker { pace_maker_handle: PaceMakerHandle, @@ -32,7 +31,7 @@ pub struct PaceMaker { } impl PaceMaker { - pub fn new(max_block_time_threshold: u64) -> Self { + pub fn new(max_base_time: u64) -> Self { let (sender, receiver) = mpsc::channel(100); let on_beat = OnBeat::new(); @@ -40,12 +39,6 @@ impl PaceMaker { let on_leader_timeout = OnLeaderTimeout::new(); let current_height = CurrentView::new(); - let block_time = if max_block_time_threshold == 0 { - DEFAULT_BLOCK_TIME - } else { - Duration::from_secs(max_block_time_threshold) - }; - Self { handle_receiver: receiver, pace_maker_handle: PaceMakerHandle::new( @@ -57,7 +50,7 @@ impl PaceMaker { ), current_view: current_height, current_high_qc_height: NodeHeight(0), - block_time, + block_time: Duration::from_secs(max_base_time), } } diff --git a/dan_layer/consensus/src/hotstuff/worker.rs b/dan_layer/consensus/src/hotstuff/worker.rs index 478980e01..1d23f9df8 100644 --- a/dan_layer/consensus/src/hotstuff/worker.rs +++ b/dan_layer/consensus/src/hotstuff/worker.rs @@ -97,7 +97,7 @@ impl HotstuffWorker { config: HotstuffConfig, ) -> Self { let (tx_missing_transactions, rx_missing_transactions) = mpsc::unbounded_channel(); - let pacemaker = PaceMaker::new(config.max_block_time_threshold); + let pacemaker = PaceMaker::new(config.pacemaker_max_base_time); let vote_receiver = VoteReceiver::new( network, state_store.clone(), From f30c3a97dbe73695817715aafd0e14b01e58abb3 Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 29 Jul 2024 11:34:51 +0100 Subject: [PATCH 4/5] fix(consensus): use Duration for max base time --- .../tari_dan_app_utilities/src/consensus_constants.rs | 4 ++-- dan_layer/consensus/src/hotstuff/config.rs | 2 +- dan_layer/consensus/src/hotstuff/pacemaker.rs | 4 ++-- dan_layer/consensus_tests/src/support/validator/builder.rs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/applications/tari_dan_app_utilities/src/consensus_constants.rs b/applications/tari_dan_app_utilities/src/consensus_constants.rs index 981dfc17e..1c943b526 100644 --- a/applications/tari_dan_app_utilities/src/consensus_constants.rs +++ b/applications/tari_dan_app_utilities/src/consensus_constants.rs @@ -26,7 +26,7 @@ pub struct ConsensusConstants { pub committee_size: u32, pub max_base_layer_blocks_ahead: u64, pub max_base_layer_blocks_behind: u64, - pub pacemaker_max_base_time: u64, // GST in seconds for consensus + pub pacemaker_max_base_time: std::time::Duration, } impl ConsensusConstants { @@ -36,7 +36,7 @@ impl ConsensusConstants { committee_size: 7, max_base_layer_blocks_ahead: 5, max_base_layer_blocks_behind: 5, - pacemaker_max_base_time: 10, + pacemaker_max_base_time: std::time::Duration::from_secs(10), } } } diff --git a/dan_layer/consensus/src/hotstuff/config.rs b/dan_layer/consensus/src/hotstuff/config.rs index 25b6987fd..1b33991c8 100644 --- a/dan_layer/consensus/src/hotstuff/config.rs +++ b/dan_layer/consensus/src/hotstuff/config.rs @@ -5,5 +5,5 @@ pub struct HotstuffConfig { pub max_base_layer_blocks_ahead: u64, pub max_base_layer_blocks_behind: u64, - pub pacemaker_max_base_time: u64, + pub pacemaker_max_base_time: std::time::Duration, } diff --git a/dan_layer/consensus/src/hotstuff/pacemaker.rs b/dan_layer/consensus/src/hotstuff/pacemaker.rs index ad7841b4b..b3c6b2471 100644 --- a/dan_layer/consensus/src/hotstuff/pacemaker.rs +++ b/dan_layer/consensus/src/hotstuff/pacemaker.rs @@ -31,7 +31,7 @@ pub struct PaceMaker { } impl PaceMaker { - pub fn new(max_base_time: u64) -> Self { + pub fn new(max_base_time: Duration) -> Self { let (sender, receiver) = mpsc::channel(100); let on_beat = OnBeat::new(); @@ -50,7 +50,7 @@ impl PaceMaker { ), current_view: current_height, current_high_qc_height: NodeHeight(0), - block_time: Duration::from_secs(max_base_time), + block_time: max_base_time, } } diff --git a/dan_layer/consensus_tests/src/support/validator/builder.rs b/dan_layer/consensus_tests/src/support/validator/builder.rs index 4578b648d..f9c0c6499 100644 --- a/dan_layer/consensus_tests/src/support/validator/builder.rs +++ b/dan_layer/consensus_tests/src/support/validator/builder.rs @@ -133,7 +133,7 @@ impl ValidatorBuilder { HotstuffConfig { max_base_layer_blocks_ahead: 5, max_base_layer_blocks_behind: 5, - max_block_time_threshold: 10, + pacemaker_max_base_time: std::time::Duration(10), }, ); From e07df421bf5f1247c4ba0c6805b9958b920f6e87 Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 29 Jul 2024 11:59:25 +0100 Subject: [PATCH 5/5] fix(consensus): test case --- dan_layer/consensus_tests/src/support/validator/builder.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dan_layer/consensus_tests/src/support/validator/builder.rs b/dan_layer/consensus_tests/src/support/validator/builder.rs index f9c0c6499..eb0f48f5e 100644 --- a/dan_layer/consensus_tests/src/support/validator/builder.rs +++ b/dan_layer/consensus_tests/src/support/validator/builder.rs @@ -133,7 +133,7 @@ impl ValidatorBuilder { HotstuffConfig { max_base_layer_blocks_ahead: 5, max_base_layer_blocks_behind: 5, - pacemaker_max_base_time: std::time::Duration(10), + pacemaker_max_base_time: std::time::Duration::from_secs(10), }, );