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

fix(op): configure discv5 properly in op builder #9058

Merged
merged 1 commit into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/net/discv5/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ impl ConfigBuilder {
}

/// Adds boot nodes in the form a list of [`NodeRecord`]s, parsed enodes.
pub fn add_unsigned_boot_nodes(mut self, enodes: impl Iterator<Item = NodeRecord>) -> Self {
pub fn add_unsigned_boot_nodes(mut self, enodes: impl IntoIterator<Item = NodeRecord>) -> Self {
for node in enodes {
if let Ok(node) = BootNode::from_unsigned(node) {
self.bootstrap_nodes.insert(node);
Expand Down
2 changes: 1 addition & 1 deletion crates/node-core/src/args/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ impl NetworkArgs {
} = self.discovery;

builder
.add_unsigned_boot_nodes(chain_bootnodes.into_iter())
.add_unsigned_boot_nodes(chain_bootnodes)
.lookup_interval(discv5_lookup_interval)
.bootstrap_lookup_interval(discv5_bootstrap_lookup_interval)
.bootstrap_lookup_countdown(discv5_bootstrap_lookup_countdown)
Expand Down
12 changes: 12 additions & 0 deletions crates/optimism/node/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,18 @@ where
}

builder
})
// ensure we configure discv5
.map_discv5_config_builder(|builder| {
builder
.add_unsigned_boot_nodes(ctx.chain_spec().bootnodes().unwrap_or_default())
.lookup_interval(ctx.config().network.discovery.discv5_lookup_interval)
.bootstrap_lookup_interval(
ctx.config().network.discovery.discv5_bootstrap_lookup_interval,
)
.bootstrap_lookup_countdown(
ctx.config().network.discovery.discv5_bootstrap_lookup_countdown,
)
});
Comment on lines +295 to 307
Copy link
Member

Choose a reason for hiding this comment

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

makes sense


let mut network_config = ctx.build_network_config(network_builder);
Expand Down
Loading