-
Notifications
You must be signed in to change notification settings - Fork 936
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: handle both compressed and uncompressed disconnect reason decoding #6862
Conversation
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.
lol
nice find, pedantic doc nit
crates/net/eth-wire/src/p2pstream.rs
Outdated
// over the wire, in both snappy compressed and uncompressed forms. | ||
// | ||
// see: | ||
// <https://github.com/paradigmxyz/reth/blob/790bc62e7bd8f940e7b3ff55c98fa6f5a2b197e9/crates/net/eth-wire/src/disconnect.rs#L251-L261> |
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.
can we reference the function instead of the blob
// * snappy compressed, AND | ||
// * uncompressed |
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.
why??? :D
crates/net/eth-wire/src/p2pstream.rs
Outdated
@@ -472,6 +485,17 @@ where | |||
// if we were waiting for a pong, this will reset the pinger state | |||
this.pinger.on_pong()? | |||
} | |||
_ if id == P2PMessageID::Disconnect as u8 => { | |||
// it's possible we already tried to decode this, but it was snappy compressed, | |||
// so we need to decode it again |
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.
should mention that this is now snappy decoded
The following error sometimes shows up on nodes:
The message
c104
is a disconnect reason, and it is uncompressed. We send compressed disconnect reasons. However, some other clients send uncompressed disconnect reasons. This adds handling for decoding uncompressed disconnect reasons inP2PStream
, along with a test.