libp2p / libp2p/go-libp2p-pubsub

Protocol layer-aware pubsub

Open
#246 17 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
364
Forks
221
PR merge metrics
No merged PRs in 30d

Description

Related to https://github.com/libp2p/go-libp2p-core/pull/99 the current gossip implementation has some issues for Prysm.

Firstly, the peers in the mesh are selected from all connected peers. This does not take in to account the fact that some peers may be considered bad at the protocol layer. Ideally, we would be able to inform gossipsub about the protocol layer's view of the world. To give an example how this may work, gossipsub could have two functions, `AddPeer(peer.ID)` and `RmPeer(peer.ID)` that would add and remove peers from a "protocol-ready" list from which gossipsub could build its mesh.

Secondly, messages are forwarded on as soon as they pass the network layer validation. This bypasses the protocol layer and so can forward on messages that pass network layer validation but fail protocol layer validation, resulting in lots of unnecessary work by nodes. In this situation there could be some way of holding off on forwarding a message before it has been validated at the protocol level, or perhaps even just terminating each message when it is received and letting the protocol layer pass the message back to be forwarded out to the mesh as/when it has validated it.

Note that implementation of the first item may well significantly reduce the impact of the second item, as it means that all peers in the mesh will have passed at least a cursory handshake at the protocol layer and so invalid protocol-layer messages would be expected to be significantly lower.

cc @nisdas from Prysm for any further comment.

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

Begin with the current gossip implementation and related PR #99. Compare the proposed protocol-ready peer tracking with the message-forwarding alternatives; done means an agreed implementation that prevents ineligible peers from entering the mesh and addresses protocol-level validation before forwarding.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
distributed-systems, 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.