Skip to content

feat: optimize proof submission - #25406

Open
alexghr wants to merge 1 commit into
stack/feat-only-verify-new-headersfrom
stack/feat-optimize-proof-submission
Open

feat: optimize proof submission#25406
alexghr wants to merge 1 commit into
stack/feat-only-verify-new-headersfrom
stack/feat-optimize-proof-submission

Conversation

@alexghr

@alexghr alexghr commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Further optimize the proof submission flow:

  1. hash haeader from calldata instead of memory (avoids a copy)
  2. read header hashes in bulk (avoid checks run on every iteration of a loop)
  3. reuse already read header hashes

Other than submitting a proof of the first checkpoint (which is +2k gas compared to next) every other scenario is cheaper than the code on next.

Scenario Current gas vs #25404 vs origin/next
1 fresh 663,452 −1,506 (−0.23%) +2,243 (+0.34%)
8 fresh 965,328 −21,594 (−2.19%) −14,985 (−1.53%)
8→16 extension 930,160 −28,490 (−2.97%) −57,867 (−5.86%)
16 fresh 1,256,565 −44,700 (−3.44%) −34,869 (−2.70%)
32 fresh 1,729,965 −91,388 (−5.02%) −75,071 (−4.16%)

@alexghr
alexghr requested a review from just-mitch as a code owner September 4, 2026 17:31
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