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

Make the SwarmEvent report everything #1515

Merged
merged 4 commits into from
Mar 26, 2020
Merged

Conversation

tomaka
Copy link
Member

@tomaka tomaka commented Mar 25, 2020

Adds new variants and improves the existing variants of the SwarmEvent in order to report everything that happens in the swarm in terms of connectivity.

This way, the outside can track exactly what happens.

Some notes:

  • Reporting the errors enums (rather than opaque Box<Error>s) is going to be quite helpful in Substrate to detect connections closed because they were idle, and dial failures because of peer id mismatch.

  • I changed some usizes into u32s. In general, usize should only be used for things that depend on the platform's pointer width.

  • I purposefully left aside the concept of "external addresses", as the way we handle them is still quite blurry at the moment.

@tomaka tomaka requested a review from romanb March 25, 2020 09:40
core/src/connection/pool.rs Outdated Show resolved Hide resolved
core/src/connection/pool.rs Outdated Show resolved Hide resolved
core/src/network.rs Outdated Show resolved Hide resolved
core/src/network/event.rs Outdated Show resolved Hide resolved
swarm/src/lib.rs Outdated Show resolved Hide resolved
swarm/src/lib.rs Outdated Show resolved Hide resolved
swarm/src/lib.rs Outdated Show resolved Hide resolved
swarm/src/lib.rs Outdated Show resolved Hide resolved
swarm/src/lib.rs Outdated Show resolved Hide resolved
tomaka and others added 2 commits March 25, 2020 13:06
Co-Authored-By: Roman Borschel <romanb@users.noreply.github.com>
Copy link
Contributor

@romanb romanb left a comment

Choose a reason for hiding this comment

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

See also #1519.

@tomaka tomaka merged commit 7220877 into libp2p:master Mar 26, 2020
@tomaka tomaka deleted the better-swarm-events branch March 26, 2020 17:02
folex added a commit to fluencelabs/rust-libp2p that referenced this pull request Mar 30, 2020
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