Skip to content

refactor: relay router and mut relay reserver#392

Open
varex83 wants to merge 7 commits into
mainfrom
bohdan/refactor-relay
Open

refactor: relay router and mut relay reserver#392
varex83 wants to merge 7 commits into
mainfrom
bohdan/refactor-relay

Conversation

@varex83
Copy link
Copy Markdown
Collaborator

@varex83 varex83 commented May 11, 2026

No description provided.

Comment thread crates/p2p/src/relay.rs
match err {
DialError::LocalPeerId { .. } => Self::LocalPeerId,
DialError::NoAddresses => Self::NoAddresses,
DialError::DialPeerConditionFalse(_) => Self::Skipped,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Will it be correctly handled in the on_dial_failure? It'll retry instead of skipping.

Comment thread crates/p2p/src/relay.rs
};
/// Builds circuit listen addresses for a relay from its transport
/// addresses: `/ip4/.../tcp/.../p2p/<relay-id>/p2p-circuit`.
fn circuit_addrs(relay_id: PeerId, addrs: &[Multiaddr]) -> Vec<Multiaddr> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would be good to have some unit test for this function

Comment thread crates/p2p/src/relay.rs
/// Extracts the relay peer id from a circuit listen address of the form
/// `/.../p2p/<relay-id>/p2p-circuit`. Returns `None` if the address is not
/// a relay circuit address.
fn relay_id_from_circuit_addr(addr: &Multiaddr) -> Option<PeerId> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ditto

Comment thread crates/p2p/src/relay.rs
/// Builds circuit dial addresses for reaching `target` through every
/// currently reserved relay:
/// `/.../p2p/<relay-id>/p2p-circuit/p2p/<target>`.
fn peer_circuit_addrs(&self, target: &PeerId) -> Vec<Multiaddr> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ditto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants