Skip to content

feat: submitProof takes only new headers - #25419

Open
alexghr wants to merge 1 commit into
stack/feat-optimize-proof-submissionfrom
stack/feat-submitproof-takes-only-new-headers
Open

feat: submitProof takes only new headers#25419
alexghr wants to merge 1 commit into
stack/feat-optimize-proof-submissionfrom
stack/feat-submitproof-takes-only-new-headers

Conversation

@alexghr

@alexghr alexghr commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

This PR optimized the partial proof flow by enabling provers to only send the headers for new checkpoints that are proven by the proof. The provers can send smaller payloads (just fees + coinbase) for the already proven checkpoints (which also have their rewards accounted for).

This PR slightly increases gas costs for full epoch proofs (because of all the new checks we have to run on the proven-prefix) but it reduces gas costs on partial epoch proofs that build on previously submitted proof by about ~3.5K/already proven checkpoint (so in the scneario where we prove 8 checkpoints and then another 8 checkpoints we save approx 27k on the second proof)

This PR requires changes to be made to aztec-node to make it compatible with the new contracts.

@alexghr
alexghr requested a review from just-mitch as a code owner September 7, 2026 10:30
"SlashingProposer"
"EmpireBase"
"RollupOperationsExtLib"
"EpochProofExtLib"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious: why is this now needed?

bytes calldata _blobPublicInputs
) internal view returns (bytes32[] memory) {
bytes32[] memory headerHashes = verifyHeaders(_start, _end, _headers, 0);
bytes32[] memory headerHashes = verifyHeaders(_start, _end, _headers, 0, 0);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this method used for the preflight check? If so, shouldn't it set the same arguments as the actual call? Disregard this comment if it's not used for that.

publicInputs[offset + 2 * i] = addressToField(_headers[i].coinbase);
publicInputs[offset + 2 * i + 1] = bytes32(_headers[i].accumulatedFees);
// The submit path fills the compact prefix directly from calldata before verifying the proof.
uint256 suffixOffset = offset + 2 * (numCheckpoints - _headers.length);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add another line of comment explaining why this formula? I had to ask my agent for an explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants