Skip to content

Commit 83d412d

Browse files
authored
fix(op): configure discv5 properly in op builder (#9058)
1 parent c5aee02 commit 83d412d

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

crates/net/discv5/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ impl ConfigBuilder {
131131
}
132132

133133
/// Adds boot nodes in the form a list of [`NodeRecord`]s, parsed enodes.
134-
pub fn add_unsigned_boot_nodes(mut self, enodes: impl Iterator<Item = NodeRecord>) -> Self {
134+
pub fn add_unsigned_boot_nodes(mut self, enodes: impl IntoIterator<Item = NodeRecord>) -> Self {
135135
for node in enodes {
136136
if let Ok(node) = BootNode::from_unsigned(node) {
137137
self.bootstrap_nodes.insert(node);

crates/node-core/src/args/network.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ impl NetworkArgs {
185185
} = self.discovery;
186186

187187
builder
188-
.add_unsigned_boot_nodes(chain_bootnodes.into_iter())
188+
.add_unsigned_boot_nodes(chain_bootnodes)
189189
.lookup_interval(discv5_lookup_interval)
190190
.bootstrap_lookup_interval(discv5_bootstrap_lookup_interval)
191191
.bootstrap_lookup_countdown(discv5_bootstrap_lookup_countdown)

crates/optimism/node/src/node.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,18 @@ where
292292
}
293293

294294
builder
295+
})
296+
// ensure we configure discv5
297+
.map_discv5_config_builder(|builder| {
298+
builder
299+
.add_unsigned_boot_nodes(ctx.chain_spec().bootnodes().unwrap_or_default())
300+
.lookup_interval(ctx.config().network.discovery.discv5_lookup_interval)
301+
.bootstrap_lookup_interval(
302+
ctx.config().network.discovery.discv5_bootstrap_lookup_interval,
303+
)
304+
.bootstrap_lookup_countdown(
305+
ctx.config().network.discovery.discv5_bootstrap_lookup_countdown,
306+
)
295307
});
296308

297309
let mut network_config = ctx.build_network_config(network_builder);

0 commit comments

Comments
 (0)