NethermindEth / NethermindEth/pluto
Improve `alpha test peers`: match Charon's probes; reduce timeouts
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 8
- Forks
- 5
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 37
Description
Summary
pluto alpha test peers is architecturally different from Charon's testpeers.go: instead of imperative per-test probes it runs one passive swarm event loop and synthesizes verdicts from accumulated state afterwards (build_peer_results). Concrete defects:
PingLoaddoesn't load-test: it filters passively-observed keepalive RTTs (in-code admission atpeers.rs#L944-L963); Charon spawns a new ping goroutine every second for the load window. The "Running ping load tests..." log lines wrap a phase where no pinging occurs.Pingis a connectivity check (any connection, even a relay circuit, passes);PingMeasuregrades.last()of whatever keepalive pings happened to land — no on-demand ping exists.DirectConndials advertised addresses once (one-shot bool), doesn't use the existingcrates/p2p/src/force_direct.rs, never checks Charon'slen(conns) >= 2invariant, and with no DCUtR behaviour inPlutoBehaviourit can't hole-punch — behind NAT it always reports failure.- Hangs: an unreachable peer keeps
peer_is_donefalse, so the loop runs to the global--timeout(default 1h); afterwardskeep_node_aliveruns for--keep-alive(default 30m). A default-flag run against a dead ENR occupies ~90 minutes. Charon bounds each test individually. - Self is excluded from results (Charon includes the local peer);
Libp2pTCPPortOpenalways fails on default flags (no--p2p-tcp-addressdefault); scoring is a placeholder TODO. alpha test allpanics:all.rs#L34-L45isunimplemented!()reachable from the CLI. The wholetestmodule sits under#![allow(dead_code)]with a "foundation" TODO.
Proposed change
- Add active probes: an on-demand ping path (libp2p
pingbehaviour request or a dedicated protocol), used byPing/PingMeasure/PingLoadwith Charon's cadences; rewriteDirectConnaroundforce_directwith per-second retries and the 2-connection assertion. - Bound each test by its own timeout so unreachable peers fail fast; decouple keep-alive from the test-phase cancellation token.
- Include the local peer; give
--p2p-tcp-addressa sensible default or make the self-test skip when unset. - Implement
alpha test allper Charon'srunTestAll: run beacon → validator → MEV → infra → peers sequentially, forcing each sub-config's quiet flag, and write all collected results at the end when the top-level--quietis unset. Port the two pre-run guards —must_output_to_file_on_quietand the--test-casesrejection — and resolve thelist_test_cases(TestCategory::All)TODO, which returns an empty vec. (Removing the subcommand until this lands is still better than shipping the panic.)
Acceptance
Against one reachable and one dead ENR: results print within the per-test timeouts, ping tests measure actively, and alpha test all runs all five categories with Charon's quiet semantics instead of panicking.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with crates/cli/src/commands/test/peers.rs, especially build_peer_results and peer_is_done, then compare Charon's testpeers.go. Read crates/p2p/src/force_direct.rs and the entry points in all.rs and test/mod.rs. Done means per-test timeouts, active ping behavior, direct-connection checks, and alpha test all completing the stated reachable/dead-ENR acceptance run without panicking.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, distributed-systems, networking
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100