-
Notifications
You must be signed in to change notification settings - Fork 849
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
chore(net): integrate discv5 config builder #8289
Merged
Merged
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
emhane
added
C-debt
A section of code is hard to understand or change
A-networking
Related to networking in general
labels
May 16, 2024
emhane
requested review from
mattsse,
Rjected,
onbjerg and
gakonst
as code owners
May 16, 2024 12:39
emhane
force-pushed
the
emhane/integrate-discv5
branch
from
May 16, 2024 21:43
a8ab49c
to
64bd7b6
Compare
mattsse
requested changes
May 17, 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.
does this supersede #7856?
that pr is the base of this branch |
mattsse
approved these changes
May 19, 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.
pedantic suggestions, otherwise lgtm
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-networking
Related to networking in general
C-debt
A section of code is hard to understand or change
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.
reth_discv5::ConfigBuilder
intoNetworkConfigBuilder
.The point of having the builder pattern is to build an immutable type. In this case, the config. The way that the network config is currently being built, makes this difficult. This PR tries to keep discv5 config building coherent with discv4 config building, but respecting the builder pattern.
As many args as possible are added inallDiscoveryArgs::apply_to_builder
, but without passing more otherNetworkArgs
as parameters than necessary.DiscoveryArgs
added in outer scope, to enable discv5 by default for optimismDiscoveryArgs
onNetworkArgs
type, are added in the outer scope (NetworkArgs::network_config
).NetworkArgs
, in the same function they are added wrt to instance to discv4 (NetworkArgs::load_network_config
).At best, an issue is made to design the discv4 config to be immutable too, instead of modifying it after it has been built.
Another issue that would make sense, is to move theinstance
flag intoNetworkArgs
.--instance
is used inRpcArgs
too, so must exist parallel toNetworkArgs
andRpcArgs
.