Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,11 @@ actual_slot = finalized_slot + 1 + relative_index

### Peer Discovery (discv5, opt-in)
- Off by default; `--discovery.enable` plus `--discovery.port` (own UDP socket, must differ from `--gossipsub-port`)
- Reuses ethrex's `DiscoveryServer` + `PeerTable` with discv4 disabled; `spawn` takes the prepared lean ENR, so the record ethrex serves is the one we report
- Reuses ethrex's `DiscoveryServer` with discv4 disabled; `spawn` takes the prepared lean ENR, so the record ethrex serves is the one we report
- ENR follows the beacon phase0 spec: `ip`/`udp`/`quic`/`secp256k1`/`eth2`/`attnets`
- Admission mirrors lighthouse: `eth2.fork_digest` must match, `next_fork_*` may differ, `quic` entry required. Handed to the peer table as `LeanFilter: PeerFilter`, so records are judged on arrival, not at dial time; a reject is re-judged on a higher-`seq` ENR
- Admission mirrors lighthouse: `eth2.fork_digest` must match, `next_fork_*` may differ, `quic` entry required. Handed to discovery as `LeanFilter: PeerFilter`, so records are judged on arrival, not at dial time; a reject is re-judged on a higher-`seq` ENR
- The filter files each admitted peer in `DialTargets`, since discovery hands back a `Node` that carries no `quic`/`attnets`; the dial loop looks the node id back up there
- Every libp2p connection is reported with `DiscoveryHandle::record_peer_event`, which is what lets discovery pace its lookups against `--discovery.target-peers`
- Candidates ranked by uncovered attestation subnets. See [`docs/discovery.md`](docs/discovery.md)

### Retry Strategy on Block Requests
Expand Down
42 changes: 21 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 11 additions & 7 deletions crates/net/p2p/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,17 @@ rand = "0.8"

# Required for NodeEnr parsing.
#
# Pinned to an ethrex release tag, for the unified discovery module, the peer
# table, and the `PeerFilter` seam this crate builds on. A tag rather than a
# branch: a `main` that moves under us would change what this crate builds
# against with nothing in the manifest saying so.
ethrex-p2p = { git = "https://github.com/lambdaclass/ethrex", tag = "v25.0.0" }
ethrex-rlp = { git = "https://github.com/lambdaclass/ethrex", tag = "v25.0.0" }
ethrex-common = { git = "https://github.com/lambdaclass/ethrex", tag = "v25.0.0" }
# Pinned to the head of ethrex PR #7217, which moves the contact table into the
# discovery server and gives a consumer `DiscoveryHandle::record_peer_event` to
# report its own connections with. That is what lets a libp2p client feed
# ethrex's lookup pacing; see `docs/discovery.md`.
#
# A commit rather than a branch, for the reason the release tag it replaces was
# chosen over `main`: what this crate builds against must not move without the
# manifest saying so. Goes back to a tag once #7217 is in a release.
ethrex-p2p = { git = "https://github.com/lambdaclass/ethrex", rev = "4462253ea2785b20d8ee8822034f2a98b49ae839" }
ethrex-rlp = { git = "https://github.com/lambdaclass/ethrex", rev = "4462253ea2785b20d8ee8822034f2a98b49ae839" }
ethrex-common = { git = "https://github.com/lambdaclass/ethrex", rev = "4462253ea2785b20d8ee8822034f2a98b49ae839" }

# Version pinned to ethrex's workspace: `SecretKey` crosses the API boundary.
secp256k1 = { version = "0.30.0", default-features = false, features = ["global-context"] }
Expand Down
Loading
Loading