Skip to content

Conversation

@dharjeezy
Copy link
Contributor

closes #409

@dharjeezy dharjeezy requested a review from lexnv October 14, 2025 09:40
Comment on lines 1138 to 1140
let adresses = context.dial_failure_addresses(&[address.clone()]);

match context.tx.try_send(make_dial_failure_event(peer, adresses.clone())) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: Is there a way to avoid the cloning here? Maybe changing the signature of the fn to take a & Multiaddr?

I would also inline the make_dial_failure_event:

match context.tx.try_send(InnerTransportEvent::DialFailure { peer, addresses })

Instead of cloning the addreses here (addresses.clone()), we could recreate the addresses on error

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i have changed to this inline way, but can't still do without cloning

Copy link
Collaborator

@lexnv lexnv left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thanks again for contributing 🙏

@lexnv lexnv requested a review from dmitry-markin October 31, 2025 12:26
peer,
addresses: vec![address.clone()],
})
.send(InnerTransportEvent::DialFailure { peer, addresses })
Copy link
Collaborator

Choose a reason for hiding this comment

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

@dharjeezy Can you also add to the doc of InnerTransportEvent & TransportEvent that addresses is only forwarded if the protocol was registered with DialFailureAddresses::Required, please?

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.

TransportManager: Improve the efficiency of propagating dial failure messages

3 participants