fix(transaction-multi-payment): surface the EVM runner's own error from dispatch_permit - #1517
Open
iamyxsh wants to merge 2 commits into
Open
fix(transaction-multi-payment): surface the EVM runner's own error from dispatch_permit#1517iamyxsh wants to merge 2 commits into
iamyxsh wants to merge 2 commits into
Conversation
…om dispatch_permit Return the inner runner error instead of collapsing every rejection into EvmPermitRunnerError, and key the pre-charge check off the two post-charge errors.
|
Crate versions that have been updated:
Runtime version has been increased. |
|
Quick benchmark at commit f6c734d has been executed successfully. |
Contributor
Author
|
@mrq1911 @enthusiastmartin Review please |
iamyxsh
requested review from
enthusiastmartin and
mrq1911
and removed request for
mrq1911
August 21, 2026 14:08
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.
Description
dispatch_permitcollapsed everyRunner::callrejection into a singleEvmPermitRunnerError. A balance rejection, a gas limit above the per-transactioncap and a gas limit above the block limit were all reported as the same error, so
an integrator could not tell them apart off-chain.
The runner's own error is now returned instead. It reaches callers through
ExtrinsicFailed, so no new event is needed — and on the signed path an eventwould not survive anyway, since that path returns
Errand everything writteninside it is rolled back.
EvmPermitRunnerErroris left defined but unreachable. Removing it would shiftthe indices of every later variant in the enum.
Note for reviewers
EvmPermitRunnerErrorwas doing double duty. Besides being the reported error itwas a sentinel that two call sites compared against to decide whether the runner
had rejected the call before charging anything — which controls whether
on_dispatch_permit_error()fires and whether the signed path returnsErrorcommits
Ok(post_info). Returning a specific error without touching those siteswould have committed a permit nonce that was never consumed.
dispatch_permithas exactly three failure paths:Runner::callrejectedEvmPermitNonceInvariantViolatedSucceedEvmPermitCallExecutionErrorThe check is therefore inverted into a closed positive set,
evm_call_was_executed, and both call sites test the negation. A new failurepath that runs after the nonce is consumed must be added to that set, otherwise
the autopause will fire on it and the signed path will return
Errwhere itshould commit.
Motivation and Context
Integrators building on call permits currently have to guess why a permit was
rejected. The distinction matters operationally: an underfunded fee payer is
fixed by topping up an account, while a gas limit above the per-transaction cap
is fixed by changing the submitted transaction.
How Has This Been Tested?
cargo test -p pallet-transaction-multi-payment— 45 passedcargo test -p runtime-integration-tests evm_permit— 44 passedcargo clippy --all-targetsandcargo fmt --checkcleanTwo existing tests now assert the specific error rather than the collapsed one:
a gas limit above the block limit reports
GasLimitExceedsBlockLimit, and oneabove the per-transaction cap reports
TransactionGasLimitExceedsCap.New test
distinct_runner_rejections_should_reach_the_caller_as_distinct_errorsdrives both rejections through the same code path and asserts each specific error
plus that the two remain distinguishable.
Checklist: