Skip to content

test(networking): add end-to-end req/resp protocol message vectors#616

Merged
tcoratger merged 1 commit intoleanEthereum:mainfrom
tcoratger:test/reqresp-end-to-end-protocol-vectors
Apr 15, 2026
Merged

test(networking): add end-to-end req/resp protocol message vectors#616
tcoratger merged 1 commit intoleanEthereum:mainfrom
tcoratger:test/reqresp-end-to-end-protocol-vectors

Conversation

@tcoratger
Copy link
Copy Markdown
Collaborator

Summary

  • 6 new test vectors extending the req/resp codec suite with real Lean consensus protocol messages and Snappy multi-chunk boundary tests
  • The original 15 vectors tested the framing layer with arbitrary hex data; these test the full stack: SSZ container → varint length → Snappy framing → wire bytes

New vectors

Vector What it tests
Status request 80-byte fixed-size SSZ (Checkpoint + Checkpoint) through full pipeline
Status response Same payload with SUCCESS response code byte prefix
BlocksByRoot (2 roots) 68-byte variable-size SSZ with list offsets
BlocksByRoot (empty) Minimal 4-byte SSZ offset-only payload
Snappy chunk boundary 65536-byte payload at exact single-chunk limit
Multi-chunk 65537-byte payload forcing 2 Snappy frames

Why this matters

The original vectors proved the framing layer works for arbitrary data. These prove it works for the actual protocol messages that travel between consensus clients — Status for handshake and BlocksByRootRequest for block sync.

Test plan

  • uvx tox -e all-checks passes
  • uv run fill --fork=devnet --clean -n auto -- tests/consensus/devnet/networking/ generates all 113 fixtures
  • Verified Status wire bytes: varint prefix 0x50 (80) + Snappy stream identifier
  • Verified multi-chunk vector produces 2 Snappy frames

🤖 Generated with Claude Code

Extends the req/resp codec test suite with vectors that use real Lean
consensus SSZ message types (Status, BlocksByRootRequest) through the
full wire pipeline, and adds Snappy multi-chunk boundary tests.

New vectors:
- Status request (80-byte fixed-size SSZ through varint + Snappy)
- Status SUCCESS response (same payload with response code prefix)
- BlocksByRootRequest with two roots (68-byte variable-size SSZ)
- BlocksByRootRequest with empty root list (minimal 4-byte SSZ)
- Snappy chunk boundary (65536 bytes, exact single-chunk limit)
- Multi-chunk payload (65537 bytes, forces 2 Snappy frames)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tcoratger tcoratger merged commit 2c691ba into leanEthereum:main Apr 15, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant