Skip to content

Commit

Permalink
Drop dependency on parent block in computeMissedRounds
Browse files Browse the repository at this point in the history
  • Loading branch information
drsk committed Nov 6, 2024
1 parent b1ac2ab commit e55f767
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ processBlock parent VerifiedBlock{vbBlock = pendingBlock, ..}
(blockTimeoutCertificate pendingBlock)
(_bfBakers vbBakersAndFinalizers)
vbLeadershipElectionNonce
parent
(blockRound parent)
(blockRound pendingBlock)
let execData =
BlockExecutionData
Expand Down Expand Up @@ -1217,7 +1217,7 @@ bakeBlock BakeBlockInputs{..} = do
bbiTimeoutCertificate
bbiEpochBakers
bbiLeadershipElectionNonce
bbiParent
(blockRound bbiParent)
bbiRound
let executionData =
BlockExecutionData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e55f767

Please sign in to comment.