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

Cleanup of disconnection reasons #5221

Merged
merged 5 commits into from
Jan 31, 2023

Conversation

smartprogrammer93
Copy link
Contributor

Changes

  • remove NDM and Breach disconnection reasons

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a change that causes existing functionality not to work as expected)
  • Optimization
  • Refactoring
  • Documentation update
  • Build-related changes
  • Other: Description

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

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.

Copy link
Contributor

@rubo rubo left a 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
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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

Copy link
Contributor Author

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

Copy link
Contributor

@MarekM25 MarekM25 left a 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.
Copy link
Contributor

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

@smartprogrammer93 smartprogrammer93 merged commit 0531d39 into master Jan 31, 2023
@smartprogrammer93 smartprogrammer93 deleted the refactor/cleanup_disconnect_reason branch January 31, 2023 10:31
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.

4 participants