Parent
Sub-issue of #10 (Task 3.1: Prepare testbed environment)
Description
Add an in-process discv5 testbed that runs N nodes inside a single Go program, wired through github.com/marcopolo/simnet as the simulated UDP transport. Pairs with github.com/marcopolo/ethereum-network-latencies for realistic per-pair latencies derived from real-world Ethereum mainnet measurements.
This is a parallel testbed to the Docker-based one (Task 3.1.1, #17). Both have a place:
|
Docker testbed |
simnet testbed |
| Real OS networking |
✓ |
✗ |
| Runs on macOS |
✗ (needs Linux for tc) |
✓ |
| Runs in CI without root |
✗ |
✓ |
| Time to spin up 100 nodes |
~30 s (Docker overhead) |
<1 s |
| Realistic per-pair latencies |
manual via tc filter rules |
natively supported via LatencyFunc |
| Deterministic |
✗ |
✓ (with simnet's synctest integration) |
| Single-process debugging |
hard |
✓ |
The simnet testbed is well-suited for protocol-correctness testing, scale tests beyond what Docker can boot, and reproducible CI runs. The Docker testbed remains useful for final integration smoke tests against real OS sockets.
Scope
- New Go module under
testbed/simnet/ to keep its dependencies (simnet, ethereum-network-latencies) out of the main go.mod. Mirrors the cmd/keeper precedent.
- Adapter shim translating between simnet's
net.PacketConn (using net.Addr) and discv5's UDPConn interface (using netip.AddrPort).
- CLI driving N node instances with configurable per-pair latency, bandwidth, and topology.
- Realistic latencies via the MarcoPolo/ethereum-network-latencies dataset (~7000 masked Ethereum-mainnet IPs with continent encoding and pairwise predicted RTTs from a gradient-boosted decision tree trained on RIPE Atlas + WonderNetworks data).
- Topic registration / search workload runner.
- Per-node structured JSON logging compatible with the existing
testbed/analyse.py analysis pipeline.
Verified scale
Scaffolding so far is verified to bootstrap cleanly at:
- 1000 nodes — 324 MB memory, 1.3 s user CPU
- 2000 nodes — 818 MB memory, 3.5 s user CPU
Extrapolating: ~5K nodes comfortable on a 16 GB laptop, ~20K on a 64 GB Linux server. Materially more capacity than Docker, which tops out around 100-300 nodes per host.
Phase
Phase 3 — Weeks 16-24
Parent
Sub-issue of #10 (Task 3.1: Prepare testbed environment)
Description
Add an in-process discv5 testbed that runs N nodes inside a single Go program, wired through
github.com/marcopolo/simnetas the simulated UDP transport. Pairs withgithub.com/marcopolo/ethereum-network-latenciesfor realistic per-pair latencies derived from real-world Ethereum mainnet measurements.This is a parallel testbed to the Docker-based one (Task 3.1.1, #17). Both have a place:
LatencyFuncsynctestintegration)The simnet testbed is well-suited for protocol-correctness testing, scale tests beyond what Docker can boot, and reproducible CI runs. The Docker testbed remains useful for final integration smoke tests against real OS sockets.
Scope
testbed/simnet/to keep its dependencies (simnet, ethereum-network-latencies) out of the maingo.mod. Mirrors thecmd/keeperprecedent.net.PacketConn(usingnet.Addr) and discv5'sUDPConninterface (usingnetip.AddrPort).testbed/analyse.pyanalysis pipeline.Verified scale
Scaffolding so far is verified to bootstrap cleanly at:
Extrapolating: ~5K nodes comfortable on a 16 GB laptop, ~20K on a 64 GB Linux server. Materially more capacity than Docker, which tops out around 100-300 nodes per host.
Phase
Phase 3 — Weeks 16-24