-
Notifications
You must be signed in to change notification settings - Fork 7
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
Various improvements #60
Conversation
… mesh peers and all peers functions
@@ -375,7 +375,9 @@ impl Decoder for GossipsubCodec { | |||
// ensure the sequence number is a u64 | |||
let sequence_number = if verify_sequence_no { | |||
if let Some(seq_no) = message.seqno { | |||
if seq_no.len() != 8 { | |||
if seq_no.len() == 0 { |
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.
We have all decided that this is invalid and we should register it as such
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.
Hmmm... note that this check is only active for ValidationMode Strict
and Permissive
, so it is not really relevant to ETH2, I changed that before we switched to Anonymous
because in protobuf a missing value is equivalent to its default (which is in case of bytes the zero byte value).
invalid_messages.push((message, ValidationError::InvalidPeerId)); | ||
continue; | ||
if let Some(bytes) = message.from { | ||
if bytes.len() > 0 { |
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.
Same here, bytes.len() == 0 is invalid.
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.
Looks good
Various improvements (see single commits for an overview).