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
Implement Vrank metrics and logs #1891
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ian0371
requested review from
aidan-kwon,
jiseongnoh and
yoomee1313
as code owners
July 21, 2023 14:27
jiseongnoh
reviewed
Jul 22, 2023
hyeonLewis
reviewed
Jul 23, 2023
blukat29
reviewed
Jul 24, 2023
blukat29
reviewed
Jul 24, 2023
blukat29
previously approved these changes
Jul 24, 2023
hyeonLewis
previously approved these changes
Jul 24, 2023
hyunsooda
reviewed
Jul 24, 2023
yoomee1313
reviewed
Jul 24, 2023
hyunsooda
previously approved these changes
Jul 25, 2023
yoomee1313
previously approved these changes
Jul 25, 2023
blukat29
previously approved these changes
Jul 25, 2023
hyeonLewis
previously approved these changes
Jul 25, 2023
jiseongnoh
previously approved these changes
Jul 26, 2023
aidan-kwon
reviewed
Jul 26, 2023
ian0371
dismissed stale reviews from jiseongnoh, hyeonLewis, blukat29, yoomee1313, and hyunsooda
via
July 26, 2023 01:52
4b9963c
ian0371
requested review from
blukat29,
hyunsooda,
jiseongnoh,
yoomee1313,
hyeonLewis and
aidan-kwon
July 26, 2023 01:53
aidan-kwon
approved these changes
Jul 26, 2023
hyeonLewis
approved these changes
Jul 26, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes
We collect all commits between two preprepares.
Existing implementation discards "late commit messages" that we receive after turning into the "commit" state.
To receive those commit messages, we must define an independent data structure, hence
Vrank struct
.Metrics
See further comments for an examplery metric output.
Logs
We assess each validator in the committee by how fast it sent its commit message:
The threshold that divides early and late commits is defined as follows:
This is logged as
bitmap
.In addition, the arrival times of late commits are logged as
late
.See further comments for log interpretation.
Types of changes
Please put an x in the boxes related to your change.
Checklist
Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.
$ make test
)Related issues
Further comments
Example metric output:
Example log:
It means that the fourth validator in the committee is late, and that its arrival time is 2ms.
Interpretation of bitmap: 01 => 0x01 => 0b00_00_00_01 => fourth 2-bit is
vrankArrivedLate
, others arevrankArrivedEarly
.Q. Why compress the log?
A. We wanted to reduce the log size as much as possible and reduce verbosity. If the threshold is [2f+1]-th commit arrival time, the size of
late
isf
. If the threshold is preprepared time + 300ms, the size oflate
is more thanf
.Q. Why not use existing variables such as
consensusTimestamp
, orcurrentView
?A. They are reset at
startNewRound()
, which is called almost immediately after turning into the "commit" state.Q. Why threshold is 300ms?
A. In an ideal network, a validator is supposed to receive 2f+1 number of commits within 300ms.