Skip to content

feat: add high-level connection and stream progress events#3429

Merged
dozyio merged 5 commits intomainfrom
feat/add-connection-and-stream-progress-events
Apr 2, 2026
Merged

feat: add high-level connection and stream progress events#3429
dozyio merged 5 commits intomainfrom
feat/add-connection-and-stream-progress-events

Conversation

@achingbrain
Copy link
Copy Markdown
Member

@achingbrain achingbrain commented Apr 1, 2026

Where an operation might involve multiple libp2p operations - opening connections and streams, it is useful to be able to track which connections and streams are being opened, to which peers and how long it takes using the same onProgress callback.

Add 4x new progress events with enough context in the event object to track these activities during calls to libp2p.dial, libp2p.dialProtocol and connection.newStream:

  • connection:open
  • connection:opened
  • connection:open-stream
  • connection:opened-stream

Uses connection:xxx event names to not tie the event names to internal libp2p architecture (e.g. connection:open instead of connection-manager:open-connection).

Updates libp2p interface and relevant protocols to use progress event types that contain the relevant events.

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if necessary (this includes comments as well)
  • I have added tests that prove my fix is effective or that my feature works

@achingbrain achingbrain requested a review from a team as a code owner April 1, 2026 12:39
@achingbrain
Copy link
Copy Markdown
Member Author

achingbrain commented Apr 1, 2026

Depends on:

@achingbrain achingbrain force-pushed the feat/add-connection-and-stream-progress-events branch from b16629c to bb43f63 Compare April 1, 2026 12:46
Base automatically changed from fix/add-dial-target-type to main April 1, 2026 22:13
Where an operation might involve multiple libp2p operations - opening
connections and streams, it is useful to be able to track which
connections and streams are being opened, to which peers and how
long it takes using the same `onProgress` callback.

Add 4x new progress events with enough context in the event object
to track these activities during calls to `libp2p.dial`,
`libp2p.dialProtocol` and `connection.newStream`:

- `connection:open`
- `connection:opened`
- `connection:open-stream`
- `connection:opened-stream`
@achingbrain achingbrain force-pushed the feat/add-connection-and-stream-progress-events branch from 197c91d to b624f17 Compare April 2, 2026 06:30
@dozyio
Copy link
Copy Markdown
Collaborator

dozyio commented Apr 2, 2026

Thanks @achingbrain

@dozyio dozyio merged commit 709b3fa into main Apr 2, 2026
34 checks passed
@dozyio dozyio deleted the feat/add-connection-and-stream-progress-events branch April 2, 2026 19:38
@tabcat tabcat mentioned this pull request Apr 2, 2026
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