Skip to content

test(verify_signatures): reject attestation with empty aggregation_bits#665

Merged
tcoratger merged 1 commit intoleanEthereum:mainfrom
tcoratger:test/verify-signatures-empty-bits
Apr 22, 2026
Merged

test(verify_signatures): reject attestation with empty aggregation_bits#665
tcoratger merged 1 commit intoleanEthereum:mainfrom
tcoratger:test/verify-signatures-empty-bits

Conversation

@tcoratger
Copy link
Copy Markdown
Collaborator

🗒️ Description

Adds the rejection vector for `aggregation_bits.py:33`:

```
"Aggregated attestation must reference at least one validator"
```

The block builder never produces an attestation with no participants because its aggregation pass starts from a non-empty validator set. This rejection only fires for blocks received from a malicious peer.

Uses a new `clear_first_attestation_bits` tamper operation: the valid block is built with a single-participant attestation, and the tamper hook replaces its `aggregation_bits` with a bitfield where no bit is set. Signature verification must reject the block before looking up any public key.

Tamper extension

Extends the dispatcher in #663/#664 with the `clear_first_attestation_bits` operation.

⚠️ Depends on #664#663

Stacked on `test/verify-signatures-proposer-bounds` → `framework/verify-signatures-tamper`. Please review and merge #663 then #664 first; after both land I'll rebase this on `main`.

🔗 Related Issues or PRs

Stacked on #664. Depends on #663.

✅ Checklist

  • Ran `tox` checks to avoid unnecessary CI fails:
    ```console
    uvx tox -e all-checks
    ```
  • Considered adding appropriate tests for the changes.
  • N/A for docs — test-vector-only PR.

🤖 Generated with Claude Code

@tcoratger tcoratger force-pushed the test/verify-signatures-empty-bits branch from bbe597b to 7608488 Compare April 21, 2026 21:03
Adds the rejection vector for aggregation_bits.py:33:
"Aggregated attestation must reference at least one validator".

The block builder never produces an attestation with no participants
because its aggregation pass starts from a non-empty validator set.
This rejection only fires for blocks received from a malicious peer.

Uses a new clear_first_attestation_bits tamper operation: the valid
block is built with a single-participant attestation, and the tamper
hook replaces its aggregation_bits with a bitfield where no bit is
set. Signature verification must reject the block before looking up
any public key.

Extends the tamper dispatcher with the new operation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tcoratger tcoratger force-pushed the test/verify-signatures-empty-bits branch from 7608488 to bd4048a Compare April 21, 2026 21:38
@tcoratger tcoratger merged commit e9d9f3b into leanEthereum:main Apr 22, 2026
12 of 13 checks passed
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>
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