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

[WIP] feat(network): initial gossip implementation #465

Closed
wants to merge 1 commit into from

Conversation

dancoombs
Copy link
Collaborator

#248

Proposed Changes

  • Add an MVP for the p2p gossip protocol. Mostly to learn about issues with the protocol specification.
  • Lots of TODOs in the code that need to be addressed.

3 big spec issues currently:

  1. The discovery definition doesn't explain how to find other peers that support a particular mempool. The mempool id should somehow be added to the ENR. This can either happen by somehow mapping mempool id to mempool subnet, or by adding the mempool id list directly to the ENR.
  2. The definition for message_id doesn't allow the message to be sent across multiple topics. It currently gets deduplicated before being forwarded on the 2nd topic. There are 2 solutions here both with downsides.
    a. Include the topic in the message_id. This is how the latest consensus spec defines them. The downside is that the messages will get sent/received across all topics.
    b. Somehow get the libp2p spec changed to allow the same message_id to be propagated across multiple topics.

Relevant section: https://github.com/libp2p/specs/blob/master/pubsub/gossipsub/gossipsub-v1.0.md#message-cache

  1. user_ops_with_entry_point is a completely invalid message type for the gossip protocol. It should be a single user operation. Else each gossiped message that has a different list will have different message IDs, each peer will then have to get each list and deduplicate the contents. Massive waste.

Going to write these things up and propose changes to the p2p spec.

@codecov
Copy link

codecov bot commented Oct 12, 2023

Codecov Report

Merging #465 (9d38cc8) into danc/p2p-discv5 (6c48301) will increase coverage by 0.53%.
The diff coverage is 85.17%.

Impacted file tree graph

Files Coverage Δ
crates/network/src/behaviour.rs 100.00% <ø> (ø)
crates/network/src/gossip/mod.rs 100.00% <100.00%> (ø)
crates/network/src/rpc/handler/codec.rs 94.92% <ø> (ø)
crates/network/src/rpc/handler/inbound.rs 80.43% <ø> (ø)
crates/network/src/rpc/handler/outbound.rs 89.58% <ø> (ø)
crates/network/src/rpc/handler/serde.rs 95.52% <ø> (-0.16%) ⬇️
crates/network/src/rpc/protocol.rs 84.37% <ø> (-0.25%) ⬇️
crates/network/src/gossip/message.rs 98.38% <98.38%> (ø)
crates/network/src/types.rs 97.22% <97.22%> (ø)
crates/network/src/gossip/topic.rs 94.36% <94.36%> (ø)
... and 2 more
Flag Coverage Δ
unit-tests 56.60% <85.17%> (+0.53%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
rundler binary 0.00% <ø> (ø)
builder 45.04% <ø> (ø)
dev 0.00% <ø> (ø)
pool 59.54% <ø> (ø)
provider 1.33% <ø> (ø)
rpc 18.26% <ø> (ø)
sim 82.61% <ø> (ø)
tasks ∅ <ø> (∅)
types 93.56% <ø> (ø)
utils 7.20% <ø> (ø)
network 89.28% <85.17%> (+0.16%) ⬆️

@github-actions github-actions bot added the stale label Nov 12, 2023
@github-actions github-actions bot closed this Nov 17, 2023
@dancoombs dancoombs deleted the danc/p2p-gossip branch November 24, 2024 16:42
@dancoombs dancoombs restored the danc/p2p-gossip branch November 24, 2024 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant