feat(transaction-controller): pass isInternal: true at internal call sites#42275
Draft
matthewwalsh0 wants to merge 1 commit intomainfrom
Draft
feat(transaction-controller): pass isInternal: true at internal call sites#42275matthewwalsh0 wants to merge 1 commit intomainfrom
isInternal: true at internal call sites#42275matthewwalsh0 wants to merge 1 commit intomainfrom
Conversation
…sites Adopts the new `isInternal` flag introduced in `@metamask/transaction-controller@65.0.0`. Internal call sites (UI-facing `addTransaction` / `addTransactionAndWaitForPublish`, EIP-7702 `upgradeAccount`, BridgeStatusController batch callback) now pass `isInternal: true` so the controller's internal-only validation behaviour is preserved without relying on `origin === 'metamask'`. Dapp-driven paths (EIP-5792 `wallet_sendCalls`, `addDappTransaction`) keep the default `isInternal: false`. Also bumps `@metamask/messenger` to `^1.2.0` to match the version required by the new transaction-controller, and fixes a latent action list mismatch in `StaticAssetsController`'s messenger surfaced by the stricter type checking in messenger 1.2.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Contributor
✨ Files requiring CODEOWNER review ✨📜 @MetaMask/policy-reviewers (5 files, +1301 -37)
Tip Follow the policy review process outlined in the LavaMoat Policy Review Process doc before expecting an approval from Policy Reviewers. |
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
Adopts the new
isInternalflag introduced in@metamask/transaction-controller@65.0.0. The controller previously inferred internal vs external trust from the requestorigin(origin === ORIGIN_METAMASK⇒ internal). That coupling has been replaced with an explicit, optionalisInternal: booleanflag onaddTransaction/addTransactionBatch, defaulting tofalse. To keep current behaviour, every internal call site in extension must opt in.This PR adopts
isInternal: trueat the internal entry points and leaves dapp-driven paths defaulting tofalse:getApi().addTransaction/addTransactionAndWaitForPublish(UI-facing wrappers)isInternal: trueupgradeAccount(EIP-7702 internal upgrade)isInternal: trueBridgeStatusController.addTransactionBatchFncallbackisInternal: truewallet_sendCallsmiddleware (processSendCallscallbacks)false)addDappTransaction(eth_sendTransactionmiddleware)false)Internal feature hooks in the UI (
useMusdConversion,useSubscription,useRevokeGatorPermissions,useMerklClaimTransaction, mUSDtransaction-utils) all funnel through the UI ReduxaddTransactionaction which calls the background's UI-facing wrapper, so they are covered automatically.The Tempo helper functions (
getTempoEvmTransactionArgs,getTempoTransactionBatchArgs) spread the caller'stransactionOptions, soisInternalpropagates through the Tempo path with no further changes.Incidental changes
@metamask/messengerto^1.2.0to match the version required by transaction-controller65.0.0. After dedupe, all packages resolve to1.2.0.StaticAssetsController's messenger getter that was surfaced by the stricter type-checking in messenger1.2. The getter declaredAccountsController:getSelectedAccountinAllowedActionsbut the controller'sStaticAssetsControllerMessengertype expectedStaticAssetsController:getState(the controller's ownGetStateaction). The getter now importsStaticAssetsControllerActionsfrom the controller so the two stay in sync.Preview build
This PR depends on the unreleased core PR via
previewBuilds:These will be replaced with released versions before this PR merges.
Manual testing steps
submitted.eth_sendTransaction— confirmation flow should still display the dapp's origin and dapp-suggested gas fees.wallet_sendCalls— batch should still be accepted, and origin / size limits / EIP-7702 rejection rules still apply.requireApproval: trueand complete normally.isInternal: true.Pre-merge author checklist