test(networking): add codec test vectors for varint, gossip topics, and message IDs#608
Merged
tcoratger merged 1 commit intoleanEthereum:mainfrom Apr 14, 2026
Conversation
…nd message IDs Introduces a NetworkingCodecTest fixture that generates JSON test vectors for networking wire-format codecs. Client teams can consume these to validate their implementations against the reference encoding. Three codecs are covered in this first phase: - Varint (LEB128): 15 vectors covering single-byte through 10-byte (2^64-1) boundary values - Gossip topic strings: 8 vectors covering block, aggregation, and attestation subnet topics with fork digest edge cases - Gossip message ID: 8 vectors covering valid/invalid snappy domains, empty inputs, and domain differentiation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
NetworkingCodecTestfixture: extensible fixture class for networking wire-format conformance testing, using acodec_namediscriminator to dispatch to codec-specific handlersThese are the first networking-layer test vectors. The fixture infrastructure is extensible — adding gossipsub RPC encoding, discovery v5 codecs, or ENR encoding in future PRs only requires a new
codec_namehandler and test file.Test plan
uvx tox -e all-checkspasses (ruff, format, ty, codespell, mdformat)uv run fill --fork=devnet --clean -n auto -- tests/consensus/devnet/networking/generates all 30 fixturesuv run fill --fork=devnet --clean -n autogenerates all 253 fixtures (no regressions)🤖 Generated with Claude Code