Skip to content

[pull] main from MetaMask:main#781

Merged
pull[bot] merged 9 commits into
dmrazzy:mainfrom
MetaMask:main
May 12, 2026
Merged

[pull] main from MetaMask:main#781
pull[bot] merged 9 commits into
dmrazzy:mainfrom
MetaMask:main

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented May 12, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

maxime-oe and others added 9 commits May 12, 2026 08:14
## Explanation

<!--
Thanks for your contribution! Take a moment to answer these questions so
that reviewers have the information they need to properly understand
your changes:

* What is the current state of things and why does it need to change?
* What is the solution your changes offer and how does it work?
* Are there any changes whose purpose might not obvious to those
unfamiliar with the domain?
* If your primary goal was to update one package but you found you had
to update another one along the way, why did you do so?
* If you had to upgrade a dependency, why did you do so?
-->

## References

<!--
Are there any issues that this pull request is tied to?
Are there other links that reviewers should consult to understand these
changes better?
Are there client or consumer pull requests to adopt any breaking
changes?

For example:

* Fixes #12345
* Related to #67890
-->

## Checklist

- [ ] I've updated the test suite for new or updated code as appropriate
- [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [ ] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md)
- [ ] I've introduced [breaking
changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md)
in this PR and have prepared draft pull requests for clients and
consumer packages to resolve them

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk release bookkeeping: only version bumps, dependency range
updates, changelog entries, and lockfile updates with no runtime code
changes in this PR.
> 
> **Overview**
> Bumps the monorepo version to `976.0.0` and releases new patch/minor
versions of `@metamask/assets-controller` (`7.1.0`),
`@metamask/assets-controllers` (`106.1.0`),
`@metamask/bridge-controller` (`72.1.0`),
`@metamask/bridge-status-controller` (`71.2.0`), and
`@metamask/transaction-pay-controller` (`22.3.0`).
> 
> Updates inter-package dependency ranges to reference the new workspace
versions, refreshes corresponding changelog sections/compare links, and
updates `yarn.lock` to reflect the new resolved workspace specs.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
e595f6e. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
## Explanation

Makes trending token query params extensible so new API parameters can
be added without requiring a core release.

### Changes:

Extract TrendingTokensQueryParams type with an index signature to allow
arbitrary params to pass through
**BREAKING**: Rename sortBy => sort parameter in getTrendingTokens to
match the actual API parameter name
Update getTrendingTokens and getTrendingTokensURL to use spread operator
instead of explicitly destructuring every param
Impact: Mobile can now add new params directly in the getTrendingTokens
call without waiting for a core update.

## References

