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

Swarm Event Intuition #4251

Closed
AgeManning opened this issue Jul 25, 2023 · 2 comments
Closed

Swarm Event Intuition #4251

AgeManning opened this issue Jul 25, 2023 · 2 comments

Comments

@AgeManning
Copy link
Contributor

Description

I have been recently doing some debugging.

My assumptions where that the SwarmEvents would be general, in the sense that they would catch all errors. So matching on these would give a good overview of the system.

I've noticed in particular, that the SwarmEvent::OutgoingConnectionError does not include ConnectionDenied events. So if dialing a peer fails, it is not registered in the SwarmEvents, rather I have to match on a behviour event, particularly FromSwarm::DialFailure (https://github.com/libp2p/rust-libp2p/blob/master/swarm/src/behaviour.rs#L425)

I think mostly these two events show the same information, but the SwarmEvent one is less general. I would have assumed the swarm event to be more general than the behaviour event.

I am just pointing this out because in case this is not intended.

@thomaseizinger
Copy link
Contributor

Once we fix #3046 (which is basically already done, we are just delaying merging breaking changes at the moment), we can - as a follow-up - express SwarmEvent as a composition of FromSwarm and NetworkBehaviour::ToSwarm which should resolve these inconsistencies once and for all!

@thomaseizinger
Copy link
Contributor

I am closing this in favor of #4268.

@thomaseizinger thomaseizinger closed this as not planned Won't fix, can't repro, duplicate, stale Jul 29, 2023
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

No branches or pull requests

2 participants