apollo_network: migrate BootstrappingBehaviour to delegate dialling to DiallingBehaviour#13219
Conversation
guy-starkware
left a comment
There was a problem hiding this comment.
@guy-starkware reviewed 6 files and all commit messages, and made 2 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on ShahakShama and sirandreww-starkware).
crates/apollo_network/src/discovery/behaviours/bootstrapping/mod.rs line 47 at r1 (raw file):
for (peer_id, address) in bootstrap_peers { if peer_id == local_peer_id { info!("Skipping bootstrap peer with same ID as local peer: {address}");
Is this going to trigger every time the node comes up? Or only for some of the nodes that happen to be on the list of bootstraps? If every time, I'm not sure it deserves a log.
crates/apollo_network/src/discovery/behaviours/bootstrapping/mod.rs line 58 at r1 (raw file):
if peers_map.is_empty() { warn!("No bootstrap peers provided, bootstrapping will not be possible");
Not sure if we want a panic here or not. How bad is it to come up without bootstrap peers?
8c0348d to
b4df324
Compare
e0945f9 to
a9a316a
Compare
b4df324 to
edc724e
Compare
bab9573 to
28626bc
Compare
edc724e to
12dac01
Compare
12dac01 to
e3709c8
Compare
28626bc to
7e89443
Compare
e3709c8 to
32d641e
Compare
7e89443 to
477e6fa
Compare
477e6fa to
3d7c956
Compare
32d641e to
9168c75
Compare
3d7c956 to
963c8f1
Compare
9168c75 to
f5f9ce7
Compare
sirandreww-starkware
left a comment
There was a problem hiding this comment.
@sirandreww-starkware made 2 comments.
Reviewable status: 5 of 6 files reviewed, 2 unresolved discussions (waiting on guy-starkware and ShahakShama).
crates/apollo_network/src/discovery/behaviours/bootstrapping/mod.rs line 47 at r1 (raw file):
Previously, guy-starkware wrote…
Is this going to trigger every time the node comes up? Or only for some of the nodes that happen to be on the list of bootstraps? If every time, I'm not sure it deserves a log.
This code has been moved but not changed. If you'd like I can move it back to where it was?
crates/apollo_network/src/discovery/behaviours/bootstrapping/mod.rs line 58 at r1 (raw file):
Previously, guy-starkware wrote…
Not sure if we want a panic here or not. How bad is it to come up without bootstrap peers?
This code has been moved but not changed. If you'd like I can move it back to where it was?
guy-starkware
left a comment
There was a problem hiding this comment.
@guy-starkware reviewed 1 file and all commit messages, and made 2 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on ShahakShama and sirandreww-starkware).
crates/apollo_network/src/discovery/behaviours/bootstrapping/mod.rs line 47 at r1 (raw file):
Previously, sirandreww-starkware (Andrew Luka) wrote…
This code has been moved but not changed. If you'd like I can move it back to where it was?
No, I was just thinking about this info! log. You don't have to change it at this point but consider if this log gives me any additional information.
crates/apollo_network/src/discovery/behaviours/bootstrapping/mod.rs line 58 at r1 (raw file):
Previously, sirandreww-starkware (Andrew Luka) wrote…
This code has been moved but not changed. If you'd like I can move it back to where it was?
I don't mind where the code is. Just reading through it and suggesting what ever I see. If you don't want to make changes to the moved code just now at least think about modifying it later.
f5f9ce7 to
72feead
Compare
963c8f1 to
07836b1
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
07836b1 to
b3f8e4d
Compare
|
Was this here in the previous discovery? I think no. I think it only appears in identify |
b3f8e4d to
39760aa
Compare
71c761a to
0d8ba96
Compare
sirandreww-starkware
left a comment
There was a problem hiding this comment.
@sirandreww-starkware made 2 comments and resolved 2 discussions.
Reviewable status: 3 of 6 files reviewed, 2 unresolved discussions (waiting on guy-starkware and ShahakShama).
crates/apollo_network/src/discovery/behaviours/bootstrapping/mod.rs line 106 at r2 (raw file):
Previously, ShahakShama wrote…
Was this here in the previous discovery? I think no. I think it only appears in identify
It was, I tagged you in that location
crates/apollo_network/src/discovery/behaviours/bootstrapping/bootstrap_peer.rs line 146 at r3 (raw file):
self.should_add_peer_to_kad_routing_table = false; Poll::Ready(Some(ToSwarm::GenerateEvent( ToOtherBehaviourEvent::FoundListenAddresses {
@ShahakShama this shows what you asked about
39760aa to
b9f5e9d
Compare
ShahakShama
left a comment
There was a problem hiding this comment.
@ShahakShama reviewed 3 files and all commit messages, made 2 comments, and resolved 2 discussions.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on sirandreww-starkware).
crates/apollo_network/src/discovery/behaviours/bootstrapping/mod.rs line 106 at r2 (raw file):
Previously, sirandreww-starkware (Andrew Luka) wrote…
It was, I tagged you in that location
Ah ok, this is for peer manager


Note
Medium Risk
Changes bootstrapping connection lifecycle and shifts dial/retry responsibility to the shared
DialingBehaviour, which could affect reconnect behavior and event ordering if routing is incorrect.Overview
Bootstrapping no longer performs libp2p dials directly.
BootstrappingBehaviouris rewritten to maintain aHashMapof bootstrap peers and emit queuedToOtherBehaviourEvent::RequestDialevents (initially and on full disconnect), relying on the existingDialingBehaviourto execute dials and handle retry/backoff.On successful outbound connection to a bootstrap peer, it now emits
FoundListenAddressesand explicitly drops any queued staleRequestDialfor that peer to handle rapid disconnect/reconnect ordering.Tests are updated to assert
RequestDial/routing behavior (including a new rapid reconnect case),Discoverytest wiring simulates network-manager routing by forwardingRequestDialtoDialingBehaviour, and the e2e broadcast test avoids early swarm polling that would otherwise drop initialRequestDialevents.Written by Cursor Bugbot for commit b9f5e9d. This will update automatically on new commits. Configure here.