refactor(networking): remove discv5 package and test surface#734
Merged
tcoratger merged 1 commit intoMay 20, 2026
Merged
Conversation
No lean Ethereum client (Ream, ethlambda, zeam) implements discv5; all converge on libp2p + QUIC with ENR records loaded from static bootnode configuration. The discv5 wire protocol implementation was carried over from beacon-chain assumptions and has zero production consumers. Removes: - src/lean_spec/subspecs/networking/discovery/ (11 files) - tests/lean_spec/subspecs/networking/discovery/ (15 files) - tests/consensus/lstar/networking/test_discv5_*.py and test_discovery_*.py (5 fillers) - packages/testing/.../test_fixtures/discovery_crypto.py - discv5 sections of test_fixtures/networking_codec.py - make_challenge_data helper in tests/lean_spec/helpers/builders.py Keeps subspecs/networking/enr/ (ENR record format is used by all lean clients as a static address record). Updates peer.py and types.py docstrings to drop stale references to "populated from discovery" / "for Discovery v5". Net change: 14k lines removed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
subspecs/networking/discovery/package along with its unit tests, consensus spec fillers, and the associated test-fixture infrastructure (~14k lines removed net).subspecs/networking/enr/— the ENR record format is shared by every lean client.peer.py/types.pythat previously referred to data being "populated from discovery".Why
Cross-client survey of production lean Ethereum clients:
parse_enrs()from abootnodes: Vec<Bootnode>config for static dialingNotably, Ream's repo contains a
discv5Rust crate but its leanReamBehaviourcomposes only identify / req_resp / gossipsub / slow_peer_banlist / connection_limits — no discovery behaviour. The discv5 crate is used only by Ream's beacon-chain target.The discv5 wire protocol implementation in leanSpec appears to have been carried over from beacon-chain assumptions and has zero production consumers across the lean ecosystem.
Scope of deletion
src/lean_spec/subspecs/networking/discovery/— 11 production filestests/lean_spec/subspecs/networking/discovery/— 15 unit test filestests/consensus/lstar/networking/test_discv5_*.pyandtest_discovery_*.py— 5 consensus spec fillers (no lean client consumes the JSON vectors they emitted)packages/testing/src/consensus_testing/test_fixtures/discovery_crypto.py(fixture class)packages/testing/src/consensus_testing/test_fixtures/networking_codec.py(dispatch cases, decoder map entries,_make_discv5_message,_make_discv5_packet,_make_xor_distance,_make_log2_distance,_build_discv5_message)make_challenge_datahelper intests/lean_spec/helpers/builders.py(used only by deleted unit tests)DiscoveryCryptoTest/DiscoveryCryptoTestFillerTest plan
ruff check— passesruff format --check— passesty check— passescodespell— passesmdformat --check docs/— passesuv lock --check— passespytestsuite on CI🤖 Generated with Claude Code