feat(transaction-controller): add approval-time sponsorship/signing hooks - #10109
Open
pedronfigueiredo wants to merge 7 commits into
Open
feat(transaction-controller): add approval-time sponsorship/signing hooks#10109pedronfigueiredo wants to merge 7 commits into
pedronfigueiredo wants to merge 7 commits into
Conversation
pedronfigueiredo
temporarily deployed
to
default-branch
September 4, 2026 10:26 — with
GitHub Actions
Inactive
jpuri
previously approved these changes
Sep 4, 2026
matthewwalsh0
requested changes
Sep 7, 2026
pedronfigueiredo
force-pushed
the
pnf/canonical-transaction-approval-preparation-handoff-implementation
branch
2 times, most recently
from
September 10, 2026 09:58
c78867c to
bd526cb
Compare
pedronfigueiredo
force-pushed
the
pnf/canonical-transaction-approval-preparation-handoff-implementation
branch
from
September 10, 2026 10:53
57e5828 to
83c15c8
Compare
pedronfigueiredo
force-pushed
the
pnf/canonical-transaction-approval-preparation-handoff-implementation
branch
from
September 10, 2026 11:17
83c15c8 to
ec803b7
Compare
pedronfigueiredo
force-pushed
the
pnf/canonical-transaction-approval-preparation-handoff-implementation
branch
from
September 10, 2026 17:18
ec803b7 to
01d269f
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 53cdb36. Configure here.
pedronfigueiredo
force-pushed
the
pnf/canonical-transaction-approval-preparation-handoff-implementation
branch
3 times, most recently
from
September 11, 2026 09:16
347f207 to
46fe285
Compare
pedronfigueiredo
force-pushed
the
pnf/canonical-transaction-approval-preparation-handoff-implementation
branch
from
September 11, 2026 09:54
46fe285 to
e9262f4
Compare
Contributor
Author
|
Fixed the lint:misc:check failure (Prettier formatting in TransactionController.test.ts) and pushed 58ac505. GitHub checks are green again; @matthewwalsh0, could you re-review when you have a moment? |
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.

Related pull requests
Summary
isSponsoredandshouldSignhooks toTransactionControllerOptions['hooks']so clients supply approval-time sponsorship and local-vs-external signing policy at the approval boundarybeforeSignexecution even when the approved transaction ends up on the external-sign pathPublic API
Behavior decisions
isSponsoredanswers whether the transaction should be treated as sponsored at approval time.shouldSignanswers whether the controller should reserve a nonce and sign locally.beforeSignstill runs before gas-fee-token publication checks, even when the final path does not locally sign.Validation
corepack yarn workspace @metamask/transaction-controller run jest --no-watchman --no-coverage packages/transaction-controller/src/TransactionController.test.tscorepack yarn buildNote
Medium Risk
Changes the core post-approval pipeline (nonce, signing, events) for every transaction, though default hooks mirror prior
isGasFeeSponsored/isExternalSignbehavior.Overview
Adds optional
isSponsoredandshouldSignhooks so clients can decide sponsorship and local vs external signing at approval time, without treating sponsorship as “must sign locally.”Approval flow is reordered: mark approved →
beforeSign→ gas-fee-token preflight → run hooks and setisGasFeeSponsored/isExternalSign→ only ifshouldSignis true, reserve nonce and sign (signing skips duplicatebeforeSign/ token checks).transactionApprovedis emitted after this path so listeners can see a nonce when local signing ran.Smaller fixes: batch gas poller updates
transactionBatches, simulation API creates delegation overrides when missing,getGasFeeTokensreturns empty tokens when EIP-7702 key/upgrade address is missing, andremoveLeadingZeroesis simplified.Reviewed by Cursor Bugbot for commit 58ac505. Bugbot is set up for automated code reviews on this repo. Configure here.