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/discover: improve discv5 NODES response packing #26033

Merged
merged 7 commits into from
Nov 7, 2022
Merged

Conversation

fjl
Copy link
Contributor

@fjl fjl commented Oct 23, 2022

Instead of using a limit of 3 nodes per message, we can pack more nodes into each message based on size. In my testing, this halves the number of sent NODES messages, because ENR size is usually < 300 bytes.

Analogous to ListSize, these functions compute the encoded size of an object.
@fjl fjl requested a review from zsfelfoldi as a code owner October 23, 2022 20:37
p2p/discover/v5_udp.go Outdated Show resolved Hide resolved
Co-authored-by: Martin Holst Swende <martin@swende.se>
@ligi ligi removed the status:triage label Nov 1, 2022
p2p/discover/v5_udp.go Outdated Show resolved Hide resolved
rlp/raw_test.go Show resolved Hide resolved
Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fjl fjl merged commit 9027ee0 into ethereum:master Nov 7, 2022
@fjl fjl added this to the 1.11.0 milestone Nov 7, 2022
shekhirin pushed a commit to shekhirin/go-ethereum that referenced this pull request Jun 6, 2023
Instead of using a limit of three nodes per message, we can pack more nodes
into each message based on ENR size. In my testing, this halves the number
of sent NODES messages, because ENR size is usually < 300 bytes.

This also adds RLP helper functions that compute the encoded size of
[]byte and string.

Co-authored-by: Martin Holst Swende <martin@swende.se>
MoonShiesty pushed a commit to MoonShiesty/go-ethereum that referenced this pull request Aug 30, 2023
Instead of using a limit of three nodes per message, we can pack more nodes
into each message based on ENR size. In my testing, this halves the number
of sent NODES messages, because ENR size is usually < 300 bytes.

This also adds RLP helper functions that compute the encoded size of
[]byte and string.

Co-authored-by: Martin Holst Swende <martin@swende.se>
nibty pushed a commit to FairCrypto/go-ethereum that referenced this pull request Apr 10, 2024
Instead of using a limit of three nodes per message, we can pack more nodes
into each message based on ENR size. In my testing, this halves the number
of sent NODES messages, because ENR size is usually < 300 bytes.

This also adds RLP helper functions that compute the encoded size of
[]byte and string.

Co-authored-by: Martin Holst Swende <martin@swende.se>
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.

None yet

3 participants