* Fixes
[#12345](https://consensyssoftware.atlassian.net/browse/ASSETS-3146)

## Checklist

- [ ] I've updated the test suite for new or updated code as appropriate
- [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [ ] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md)
- [ ] I've introduced [breaking
changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md)
in this PR and have prepared draft pull requests for clients and
consumer packages to resolve them


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Medium risk because it introduces a **breaking** rename from `sortBy`
to `sort` in `getTrendingTokens`, which can silently affect downstream
callers at compile time/runtime if not updated. URL/query construction
logic is also generalized to pass through arbitrary params, which could
change request shapes if misused.
> 
> **Overview**
> Refactors the v3 trending tokens API surface to be *extensible*:
introduces and exports `TrendingTokensQueryParams` (with an index
signature) and updates `getTrendingTokens`/`getTrendingTokensURL` to
forward any additional query parameters to the endpoint.
> 
> Includes a **breaking** parameter rename from `sortBy` to `sort` to
match the backend API, updates default handling for
`includeRwaData`/`usePriceApiData`, and adjusts tests plus the package
changelog to reflect the new behavior (including a new pass-through
query param test).
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
b4e888b. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
…oved}` (#8766)

## Explanation

Adding similar events than `:multichainAccountGroup{Created,Updated}`.

Those events will be used by the `SnapAccountService`.

## References

N/A

## Checklist

- [ ] I've updated the test suite for new or updated code as appropriate
- [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [ ] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md)
- [ ] I've introduced [breaking
changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md)
in this PR and have prepared draft pull requests for clients and
consumer packages to resolve them


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Adds new post-`init` messenger events and tracking logic around
account add/remove and group metadata mutations; risk is mainly around
event ordering/duplication and downstream consumers relying on the new
signals.
> 
> **Overview**
> Adds **three new messenger
events**—`AccountTreeController:accountGroupCreated`,
`:accountGroupUpdated`, and `:accountGroupRemoved`—to let consumers
react to account-group lifecycle changes *after* `init`/`reinit` (no
events during initialization).
> 
> Updates `AccountTreeController` to track which groups were
created/updated/removed during `AccountsController:accountsAdded` and
`:accountsRemoved` batches (avoiding double `created`+`updated` in the
same batch), publishes the new events after the existing
`:accountTreeChange`, and emits `:accountGroupUpdated` on
`setAccountGroupName`/`setAccountGroupPinned`/`setAccountGroupHidden`.
> 
> Exports the new event types from `types.ts`/`index.ts`, adds a
comprehensive test suite for the new event semantics, and updates the
package changelog and eslint suppression counts accordingly.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
f2ce76b. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
…ict same-chain withdraw on swap-only Relay routes (#8735)

## Explanation

Since the Polymarket pUSD migration on April 28 2026, Predict same-chain
withdraws on Polygon (e.g. pUSD → USDC) sometimes fail with `transaction
gas limit too high (cap: 33554432, tx: 42121000)`.

Two interacting bugs:

1. **`transaction-pay-controller`** — `calculateSourceNetworkCost`
always uses `fromOverride = Safe proxy` for Predict withdraws. That
works for deposit-style Relay routes but breaks for the swap-aggregator
routes that same-chain destinations now use post-migration: DEX
aggregators reject contract callers (anti-MEV `msg.sender == tx.origin`
checks etc.), so the swap step reverts in simulation.
2. **`transaction-controller`** — `estimateGasBatch`'s 7702 path always
calls `estimateGas`, even when every batch entry already has a `gas`
value. The non-7702 path has had an `allTransactionsHaveGas`
short-circuit since [#7405](#7405);
the 7702 path was missed. When TPC tries the EOA `from`, the swap
sub-call reverts (EOA has no source token until the prepended
`Safe.execTransaction` sub-call runs mid-batch), the whole 7702 batch
falls back to ~block-gas-limit × buffer ≈ 42M, and Polygon's per-tx
`gascap` rejects it.

### Fix

- **TPC** `relay-quotes.ts`: gate `fromOverride = Safe proxy` on the
route having a `deposit` step. Same-chain swap routes use the relay
params' EOA `from` instead. Gas-fee-token lookup keeps using the Safe
proxy (gated on `isPredictWithdraw && refundTo`) so the gasless flow
still works for users with 0 POL.
- **TPC** `constants.ts`: add `POLYGON_PUSD_ADDRESS` and include it in
`STABLECOINS[Polygon]` for correct stablecoin display.
- **TC** `gas.ts`: mirror the existing non-7702 short-circuit in the
7702 branch — when every transaction has a provided `gas`, sum them and
skip simulation.

Verified end-to-end on mobile (yalc-linked): Polygon pUSD → USDC
withdraw produces a sane fee both with POL and gasless (paid in pUSD).
BNB cross-chain unchanged.

## References

N/A

## Checklist

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md)
- [ ] I've introduced [breaking
changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md)
in this PR and have prepared draft pull requests for clients and
consumer packages to resolve them

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes gas estimation behavior for EIP-7702 batches and alters Relay
quote simulation `from` selection for Predict withdraws; mistakes could
impact fee estimation and transaction success for these flows.
> 
> **Overview**
> Fixes Predict same-chain withdraws on swap-only Relay routes by
**gating the Safe-proxy `from` override** to only routes that include a
`deposit` step, while still using the Safe proxy for gas-fee-token
eligibility checks.
> 
> Updates `estimateGasBatch`’s EIP-7702 path to **fallback to summed
caller-provided per-tx `gas` limits when node simulation fails**
(instead of block-gas-limit fallback), via a new
`getProvidedBatchGasLimits` helper and added test coverage.
> 
> Adds `POLYGON_PUSD_ADDRESS` and includes it in Polygon `STABLECOINS`
for stablecoin display/fiat-rate handling, with new constants tests.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
8c1c30a. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
…ter (#8543)

## Explanation

Allow non-UUIDv4 analyticsId when adapter.skipUUIDv4Check is true, as
this is needed in Extension, where IDs are not UUIDv4.

## References

NA

## Checklist

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md)
- [] I've introduced [breaking
changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md)
in this PR and have prepared draft pull requests for clients and
consumer packages to resolve them

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Relaxes `analyticsId` validation when `skipUUIDv4Check` is enabled on
the platform adapter, which could allow inconsistent identifiers if
misused but remains opt-in and still rejects empty IDs.
> 
> **Overview**
> Adds an optional `skipUUIDv4Check` flag to `AnalyticsPlatformAdapter`
and threads it into `AnalyticsController` state validation so platforms
can use non-UUIDv4 `analyticsId` values while still requiring a
non-empty string.
> 
> Updates the state validator and expands unit tests (controller +
validator) to cover the new bypass behavior, and documents the change in
the package changelog.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
9f6e598. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
## Explanation
In this PR we
* Add the remaining steps required for the upgrade process
* Update the chomp service so it does not retry 409 errors - since those
indicate an error that isn't going to go away with a retry.

This has been tested in the mobile client - and it currently reaches the
final step of the upgrade process where we `POST
https://chomp.dev-api.cx.metamask.io/v1/intent` - this currently returns
a 500 error after a long delay. We're still investigating the cause of
this, as there may be changes required to chomp.


