libp2p / libp2p/go-libp2p

Migrate Swarm notifications to the Eventbus

Open
#801 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
6.9k
Forks
1.3k
Avg merge
13d 21h
Merged PRs (30d)
1

Description

We already emit events such as `Identify Completed`, `PeerProtocols Updated` etc. on the host Eventbus. It will be good if we also migrate Swarm notifications to the host Eventbus. This will enable subsystems to be notified of Network events such as Connections, Disconnections etc. without having to depend on the Host/Network. It will also remove the need for subsystems to have dual subscriptions(Swarm & Eventbus) to be notified of all the events in libp2p.

However, we **must ensure backward compatibility** by not breaking the existing Swarm notification mechanism.

Some work for this has been done at:
1. https://github.com/libp2p/go-libp2p-core/pull/57
2. https://github.com/libp2p/go-libp2p-swarm/pull/140

However, it needs to be refined and taken to completion.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing host Eventbus and Swarm notification mechanisms, then read go-libp2p-core/pull/57 and go-libp2p-swarm/pull/140 to understand the unfinished approach. Define how network events such as connections and disconnections should reach the Eventbus while preserving existing Swarm notifications; completion requires backward compatibility and removal of the need for dual subscriptions.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.