Commit 983038e
authored
fix(archiver): skip descendants of invalid-attestations checkpoints (#23502)
## Motivation
`archiver/src/modules/l1_synchronizer.ts` skipped checkpoints with
insufficient/invalid attestations under the assumption that the next
proposer would invalidate them before publishing. When that assumption
was violated — i.e., proposer P2 published a valid-attestations
checkpoint that extended P1's invalid one — the archiver hit
`InitialCheckpointNumberNotSequentialError` in
`block_store.addCheckpoints`, the catch handler rolled back the L1 sync
point, and the next poll re-fetched the same range and re-threw. The
archiver looped indefinitely. The protocol already defines
`OffenseType.PROPOSED_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS`
for exactly this case but the slasher couldn't see valid-attestations
descendants because the archiver threw before emitting any event.
### Human Note
This is particularly relevant under pipelining. Attestors now attest to
a checkpoint _before_ the previous one is pushed to L1, so they can be
inadvertently attesting to a checkpoint built on top of one that became
invalid as it was published to the rollup the contract with wrong
attestations. So an honest attestor could get slashed if the proposer
was malicious.
## Approach
In the synchronizer, persist rejected ancestors in the block store keyed
by archive root. On each new checkpoint, before attestation validation,
compare its `header.lastArchiveRoot` against the persisted set — if it
matches, skip the checkpoint as a descendant of an invalid ancestor and
emit a new
`L2BlockSourceEvents.CheckpointBuiltOnInvalidAncestorDetected` event
with enough metadata to resolve the proposer. The slasher's
`AttestationsBlockWatcher` is fixed to slash the proposer (not the
attestors) under the new event.
Fixes A-10721 parent a51f60a commit 983038e
14 files changed
Lines changed: 875 additions & 172 deletions
File tree
- yarn-project
- archiver/src
- modules
- store
- aztec-node/src/aztec-node
- end-to-end/src/e2e_epochs
- foundation/src/branded-types
- sequencer-client/src
- sequencer
- slasher/src/watchers
- stdlib/src
- block
- interfaces
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
689 | 689 | | |
690 | 690 | | |
691 | 691 | | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
692 | 699 | | |
693 | 700 | | |
694 | 701 | | |
| |||
780 | 787 | | |
781 | 788 | | |
782 | 789 | | |
783 | | - | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
784 | 798 | | |
785 | 799 | | |
786 | 800 | | |
787 | 801 | | |
788 | 802 | | |
789 | | - | |
790 | 803 | | |
791 | 804 | | |
792 | 805 | | |
793 | 806 | | |
794 | 807 | | |
795 | | - | |
796 | | - | |
797 | | - | |
798 | 808 | | |
799 | 809 | | |
800 | 810 | | |
| |||
831 | 841 | | |
832 | 842 | | |
833 | 843 | | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
834 | 914 | | |
835 | 915 | | |
836 | 916 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
| 34 | + | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
0 commit comments