<!--
Thanks for your contribution! Take a moment to answer these questions so
that reviewers have the information they need to properly understand
your changes:

* What is the current state of things and why does it need to change?
* What is the solution your changes offer and how does it work?
* Are there any changes whose purpose might not obvious to those
unfamiliar with the domain?
* If your primary goal was to update one package but you found you had
to update another one along the way, why did you do so?
* If you had to upgrade a dependency, why did you do so?
-->

## References

<!--
Are there any issues that this pull request is tied to?
Are there other links that reviewers should consult to understand these
changes better?
Are there client or consumer pull requests to adopt any breaking
changes?

For example:

* Fixes #12345
* Related to #67890
-->

## Checklist

- [ ] I've updated the test suite for new or updated code as appropriate
- [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [ ] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md)
- [ ] I've introduced [breaking
changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md)
in this PR and have prepared draft pull requests for clients and
consumer packages to resolve them

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Introduces new delegation-signing/storage and intent-registration
steps plus breaking `init()` and messenger-action requirements in
`MoneyAccountUpgradeController`, which affects upgrade orchestration and
on-chain/CHOMP interactions. Also changes `ChompApiService` retry
behavior for 4xx responses, which could alter client error handling and
backoff characteristics.
> 
> **Overview**
> **Completes the money account upgrade sequence** by adding
`build-delegation` and `register-intents` steps after EIP-7702
authorization, including delegation creation/signing (via
`DelegationController`), CHOMP verification, persistence to
`AuthenticatedUserStorageService`, and CHOMP intent registration
(skipping existing active intents and re-registering revoked ones).
> 
> **Breaking API/config changes** in `MoneyAccountUpgradeController`:
`init()` now takes `{ chainId, boringVaultAddress }`, resolves
Delegation Framework contract/enforcer addresses from
`@metamask/delegation-deployments` (throws if unsupported), and expands
required messenger permissions to include storage, delegation signing,
and CHOMP intent/delegation APIs.
> 
> **Retry semantics change** in `@metamask/chomp-api-service`: default
retry policy now *does not retry* most 4xx responses (except `429`),
while continuing to retry `5xx` and non-HTTP errors; tests updated/added
to assert the new behavior and allow overriding via `policyOptions`.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
0cf880a. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
## Summary

This is PR 1 of 4 in the core stack for Predict withdraws over Across.

- Adds `TransactionType.predictAcrossWithdraw`.
- Treats `isPostQuote` requests as actionable for Across support checks.
- Allows source-chain authorization lists only for post-quote Predict
withdraw detection, where the original withdraw is not encoded as an
Across destination action.
- Generalizes transaction-pay refund documentation from Relay-only
language to quote-provider language.

