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

feat: use gossipsub for consensus broadcasts #1139

Open
sdbondi opened this issue Sep 12, 2024 · 0 comments
Open

feat: use gossipsub for consensus broadcasts #1139

sdbondi opened this issue Sep 12, 2024 · 0 comments
Assignees
Milestone

Comments

@sdbondi
Copy link
Member

sdbondi commented Sep 12, 2024

Problem

Hotstuff and cerberus are message based protocols. Currently we implement a message protocol that requires nodes to connect to every other node in the local shard. For cross shard messaging, we implement a strategy that limits the number of messages sent but relies on multiple connections per peer across shards.

Proposal 1

Leverage libp2p's gossipsub for all consensus broadcasts to local/foreign shards.

At a high-level:

  1. Each shard subscribes to their topic consensus-{start}-{end} (start and end are the start/end shards in the ShardGroup type) (see mempool gossip)
  2. Ambient peer discovery required by gossipsub is already performed by the Tari-implemented peer sync protocol and L1 registrations
  3. Peers maintain enough connections (recommended 4/5) to local nodes
  4. Peers maintain at least one connection to each foreign shard
    Investigate: do we have to implement points 3/4 or perhaps we can intelligently establish/select an existing connection when the message is sent or perhaps gossipsub can work out who to connect to for us?

https://docs.libp2p.io/concepts/pubsub/overview/

**Notes: **

  • cerberus assumes some form of reliable broadcast and a solution to the cluster-sending problem, I'm unsure if gossipsub fits this
  • Subscriptions to topics will need to be managed on epoch change and on validator node registration, this should happen outside of the consensus crate
  • NB: The output messaging trait should remain as is, except for broadcast, which can take in a shard group instead of individual VN public keys (this should save us some epoch manager calls!). Outbound broadcast will simply publish on the topic shard_group_to_topic(shard_group) -> String
@mrnaveira mrnaveira self-assigned this Sep 12, 2024
@sdbondi sdbondi added this to the v0.0.1 milestone Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants