Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log when a round is advanced. #1004

Merged
merged 1 commit into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
- Fix a bug in how the last timeout certificate is recovered at start-up.
- Fix the behaviour of the block last finalized pointer in the `GetBlockInfo` so that it
consistently returns the last finalized block at the time the block was baked.
- Add debug-level logging when a round is advanced, either due to a quorum certificate or a
timeout certificate.

## 6.0.4

Expand Down
13 changes: 11 additions & 2 deletions concordium-consensus/src/Concordium/KonsensusV1/Consensus.hs
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,14 @@ onNewRound = do
advanceRoundWithTimeout ::
( MonadTimeout m,
LowLevel.MonadTreeStateStore m,
MonadState (SkovData (MPV m)) m
MonadState (SkovData (MPV m)) m,
MonadLogger m
) =>
RoundTimeout (MPV m) ->
m ()
advanceRoundWithTimeout roundTimeout@RoundTimeout{..} = do
logEvent Konsensus LLDebug $
"Advancing round: round " ++ show (tcRound rtTimeoutCertificate) ++ " timed out."
onNewRound
roundStatus %=! updateQC . updateTC . (rsRoundEligibleToBake .~ True)
updatePersistentRoundStatus (prsLatestTimeout .~ Present rtTimeoutCertificate)
Expand All @@ -142,12 +145,18 @@ advanceRoundWithTimeout roundTimeout@RoundTimeout{..} = do
-- * The certified block MUST be for a round that is at least the current round.
advanceRoundWithQuorum ::
( MonadTimeout m,
MonadState (SkovData (MPV m)) m
MonadState (SkovData (MPV m)) m,
MonadLogger m
) =>
-- |Certified block
CertifiedBlock (MPV m) ->
m ()
advanceRoundWithQuorum certBlock = do
logEvent Konsensus LLDebug $
"Advancing round: round "
++ show (qcRound (cbQuorumCertificate certBlock))
++ " certified block "
++ show (qcBlock (cbQuorumCertificate certBlock))
onNewRound
roundStatus
%=! (rsCurrentRound .~ 1 + qcRound (cbQuorumCertificate certBlock))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ receiveTimeoutMessage ::
-- |Result of receiving the 'TimeoutMessage'.
m (ReceiveTimeoutMessageResult (MPV m))
receiveTimeoutMessage tm@TimeoutMessage{tmBody = TimeoutMessageBody{..}} skovData
-- Consenus has been shutdown.
-- Consensus has been shutdown.
| skovData ^. isConsensusShutdown = return ConsensusShutdown
-- The round of the 'TimeoutMessage' is obsolete.
| tmRound < currentRound =
Expand Down
Loading