-
Notifications
You must be signed in to change notification settings - Fork 28
Stateless QBFT consensus message semantic validation #171
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
Changes from 21 commits
8484ab2
7467879
a41c6cb
6109eb7
1b40fa0
e039197
dc3bd78
878c0de
e88d3cf
e5158db
87da566
5a966e5
a4a58be
72ae550
fd3b7c9
c933390
ec791c7
66b4e3f
0e73245
a52f6f2
fab2f25
51c9718
75fe744
74d07a8
a7c537d
f4806ef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| use crate::message::*; | ||
| use crate::msgid::MessageId; | ||
| use crate::msgid::{MessageId, Role}; | ||
| use crate::ValidatorIndex; | ||
| use sha2::{Digest, Sha256}; | ||
| use ssz::{Decode, DecodeError, Encode}; | ||
|
|
@@ -60,12 +60,12 @@ pub struct QbftMessage { | |
| } | ||
|
|
||
| impl QbftMessage { | ||
| /// Do QBFTMessage specific validation | ||
| pub fn validate(&self) -> bool { | ||
| if self.qbft_message_type > QbftMessageType::RoundChange { | ||
| return false; | ||
| } | ||
| true | ||
| pub fn max_round(&self) -> Option<u64> { | ||
| self.identifier.role().and_then(|role| match role { | ||
| Role::Committee | Role::Aggregator => Some(12), | ||
| Role::Proposer | Role::SyncCommittee => Some(6), | ||
| _ => None, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this may be obvious and I'm not getting it but why are we hardcoding 12 and 6 as max rounds? is that ssv spec? 2secs per round and 2 slot window?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I copied it from here https://github.com/ssvlabs/ssv/blob/main/message/validation/consensus_validation.go#L370
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. all good we need to match them on this or we won't timeout at the same time. I would like to ask them where they're pulling this number from because I would assume it's just a guess like follow distance. I will just add an inline comment saying where it's from.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is used only for validation, maybe I shouldn't have added it here.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can move it to the validator if you think it's better. |
||
| }) | ||
| } | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.