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

P2P: fix UnknownCapabilityvalidation and maintainig #3647

Merged
merged 3 commits into from
Dec 29, 2024

Conversation

AnnaShaleva
Copy link
Member

@AnnaShaleva AnnaShaleva commented Dec 28, 2024

Description

This PR fixes peer discovery mechanism for the nodes with at least one UnknownCapability included into the list of node's capabilities.

Follow the logic implemented in nspcc-dev/neo-go#3778: the node will relay UnknownCapability information through the network even if it's not known to the node itself. @roman-khimov, you may argue with the last commit, but I consider first and second commits as a must-have, otherwise discovery won't work for the nodes with UnknownCapability (which is not the problem for NeoGo).

Type of change

  • Optimization (the change is only an optimization)
  • Style (the change is only a code style for better maintenance or standard purpose)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Unit tests

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Otherwise it can't be properly passed through the P2P network which makes
it impossible to use UnknownCapabilities as an extensions in the existing
networks.

Follow nspcc-dev/neo-go#3778.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
Without this commit every `Addr` message containing UnknownCapability
will be considered as invalid. The desired behaviour is to include node
with UnknownCapability into the list of peers.

Follow the nspcc-dev/neo-go#3778, should be a
part of #3639.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
Make the behaviour compatible with
nspcc-dev/neo-go#3778.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
@Jim8y
Copy link
Contributor

Jim8y commented Dec 28, 2024

emmmmm, i need sometime to check the p2p part to better understand this pr. But no need to wait for me, just keep going.

@nan01ab
Copy link
Contributor

nan01ab commented Dec 29, 2024

LGTM

@shargon shargon merged commit d55f0a1 into master Dec 29, 2024
7 checks passed
@shargon shargon deleted the fix-capability-validation branch December 29, 2024 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants