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

Various improvements #60

Merged
merged 13 commits into from
Sep 25, 2020
Merged

Various improvements #60

merged 13 commits into from
Sep 25, 2020

Conversation

blacktemplar
Copy link

Various improvements (see single commits for an overview).

@@ -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 {
Copy link
Member

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

Copy link
Author

@blacktemplar blacktemplar Sep 25, 2020

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 {
Copy link
Member

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.

Copy link
Member

@AgeManning AgeManning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@AgeManning AgeManning merged commit c7f0716 into gossipsub-v1.1 Sep 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants