Skip to content

test: add test vectors for verifying multi message proofs#810

Merged
tcoratger merged 3 commits into
leanEthereum:mainfrom
unnawut:verify-multi-message-proofs-vectors
Jun 1, 2026
Merged

test: add test vectors for verifying multi message proofs#810
tcoratger merged 3 commits into
leanEthereum:mainfrom
unnawut:verify-multi-message-proofs-vectors

Conversation

@unnawut
Copy link
Copy Markdown
Collaborator

@unnawut unnawut commented Jun 1, 2026

🗒️ Description

Add test vectors for verifying multi message proofs for various basic scenarios like 2 attestations from different slots and mixed attester sizes

🔗 Related Issues or PRs

Follows #786

unnawut and others added 3 commits June 1, 2026 11:42
Mirror the single-message fixture for the Type-2 multi-message aggregate
primitive: per-component validator lists, per-component attestation data,
emitted parallel lists of messages, slots, public keys, and aggregation
bits, plus the merged proof bytes.

Three tampers target one component at a time:
- RebindComponentToAlternateHeadRoot regenerates one component against an
  alternate head root and re-merges, so the emitted layout stays honest
  but the merged proof bytes carry the off-target binding.
- IncrementComponentSlot bumps one component's emitted slot past its
  bound slot.
- SwapComponentParticipantPublicKey swaps one participant's key for
  another validator's, breaking the layout the merged proof verifies
  against.
Three positive vectors covering two- and three-component bundles with
single-, four-, and mixed-sized participant lists; three rejection
vectors covering wrong message, wrong slot, and wrong public key applied
to one component at a time.
… the verify ladder

Add the failure modes that only a multi-message (Type-2) proof can suffer,
which the initial vector set did not reach:

- SwapComponentMessageBindings transposes two components' emitted
  message-slot bindings after an honest merge, with distinct head roots per
  component, so each component's proof faces the other's binding. This is the
  canonical Type-2 attack the positional binding exists to reject.
- DropComponentMessageBinding removes one component's binding while keeping
  its keys, exercising the verifier's binding-count guard.

Add two valid vectors for parity with the single-message suite: a single
component bundle (the n=1 boundary) and a non-contiguous committee whose
aggregation bits resolve to [1, 0, 1, 1].

Factor the identical expectation-comparison ladder into
BaseConsensusFixture.assert_expected_outcome and reuse it from both verify
fixtures. Hoist the repeated component-index range check into a helper, and
guard the slot-increment tamper against landing on a neighbour's slot.

Inline the per-test attestation data to match the single-message sibling
files, rename the ambiguous swap field to participant_index, and correct the
union docstring.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tcoratger tcoratger force-pushed the verify-multi-message-proofs-vectors branch from 676623d to f06601e Compare June 1, 2026 09:44
@tcoratger tcoratger merged commit d9df901 into leanEthereum:main Jun 1, 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.

2 participants