Commit 1b27a78
committed
fix(validity): regenerate an aggregation proof the chain reverts
An aggregation proof the L2OO rejects was resubmitted unchanged on every loop.
The request stays `Complete`, so it keeps counting toward
fetch_active_agg_proofs_count and create_aggregation_proofs never builds a
replacement; the L2OO stops advancing until someone edits the row by hand.
Observed on QA3: agg request 946 sat Complete for two days while 486 range
proofs piled up ~90k blocks ahead of a frozen contract head, every loop
resubmitting bytes the verifier had already rejected with `InvalidExitCode()`
(0x1fcf9177).
Fail the request on the first revert instead. Resubmitting bytes the chain has
rejected cannot succeed, so there is nothing to retry; failing it drops the row
out of that count and the next loop builds a fresh aggregation over the same
range. This covers the causes without having to tell them apart — a guest that
halted abnormally, an L1 head reorged out from under the checkpoint, a config
the contract no longer agrees with all present as a revert, and all are fixed by
regenerating. The checkpoint case even self-heals: create_aggregation_proofs
re-checkpoints when the stored L1 hash no longer matches the contract's, which
is exactly what 946 needed.
Delivery failures are excluded. A transport error, timeout or nonce problem says
nothing about the proof, and regenerating on those would cost a full aggregation
proof every time the RPC hiccups.
is_execution_revert matches text, case-insensitively, because neither source has
a stable typed form: a node rejecting the transaction up front returns a
JSON-RPC error, and the on-chain case is the message relay_aggregation_proof
builds from `receipt.status()`. EIP-1474 fixes the error CODE at 3, not the
message text, so the code is matched too — an unrecognised revert is the
stuck-forever bug, while over-matching costs one regenerated proof, and that
asymmetry decides which way to err. The trailing colon on `error code 3:` is
load-bearing: bare, it prefix-matches `error code 32000`, geth's generic server
error, which is a delivery failure. Six tests pin both directions, including the
ones that must NOT trigger regeneration.
A DB error from the Failed transition is logged rather than propagated: the
caller logs whatever this function returns, and a DB error there would appear in
place of the revert that explains the failure. A failed transition only means
the next loop resubmits and reverts again.
Two unrelated fixes ride along, both protecting afaf9bc rather than this
change: the HSM_API_NAME comment alignment that wrap_comments split into what
reads as an unrelated paragraph, and a lint step asserting op-succinct-validity
and sp1-sdk resolve the same tonic — three tonic versions already coexist in
this tree, and if that pairing diverges the typed downcast silently returns None
and the transport classifier degrades to the substring matching afaf9bc
removed, with no compile error and no failing test.
Supersedes an earlier approach (reverted before this commit) that read the guest
exit code out of each proof before storage. It worked, but only addressed one
cause, and the cost of being cause-specific was steep: two SP1-internal crates
to reach a type with no stability guarantee, the same check duplicated across
both prover paths, and a retry counter whose increment, clear and threshold were
three more things to get wrong. A revert is the same signal, arrives at one
place, and needs none of that.1 parent c033da5 commit 1b27a78
3 files changed
Lines changed: 163 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
92 | 109 | | |
93 | 110 | | |
94 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
107 | 137 | | |
108 | 138 | | |
109 | 139 | | |
| |||
1350 | 1380 | | |
1351 | 1381 | | |
1352 | 1382 | | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
1353 | 1424 | | |
1354 | 1425 | | |
1355 | 1426 | | |
| |||
1993 | 2064 | | |
1994 | 2065 | | |
1995 | 2066 | | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
| 2072 | + | |
| 2073 | + | |
| 2074 | + | |
| 2075 | + | |
| 2076 | + | |
| 2077 | + | |
| 2078 | + | |
| 2079 | + | |
| 2080 | + | |
| 2081 | + | |
| 2082 | + | |
| 2083 | + | |
| 2084 | + | |
| 2085 | + | |
| 2086 | + | |
| 2087 | + | |
| 2088 | + | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
| 2099 | + | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
1996 | 2138 | | |
1997 | 2139 | | |
1998 | 2140 | | |
| |||
0 commit comments