libp2p / libp2p/go-libp2p-pubsub

Offloading messages for async validation

Open
#169 18 comments 2 reactions 1 assignee View on GitHub

@vyzo is already working on this.

Since Mar 18, 2019.

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

Description

From @arnetheduck (Nimbus, ETH 2.0 client):

> @raulk we discussed topic validation in libp2p as a way to prevent bad information from spreading across the gossipsub network, though from what I can tell, the block propagation filtering method in libp2p that you pointed me to is synchronous (https://github.com/libp2p/go-libp2p-pubsub/blob/bfd65a2f6b810c5b4ad2cfe6bb9cc792fd7a0171/floodsub_test.go#L360). this might not sit well with block validation, where we might want to prevent gossiping a block until we've verified it based on data that we receive later. how would you recommend we approach this?
>
> here's the scenario in detail:
> * over gossip, we receive a block whose parent we're missing
> * worst case, this means we cannot yet tell if it's a good / useful block or not
> * we don't want the block to be gossiped further until we've recovered its parent to ensure that it's sane. once we do know it's sane, we want to pass it on.

To summarise:

1. Validation can be costly or not feasible in some scenarios to perform sync.
2. Is it feasible to consume the message, do validation offline, then republish it? How does that affect message caches, duplicate detection across the network (e.g. if we send the message to peers who had already seen it -- and possibly even propagated it if they had more complete data than us), do we generate a new message ID?
3. What are the differences on the wire between publishing a message afresh, and spreading a gossiped message?

In a nutshell: is it possible to offload a message from the pubsub router for async validation, then resume its gossiping conditionally?

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.