apollo_network: KadRequesting emits RequestDial events via DiallingBehaviour#13218
Conversation
guy-starkware
left a comment
There was a problem hiding this comment.
@guy-starkware reviewed 2 files and all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on ShahakShama and sirandreww-starkware).
8c0348d to
b4df324
Compare
13aac61 to
25d474d
Compare
b4df324 to
edc724e
Compare
25d474d to
3ce8c4d
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.
edc724e to
12dac01
Compare
3ce8c4d to
af4bcfb
Compare
e3709c8 to
32d641e
Compare
sirandreww-starkware
left a comment
There was a problem hiding this comment.
@sirandreww-starkware made 1 comment.
Reviewable status: 1 of 2 files reviewed, 1 unresolved discussion (waiting on guy-starkware and ShahakShama).
32d641e to
9168c75
Compare
ShahakShama
left a comment
There was a problem hiding this comment.
@ShahakShama reviewed 2 files and all commit messages, and made 2 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on guy-starkware and sirandreww-starkware).
crates/apollo_network/src/discovery/behaviours/kad_requesting.rs line 40 at r4 (raw file):
pending_dials: VecDeque<(PeerId, Vec<Multiaddr>)>, /// Peers for which a `RequestDial` event has been dispatched to `DiallingBehaviour` but no /// connection has been established yet.
This is incorrect. Peers that a connection has been established with are in this list as well
sirandreww-starkware
left a comment
There was a problem hiding this comment.
@sirandreww-starkware made 3 comments.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on guy-starkware and ShahakShama).
crates/apollo_network/src/discovery/behaviours/kad_requesting.rs line 40 at r4 (raw file):
Previously, ShahakShama wrote…
This is incorrect. Peers that a connection has been established with are in this list as well
That's not true, we remove the peer once a ConnectionEstablished event is emitted
crates/apollo_network/src/discovery/behaviours/kad_requesting.rs line 150 at r3 (raw file):
// TODO(AndrewL): When target peers change, cancel DialPeerStreams in DiallingBehaviour // for peers no longer in the target set. Currently those streams retry indefinitely.
@ShahakShama here
Code quote:
// TODO(AndrewL): When target peers change, cancel DialPeerStreams in DiallingBehaviour
// for peers no longer in the target set. Currently those streams retry indefinitely.
sirandreww-starkware
left a comment
There was a problem hiding this comment.
@sirandreww-starkware made 1 comment.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on guy-starkware and ShahakShama).
crates/apollo_network/src/discovery/behaviours/kad_requesting.rs line 150 at r3 (raw file):
Previously, sirandreww-starkware (Andrew Luka) wrote…
@ShahakShama here
solved in #13282
ShahakShama
left a comment
There was a problem hiding this comment.
@ShahakShama made 1 comment and resolved 2 discussions.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on guy-starkware and sirandreww-starkware).
crates/apollo_network/src/discovery/behaviours/kad_requesting.rs line 40 at r4 (raw file):
Previously, sirandreww-starkware (Andrew Luka) wrote…
That's not true, we remove the peer once a ConnectionEstablished event is emitted
So you can return to dialing_peers 😅
9168c75 to
f5f9ce7
Compare
734c3f6 to
01d86d9
Compare
sirandreww-starkware
left a comment
There was a problem hiding this comment.
@sirandreww-starkware made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on guy-starkware and ShahakShama).
crates/apollo_network/src/discovery/behaviours/kad_requesting.rs line 40 at r4 (raw file):
Previously, ShahakShama wrote…
So you can return to dialing_peers 😅
I don't know, I kind of like it better now (more descriptive)
sirandreww-starkware
left a comment
There was a problem hiding this comment.
@sirandreww-starkware resolved 1 discussion.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on guy-starkware).
guy-starkware
left a comment
There was a problem hiding this comment.
@guy-starkware reviewed all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on sirandreww-starkware).
f5f9ce7 to
72feead
Compare
01d86d9 to
2492cef
Compare
2492cef to
8120ff7
Compare
72feead to
71c761a
Compare
71c761a to
0912f23
Compare
8120ff7 to
f833912
Compare
Merge activity
|


Note
Medium Risk
Changes peer dialing flow in the discovery subsystem by replacing direct swarm dial requests with delegated dial events and new de-duplication state; this can affect connectivity/retry behavior if the new state handling is incorrect.
Overview
Discovery dialing is now delegated via events instead of direct swarm dials.
KadRequestingBehaviournow queues Kademlia results as(PeerId, Vec<Multiaddr>)and emitsToOtherBehaviourEvent::RequestDial(with addresses) rather thanToSwarm::Dial.It adds tracking for peers with an active dial request to avoid repeated dial dispatches, and cleans up
pending_dials/active tracking on connection establishment and whenset_target_peersresets the target set.discovery::Behaviouris updated to pass the full Kademlia(peer_id, addresses)tuples through and forwardRequestDialtoDialingBehaviour.Written by Cursor Bugbot for commit 0912f23. This will update automatically on new commits. Configure here.