-
Notifications
You must be signed in to change notification settings - Fork 442
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
Cleanup of disconnection reasons #5221
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.
If breaches are not needed, then looks good.
NdmInvalidHiSignature = 0x13, | ||
NdmHostAddressesNotConfigured = 0x14, | ||
NdmPeerAddressesNotConfigured = 0x15 | ||
Other = 0x10 |
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.
If I'm not mistaken, for geth 0x10
is breach of protocol.
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.
So... probably fix that also.
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.
Yeah its. Its a lot of things afaik
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.
Nah, i would stick to the spec
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 can call it subprotocol but that isnt that clear. Idk
src/Nethermind/Nethermind.Network/P2P/Messages/DisconnectMessageSerializer.cs
Show resolved
Hide resolved
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.
If confirmed by the node running you could remove breach1 and breach2, but PR is okay now
@@ -14,9 +14,10 @@ public byte[] Serialize(DisconnectMessage msg) | |||
{ | |||
return Rlp.Encode( | |||
Rlp.Encode((byte)msg.Reason) // sic!, as a list of 1 element | |||
).Bytes; | |||
).Bytes; // we are not encoding the details as it is not part of the spec. but maybe it will be in the future. |
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.
I guess, this comment should be removed
Changes
Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Remarks
Breach was discussed with tomasz and he said that some peers used to send that instead of disconnection reason. I believe it is not important any longer and can be removed. also in the case that devp2p issue i posted here gets traction:
ethereum/devp2p#221
we might need to add more disconnection reasons that might use the same numbers as the ones i am removing.