Skip to content

Commit ad90ba1

Browse files
committed
fix: verify checkpoint headers in getEpochProofPublicInputs (A-1373)
getEpochProofPublicInputs sources the fee recipient/value from the supplied checkpoint headers but never validated that they hash to the stored headers, so a mismatch only reverted on the on-chain submit path instead of when an off-chain caller assembles the public inputs. Call verifyHeaders in the getter as well, and import ProposedHeaderLib in Rollup.t.sol so the test that exercises this path compiles.
1 parent d76fe1b commit ad90ba1

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

l1-contracts/src/core/libraries/rollup/EpochProofLib.sol

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,11 @@ library EpochProofLib {
183183
}
184184
}
185185

186+
// The fee recipient/value below are sourced from the supplied headers, so the header hashes must be validated here
187+
// as well as on the submit path - otherwise an off-chain caller of this getter would assemble public inputs from
188+
// unverified fee fields and only discover the mismatch when the on-chain proof reverts.
189+
verifyHeaders(_start, _end, _headers);
190+
186191
bytes32[] memory publicInputs = new bytes32[](Constants.ROOT_ROLLUP_PUBLIC_INPUTS_LENGTH);
187192

188193
// Structure of the root rollup public inputs we need to reassemble:

l1-contracts/test/Rollup.t.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {Registry} from "@aztec/governance/Registry.sol";
1212
import {Inbox} from "@aztec/core/messagebridge/Inbox.sol";
1313
import {Outbox} from "@aztec/core/messagebridge/Outbox.sol";
1414
import {Errors} from "@aztec/core/libraries/Errors.sol";
15-
import {ProposedHeader} from "@aztec/core/libraries/rollup/ProposedHeaderLib.sol";
15+
import {ProposedHeader, ProposedHeaderLib} from "@aztec/core/libraries/rollup/ProposedHeaderLib.sol";
1616

1717
import {
1818
IRollupCore,

0 commit comments

Comments
 (0)