Commit d9df901
test: add test vectors for verifying multi message proofs (leanEthereum#810)
* test(testing): add VerifyMultiMessageProofsTest fixture
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.
* test(consensus): add multi-message verify vectors for lstar
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.
* test(testing): cover multi-message-specific rejection paths and dedup 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>
---------
Co-authored-by: Thomas Coratger <60488569+tcoratger@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent c2b7d07 commit d9df901
7 files changed
Lines changed: 685 additions & 13 deletions
File tree
- packages/testing/src/consensus_testing
- test_fixtures
- tests/consensus/lstar/verify_proofs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
| 23 | + | |
| 24 | + | |
20 | 25 | | |
21 | 26 | | |
| 27 | + | |
22 | 28 | | |
23 | 29 | | |
24 | 30 | | |
| |||
42 | 48 | | |
43 | 49 | | |
44 | 50 | | |
| 51 | + | |
45 | 52 | | |
46 | 53 | | |
47 | 54 | | |
| |||
70 | 77 | | |
71 | 78 | | |
72 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
73 | 86 | | |
74 | 87 | | |
75 | 88 | | |
| |||
94 | 107 | | |
95 | 108 | | |
96 | 109 | | |
| 110 | + | |
97 | 111 | | |
98 | 112 | | |
99 | 113 | | |
| |||
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
14 | 22 | | |
15 | 23 | | |
16 | 24 | | |
| |||
27 | 35 | | |
28 | 36 | | |
29 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
30 | 44 | | |
31 | 45 | | |
32 | 46 | | |
| |||
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
0 commit comments