Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: Clone DialError for better error reporting to installed protocols #261

Open
lexnv opened this issue Oct 3, 2024 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@lexnv
Copy link
Collaborator

lexnv commented Oct 3, 2024

The transport manager receives a DialFailure { error: DialError } on dial failures.
Because the DialError does not implement Clone, the installed protocols receive only a DialFailure { peer, address } without details about the failure.

Implement Clone for the DialError to propagate more information to installed protocols.

This aims to improve the error details provided to substrate, especially regarding substream open errors:

 TRACE tokio-runtime-worker sub-libp2p::peerset: /b0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe/transactions/1: failed to open substream to PeerId("12D3KooWQKqane1SqWJNWMQkbia9qiMWXkcHtAdfW5eVF8hbwEDw"): DialFailure
 
 TRACE tokio-runtime-worker sub-libp2p::peerset: /b0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe/transactions/1: failed to open substream to PeerId("12D3KooWMRUgWaDJEqAhhoCg81Yhwrs9DxLLYscJDTsE4sk2Srnj"): DialFailure
...

Event received by the TransportManager:

TransportEvent::DialFailure { connection_id, address, error } => {

Event sent to protocols without error details:

.send(InnerTransportEvent::DialFailure {
peer,
address: address.clone(),
})

@lexnv lexnv added the enhancement New feature or request label Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant