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

Fix Gossip Message ID #7624

Merged
merged 4 commits into from Oct 24, 2020
Merged

Fix Gossip Message ID #7624

merged 4 commits into from Oct 24, 2020

Conversation

nisdas
Copy link
Member

@nisdas nisdas commented Oct 23, 2020

What type of PR is this?

Feature Addition

What does this PR do? Why is it needed?

  • Adds in new conditional for selecting gossip message id.
  • Fix tests
  • Add the snappy domains to the network config.

Which issues(s) does this PR fix?

Follows on from ethereum/consensus-specs#2089

Other notes for review

@nisdas nisdas requested a review from a team as a code owner October 23, 2020 10:24
@nisdas nisdas added Ready For Review A pull request ready for code review Networking P2P related items labels Oct 23, 2020
@codecov
Copy link

codecov bot commented Oct 23, 2020

Codecov Report

Merging #7624 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #7624   +/-   ##
=======================================
  Coverage   61.87%   61.87%           
=======================================
  Files         422      422           
  Lines       29723    29723           
=======================================
  Hits        18390    18390           
  Misses       8418     8418           
  Partials     2915     2915           

h := hashutil.Hash(pmsg.Data)
return string(h[:])
decodedData, err := snappy.Decode(nil /*dst*/, pmsg.Data)
if err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

err != nil feels a bit generic. On a safer side, do you know what specific errors are ok and are not ok?

Copy link
Member Author

Choose a reason for hiding this comment

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

Afaik, all errors returned from it should signify it is an invalid snappy object.
https://github.com/golang/snappy/blob/master/decode.go#L57

None of the errors there are 'ok', all point to a corrupted/invalid snappy object as of the spec. If it cant be decoded
it should be appended with the invalid domain and then hashed.

@prestonvanloon prestonvanloon added this to the v1.0.0-beta milestone Oct 23, 2020
@prylabs-bulldozer prylabs-bulldozer bot merged commit 92efe64 into master Oct 24, 2020
@delete-merged-branch delete-merged-branch bot deleted the fixSnappy branch October 24, 2020 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Networking P2P related items Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants