Skip to content

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

Open
@lexnv

Description

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(),
})

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions