test(verify_signatures): reject out-of-range proposer_index via tamper#664
Merged
tcoratger merged 1 commit intoleanEthereum:mainfrom Apr 21, 2026
Merged
Conversation
3 tasks
Adds the rejection vector for block.py:277 Proposer index out of range. The builder's round-robin proposer selection never produces an out-of-range index, so this rejection only fires for blocks received from a malicious peer. Uses the verify_signatures tamper hook to set proposer_index to 99 on a block built normally against a 4-validator state. The fixture pins the AssertionError clients must raise. Extends the tamper dispatcher with a set_proposer_index operation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
e989b6a to
a174974
Compare
tcoratger
added a commit
to tcoratger/leanSpec
that referenced
this pull request
Apr 22, 2026
Integrates the metrics→observability split (leanEthereum#667) with the multi-fork layout: - fork code (forks/devnet4/store.py, forks/devnet4/containers/state/state.py) imports only the vendor-neutral observe_on_attestation / observe_on_block / observe_state_transition hooks; no Prometheus-specific metrics land inside forks/, keeping the fork folder consensus-critical by construction - BlockLookup is now the plain dict[Bytes32, Block] alias from leanEthereum#667, so the former dict-subclass imports (Iterator, GetCoreSchemaHandler, ZERO_HASH) and the node's BlockLookup({...}) wrap are dropped - reorg-depth telemetry moves to sync/service.py's default_block_processor and stays off the spec side - consensus tests and fixture builders added in leanEthereum#663, leanEthereum#664, leanEthereum#665, leanEthereum#666 retarget lean_spec.subspecs.containers.* → lean_spec.forks.devnet4.containers.*; the verify_signatures tamper hook's in-function imports are pulled up to the top - drops tests/lean_spec/subspecs/containers/block/test_block_lookup.py (BlockLookup no longer has ancestors / reorg_depth methods to test) Co-Authored-By: Claude Opus 4.7 (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.
🗒️ Description
Adds the rejection vector for `block.py:277` Proposer index out of range. The builder's round-robin proposer selection never produces an out-of-range index, so this rejection only fires for blocks received from a malicious peer.
Uses the `verify_signatures` tamper hook to set `proposer_index` to 99 on a block built normally against a 4-validator state. The fixture pins the `AssertionError` clients must raise.
Tamper extension
Extends the dispatcher in #663 with a `set_proposer_index` operation. Preserves the same contract: tamper runs after the valid build, before verification.
Stacked on `framework/verify-signatures-tamper`. Please review and merge #663 first; after that lands I'll rebase this on `main` and the diff will shrink to just the new operation + test.
🔗 Related Issues or PRs
Stacked on #663.
✅ Checklist
```console
uvx tox -e all-checks
```
🤖 Generated with Claude Code