From e55f767ed29f851046a4160238ea1b229f726f1f Mon Sep 17 00:00:00 2001 From: drsk Date: Wed, 6 Nov 2024 16:09:09 +0100 Subject: [PATCH] Drop dependency on parent block in computeMissedRounds --- .../src/Concordium/KonsensusV1/Consensus/Blocks.hs | 4 ++-- .../src/Concordium/KonsensusV1/LeaderElection.hs | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/concordium-consensus/src/Concordium/KonsensusV1/Consensus/Blocks.hs b/concordium-consensus/src/Concordium/KonsensusV1/Consensus/Blocks.hs index 324443946a..4a18731c53 100644 --- a/concordium-consensus/src/Concordium/KonsensusV1/Consensus/Blocks.hs +++ b/concordium-consensus/src/Concordium/KonsensusV1/Consensus/Blocks.hs @@ -727,7 +727,7 @@ processBlock parent VerifiedBlock{vbBlock = pendingBlock, ..} (blockTimeoutCertificate pendingBlock) (_bfBakers vbBakersAndFinalizers) vbLeadershipElectionNonce - parent + (blockRound parent) (blockRound pendingBlock) let execData = BlockExecutionData @@ -1217,7 +1217,7 @@ bakeBlock BakeBlockInputs{..} = do bbiTimeoutCertificate bbiEpochBakers bbiLeadershipElectionNonce - bbiParent + (blockRound bbiParent) bbiRound let executionData = BlockExecutionData diff --git a/concordium-consensus/src/Concordium/KonsensusV1/LeaderElection.hs b/concordium-consensus/src/Concordium/KonsensusV1/LeaderElection.hs index 30e7344e3f..c6b94fdf4e 100644 --- a/concordium-consensus/src/Concordium/KonsensusV1/LeaderElection.hs +++ b/concordium-consensus/src/Concordium/KonsensusV1/LeaderElection.hs @@ -23,7 +23,6 @@ import Data.Word import Lens.Micro.Platform import qualified Concordium.Crypto.SHA256 as Hash -import Concordium.KonsensusV1.TreeState.Types import Concordium.KonsensusV1.Types import Concordium.Types import Concordium.Types.Accounts @@ -167,13 +166,13 @@ computeMissedRounds :: FullBakers -> -- | Leadership election nonce for the current epoch. LeadershipElectionNonce -> - -- | Pointer to the parent block. - BlockPointer mpv -> + -- | Parent round. + Round -> -- | The current round. Round -> [(BakerId, Word64)] -computeMissedRounds mbTc _validators _leNonce _parent _rnd | isAbsent mbTc = [] -computeMissedRounds _mbTc validators leNonce parent rnd = Map.toList $ makeMissedRounds Map.empty (blockRound parent) +computeMissedRounds mbTc _validators _leNonce _parentRnd _rnd | isAbsent mbTc = [] +computeMissedRounds _mbTc validators leNonce parentRnd rnd = Map.toList $ makeMissedRounds Map.empty parentRnd where getLeader' = _bakerIdentity . _theBakerInfo . getLeaderFullBakers validators leNonce makeMissedRounds !m !r