Commit 08cc68b
authored
fix: Handle blocks invalidated with an invalid block (#16836)
Fixes issue with invalidating blocks with invalid attestations. If a
block is invalidated, but immediately replaced with another invalid
block, then the next proposer will attempt to invalidate the original
one, which will fail since its attestations will have been replaced in
L1 storage with the ones from the second one. As an example:
1. Slot S: Block N is proposed with invalid attestations
2. Slot S+1: Block N is invalidated, and block N' (same number) is
proposed instead, but also has invalid attestations
3. Slot S+2: Proposer tries to invalidate block N, when they should
invalidate block N' instead, and fails
Also added a new env var for the archiver
`skipValidateBlockAttestations` so we could force a proposer to keep
building on top of an invalid block, so we could write the test
`proposer invalidates multiple blocks`. This also required moving the
archiver config to stdlib, and adding an `updateConfig` method wired
through the node admin API so we could turn that config on or off.
Last, this PR uses a persistent storage for the
`pendingChainValidationStatus` in the archiver, so it is persisted
across restarts. Otherwise, if a node is restarted while the change is
in an invalid state, it will fail to invalidate such block.File tree
16 files changed
+427
-84
lines changed- yarn-project
- archiver
- src/archiver
- aztec-node/src/aztec-node
- end-to-end/src/e2e_epochs
- epoch-cache/src
- ethereum/src
- contracts
- test
- sequencer-client/src
- client
- publisher
- slasher/src/watchers
- stdlib/src/interfaces
16 files changed
+427
-84
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
12 | 29 | | |
13 | | - | |
14 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
15 | 37 | | |
16 | | - | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
105 | 113 | | |
106 | 114 | | |
107 | 115 | | |
| |||
138 | 146 | | |
139 | 147 | | |
140 | 148 | | |
141 | | - | |
| 149 | + | |
142 | 150 | | |
143 | 151 | | |
144 | 152 | | |
| |||
198 | 206 | | |
199 | 207 | | |
200 | 208 | | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
| 209 | + | |
205 | 210 | | |
206 | 211 | | |
207 | 212 | | |
| |||
220 | 225 | | |
221 | 226 | | |
222 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
223 | 233 | | |
224 | 234 | | |
225 | 235 | | |
| |||
796 | 806 | | |
797 | 807 | | |
798 | 808 | | |
799 | | - | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
800 | 812 | | |
801 | 813 | | |
802 | 814 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
10 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
11 | 15 | | |
| 16 | + | |
12 | 17 | | |
13 | 18 | | |
| 19 | + | |
14 | 20 | | |
15 | 21 | | |
16 | 22 | | |
17 | 23 | | |
18 | 24 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 25 | + | |
45 | 26 | | |
46 | 27 | | |
47 | 28 | | |
| |||
65 | 46 | | |
66 | 47 | | |
67 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
68 | 53 | | |
69 | 54 | | |
70 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1126 | 1126 | | |
1127 | 1127 | | |
1128 | 1128 | | |
1129 | | - | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
1130 | 1133 | | |
1131 | 1134 | | |
1132 | 1135 | | |
| |||
0 commit comments