-
Notifications
You must be signed in to change notification settings - Fork 42
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
network-libp2p: Add fixes and improvements to discovery protocol #2461
Open
jsdanielh
wants to merge
5
commits into
albatross
Choose a base branch
from
jsdanielh/network2
base: albatross
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+161
−99
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jsdanielh
force-pushed
the
jsdanielh/network2
branch
from
May 9, 2024 19:19
c122841
to
1cfe168
Compare
Eligioo
reviewed
May 10, 2024
jsdanielh
force-pushed
the
jsdanielh/network2
branch
from
May 10, 2024 14:45
1cfe168
to
fd8f7aa
Compare
jsdanielh
added
the
testnet-restart
Change breaks the protocol and requires a testnet restart
label
May 14, 2024
jsdanielh
force-pushed
the
jsdanielh/network2
branch
5 times, most recently
from
May 20, 2024 17:40
2b9c6d0
to
1bfe8cd
Compare
nibhar
reviewed
May 20, 2024
jsdanielh
force-pushed
the
jsdanielh/network2
branch
7 times, most recently
from
May 27, 2024 12:52
5777122
to
2377895
Compare
hrxi
reviewed
May 29, 2024
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.
Looks good to me, left some comments.
Add limits to the peer contact addresses and add the ability to verify that these limits are followed when a peer contact is received from the network (discovery protocol).
Reduce the reported observed addresses to a single address within the discovery protocol. This avoids DoS attacks from a peer sending several observed addresses for a specific connection. In terms of functionality, it stays the same since we were only reporting a single observed address (the address that got us a connection). Also reduced the interaction between the handler and the behaviour by setting handler attributes on the constructor instead of using events to the handler.
Do not use the observed addresses sent through the discovery protocol since these addresses are not authenticated and it's been observed that they are not adding any useful address to a peer and instead were adding addresses with incorrect TCP/UDP ports.
jsdanielh
force-pushed
the
jsdanielh/network2
branch
3 times, most recently
from
May 30, 2024 21:38
91b3003
to
74ab225
Compare
Add timeout for the state transition in the discovery handler such that a peer don't hold us in a state indefinitely if it doesn't send us back a message we expect. This fixes #2458.
Add verification of peer contacts received from the different messages that can transmit a list of peer contacts in the discovery protocol. The verification includes checks for appropriate lengths, signatures and number of addresses.
jsdanielh
force-pushed
the
jsdanielh/network2
branch
from
May 30, 2024 22:08
74ab225
to
fc08ae5
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's in this pull request?
This fixes DoS in Discovery Handler #2458.
Pull request checklist
clippy
andrustfmt
warnings.