Skip to content

refactor(gas_limiter): canonical + overlay design with epoch tag#488

Merged
julio4 merged 2 commits into
mainfrom
refactor/gas-limiter-overlay
May 22, 2026
Merged

refactor(gas_limiter): canonical + overlay design with epoch tag#488
julio4 merged 2 commits into
mainfrom
refactor/gas-limiter-overlay

Conversation

@julio4
Copy link
Copy Markdown
Member

@julio4 julio4 commented May 5, 2026

Refactor the per-address gas/compute limiter to use per-payload overlays over a shared canonical limiter.

Each payload job now records limiter usage in its own overlay and commits it back when the job finishes. This keeps in-flight payload builds isolated while preserving persistent sender debt across jobs. The
limiter also rejects stale overlay commits when the canonical state has already advanced.

Changes

  • Add canonical + overlay limiter model for gas and compute buckets.
  • Add epoch checks to prevent stale overlays from committing.
  • Add checkpoint/restore support for rolling back failed tx attempts.
  • Wire payload jobs to use limiter overlays.
  • Refresh limiter state before forking payload overlays.

@julio4 julio4 force-pushed the refactor/gas-limiter-overlay branch from b951e01 to f7c1bf1 Compare May 5, 2026 10:25
@akundaz
Copy link
Copy Markdown
Contributor

akundaz commented May 5, 2026

This conflicts hugely with my existing PR (#487). Can you describe to me

  • the api you need for continuous building
  • and the performance concerns you have

Then we can build on top of each other and streamline the work properly

@julio4
Copy link
Copy Markdown
Member Author

julio4 commented May 5, 2026

This conflicts hugely with my existing PR (#487). Can you describe to me

  • the api you need for continuous building
  • and the performance concerns you have

Then we can build on top of each other and streamline the work properly

Yes that's why I extracted it from continuous PR, so that we can merge it first and we can update 487 with this foundation.

There's detailed "What was missing" and "What this fixes for continuous mode" sections in the description upper, but tldr we need cheap copy/overlay as only the winning candidate should consume budgets.

@julio4 julio4 force-pushed the refactor/gas-limiter-overlay branch 4 times, most recently from c7f0ea2 to 595ab27 Compare May 15, 2026 09:56
Comment thread crates/op-rbuilder/src/limiter/bucket.rs Outdated
Comment thread crates/op-rbuilder/src/limiter/mod.rs Outdated
Comment thread crates/op-rbuilder/src/limiter/gas.rs Outdated
Comment thread crates/op-rbuilder/src/builder/context.rs Outdated
Comment thread crates/op-rbuilder/src/limiter/bucket.rs Outdated
@julio4 julio4 force-pushed the refactor/gas-limiter-overlay branch from 595ab27 to 393c338 Compare May 21, 2026 13:46
Copy link
Copy Markdown
Contributor

@akundaz akundaz left a comment

Choose a reason for hiding this comment

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

Looks much better thank you! Just get CI passing and I think this should be good to go

@julio4 julio4 force-pushed the refactor/gas-limiter-overlay branch from 393c338 to 9fcac85 Compare May 21, 2026 15:41
@julio4 julio4 merged commit 55edd74 into main May 22, 2026
4 checks passed
@julio4 julio4 deleted the refactor/gas-limiter-overlay branch May 22, 2026 10:41
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