p2p: Filter Discv4 dial candidates based on forkID#31592
Closed
cskiraly wants to merge 9 commits intoethereum:masterfrom
Closed
p2p: Filter Discv4 dial candidates based on forkID#31592cskiraly wants to merge 9 commits intoethereum:masterfrom
cskiraly wants to merge 9 commits intoethereum:masterfrom
Conversation
Contributor
Author
I've kept the forkID based filter separate from the ENR resolver for code clarity. These could eventually be combined, but I think the code becomes less clear, and the difference in performance should be negligible. |
fjl
reviewed
Apr 29, 2025
Simple version that does the filtering, but misses pipelining, waiting for ENRs to be retrieved one-by-one. Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
It is not guaranteed that Next will be called until exhaustion after Close was called. Hence, we need to empty override the passed channel. Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com> # Conflicts: # eth/backend.go
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Contributor
Author
|
rebased on current master |
Contributor
|
Turns out we already added the filter in #31944, so I guess this can be closed now. |
This file contains hidden or 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
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.
Our Discovery/v4 based dial source was returning nodes without checking the
forkidin the ENR, leading to lots of useless dials.This PR adds a filter on top of the discovery/v4 stream of discovered nodes, returning only those that have a compatible forkID.
More in detail:
Note: This PR is to be rebased after merging #31588