Gossipsub topic filters (#1767)

## Proposed Changes

Adds a gossipsub topic filter that only allows subscribing and incoming subscriptions from valid ETH2 topics.

## Additional Info

Currently the preparation of the valid topic hashes uses only the current fork id but in the future it must also use all possible future fork ids for planned forks. This has to get added when hard coded forks get implemented.

DO NOT MERGE: We first need to merge the libp2p changes (see https://github.com/sigp/rust-libp2p/pull/70) so that we can refer from here to a commit hash inside the lighthouse branch.
This commit is contained in:
blacktemplar
2020-10-14 10:12:57 +00:00
parent 8248afa793
commit a0634cc64f
3 changed files with 60 additions and 17 deletions

View File

@@ -42,7 +42,7 @@ regex = "1.3.9"
[dependencies.libp2p]
#version = "0.23.0"
git = "https://github.com/sigp/rust-libp2p"
rev = "fb4fda2e393fc113577ef45f0ecdfe68e24f13dd"
rev = "a731aa803d986977c25a77ed2b002d9578f7377c"
default-features = false
features = ["websocket", "identify", "mplex", "noise", "gossipsub", "dns", "tcp-tokio"]