fix: reject userOps exceeding the chain batch gas limit cap at quote time#214
Open
fichiokaku wants to merge 1 commit into
Open
fix: reject userOps exceeding the chain batch gas limit cap at quote time#214fichiokaku wants to merge 1 commit into
fichiokaku wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Three production incidents share the same root cause: a userOp whose execution gas limit exceeds the chain's
batcher.batchGasLimitcap (default 8M) is accepted at quote time, the payment userOp executes and charges the user, and then the batcher silently drops the execution userOp with "Invalid maxGasLimit" until its window expires.0xc1a864...574258)0x20c988...cb3663)The user pays for a supertransaction that can never execute, and the client gets no upfront signal.
Fix
Validate in
getPackedMeeUserOpWithGasEstimates(both quote-time call sites go through it) that the userOp's execution gas limit fits the chain's batch cap, and fail the quote with a 400 and an explicit message:Details:
verificationGasLimit + callGasLimit + paymasterVerificationGasLimit + postOpGasLimit, withpreVerificationGasexcluded (not spent during execution). Same config sources (gasLimitOverrides, gas estimator config) asbatcher.service.ts.simulate: true) and client-provided manual limits (simulate: false) - both were previously accepted and dropped.No behavior change for any op that fits the cap. Ops over the cap change from "charged then silently dropped" to "rejected upfront with an actionable error".
Testing
develop)getPackedMeeUserOpWithGasEstimatesflow with no existing test harness; happy to add one if wantedRelated
Per-chain cap bumps (Ethereum 16M under the EIP-7825 tx cap, Chiliz 20M) are being applied via chain config secrets separately - this PR is the guard that makes cap overruns visible instead of billable.