-
Notifications
You must be signed in to change notification settings - Fork 138
qbft-instance: log stage durations #2609
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
base: stage
Are you sure you want to change the base?
Conversation
| if inst == nil { | ||
| i := instance.NewInstance(c.GetConfig(), c.CommitteeMember, c.Identifier, msg.QBFTMessage.Height, c.OperatorSigner) | ||
| i := instance.NewInstance(zap.NewNop(), c.GetConfig(), c.CommitteeMember, c.Identifier, msg.QBFTMessage.Height, c.OperatorSigner) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are going to get rid of "decided" messages anyway I'm just passing the zap.NewNop() here for simplicity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iurii-ssv I think it needs to be commented, because after merging it won't be clear why we decided to do this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the comment 👍
Greptile OverviewGreptile Summaryadded comprehensive stage duration logging for QBFT instances to complement existing metrics, enabling better debugging of specific instance misbehavior. The changes introduce a new Key Changes:
Technical Details:
Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant C as Controller
participant I as Instance
participant M as MetricsRecorder
participant T as Timer
Note over C,T: Happy Path: Normal Consensus Flow
C->>I: StartNewInstance(logger, height, value)
I->>M: StartStage(stageProposal)
I->>T: TimeoutForRound(height, FirstRound)
alt Leader for round
I->>I: CreateProposal()
I->>I: Broadcast(proposal)
end
Note over I,M: Proposal Stage → Prepare Stage
I->>I: uponProposal(msg)
I->>M: EndStage(round)
I->>M: StartStage(stagePrepare)
I->>I: Broadcast(prepare)
Note over I,M: Prepare Stage → Commit Stage
I->>I: uponPrepare(msg)
alt Prepare Quorum Reached
I->>M: EndStage(round)
I->>M: StartStage(stageCommit)
I->>I: Broadcast(commit)
end
Note over I,M: Commit Stage → Decided
I->>I: UponCommit(msg)
alt Commit Quorum Reached
I->>M: EndStage(round)
Note over I: Instance Decided
end
Note over C,T: Timeout Path: Round Change Flow
T->>I: UponRoundTimeout()
I->>M: EndStage(round)
I->>M: StartStage(stageRoundChange)
I->>M: RecordRoundChange(round, reasonTimeout)
I->>I: CreateRoundChange(newRound)
I->>I: Broadcast(roundChange)
Note over I,M: Round Change Paths
I->>I: uponRoundChange(msg)
alt Justified Round Change (Quorum)
I->>M: EndStage(prevRound)
I->>M: StartStage(stageProposal)
I->>M: RecordRoundChange(prevRound, reasonJustified)
I->>I: CreateProposal()
I->>I: Broadcast(proposal)
else Partial Quorum
I->>M: EndStage(prevRound)
I->>M: StartStage(stageRoundChange)
I->>M: RecordRoundChange(prevRound, reasonPartialQuorum)
I->>I: CreateRoundChange(newRound)
I->>I: Broadcast(roundChange)
end
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9 files reviewed, no comments
Codecov Report✅ All modified and coverable lines are covered by tests. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
15 files reviewed, 1 comment
This PR adds the missing logging for every stage of QBFT instance to complement the metrics we record (while metrics show a general picture of how things look, they don't help when debugging a specific QBFT instance misbehavior).
Also,
round_changestage was added so we can track it as well (instead of "bundling" it with the rest of the stages).