## Stack

1. This PR: plumbing to identify Predict Across withdraws
2. #8760: quote support
3. #8761: submit support
4. #8762: gas payment edge cases

## Validation

- `yarn workspace @metamask/transaction-pay-controller run jest
--no-coverage src/strategy/across/AcrossStrategy.test.ts`
- Full stack validation was run on the final stacked branch:
  - `yarn changelog:validate`
  - `yarn workspace @metamask/transaction-pay-controller run test`
  - `yarn workspace @metamask/transaction-controller run test`

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes Across quote eligibility logic to treat `isPostQuote` requests
as actionable and to allow EIP-7702 `authorizationList` only for a
specific Predict-withdraw post-quote path; misclassification could
incorrectly enable/disable Across quoting for some transactions.
> 
> **Overview**
> Introduces a new `TransactionType.predictAcrossWithdraw` to tag
Predict withdraws that will use Across.
> 
> Updates `AcrossStrategy.supports` to treat `isPostQuote` quote
requests as actionable and only accept them when the original
transaction is a Predict withdraw, plus adds
`hasUnsupportedTransactionAuthorizationList` to block EIP-7702
`authorizationList` usage except for the Predict-withdraw post-quote
detection case. Tests were extended to cover post-quote Predict withdraw
handling.
> 
> Minor docs/logic tweaks: `isAcrossQuoteRequest` now includes
`isPostQuote`, and `refundTo` comments were generalized from
Relay-specific wording to quote-provider wording.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
fc6f92e. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
…ote transaction (#8615)

## Explanation

In case of postquote transaction with accountOverride add delegation to
execute quote on behalf of the override account.

## References

Related to https://consensyssoftware.atlassian.net/browse/CONF-1323

## Checklist

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md)
- [x] I've introduced [breaking
changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md)
in this PR and have prepared draft pull requests for clients and
consumer packages to resolve them

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes the Relay post-quote submission path to swap a prepended
original tx for a delegation tx when `accountOverride` is used,
affecting how batched transactions are constructed and submitted.
Incorrect delegation construction or account-detection could break
post-quote execution for overridden accounts.
> 
> **Overview**
> Fixes Relay *post-quote* submission when `accountOverride` is present
by detecting `from` divergence and **replacing the prepended original
transaction** with a delegation transaction built via
`TransactionPayController:getDelegationTransaction`.
> 
> Adds `buildDelegatedOriginalParams` to fetch and inject the delegation
tx params, updates batching logic accordingly, and extends
`relay-submit.test.ts` with coverage ensuring the delegation is
requested/used only when an override is set. Updates the package
changelog to document the fix.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
f93b79e. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Ömer Göktuğ Poyraz <omergoktugpoyraz@gmail.com>
…8542)

## Explanation

Set analyticsId metadata persist flag to true so persisted stores
include the identifier alongside optedIn.
This is needed by Extension, where we want to move the ID from
MetaMetricsController to AnalyticsController.

## References

None

## Checklist

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md)
- [ ] I've introduced [breaking
changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md)
in this PR and have prepared draft pull requests for clients and
consumer packages to resolve them

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes persistence behavior for `analyticsId`, which affects how a
user identifier is saved/restored across sessions and could impact
client migrations or state storage expectations.
> 
> **Overview**
> **`analyticsId` is now persisted by `AnalyticsController`** by marking
it `persist: true` in state metadata, so persisted controller
compositions save/restore it alongside `optedIn`.
> 
> Docs and JSDoc are updated to reflect the new persistence contract
(platform supplies the initial UUIDv4, then the persisted store retains
it), and tests add explicit coverage for metadata-derived outputs (debug
snapshots, state logs, persisted state, and UI-exposed state).
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
12136bf. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
@pull pull Bot locked and limited conversation to collaborators May 12, 2026
@pull pull Bot added the ⤵️ pull label May 12, 2026
@pull pull Bot merged commit 7302bf7 into dmrazzy:main May 12, 2026
0 of 4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants