Skip to content

Commit 400d769

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix/AssetsAccountActivity
2 parents 2dc3d26 + 27b0bbb commit 400d769

139 files changed

Lines changed: 6832 additions & 1233 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Close Stale Release PRs
2+
3+
# Release PRs on `release/*` branches are expected to merge quickly. Abandoned
4+
# ones block other engineers from starting a new release. This workflow closes
5+
# inactive release PRs, leaves a comment, and deletes the branch.
6+
on:
7+
schedule:
8+
# Check twice an hour so the 3h window is reasonably precise.
9+
- cron: '*/30 * * * *'
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
15+
concurrency:
16+
group: close-stale-release-prs
17+
18+
jobs:
19+
close-stale-release-prs:
20+
name: Close stale release PRs
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: write
24+
pull-requests: write
25+
steps:
26+
- name: Checkout and setup environment
27+
uses: MetaMask/action-checkout-and-setup@v3
28+
with:
29+
is-high-risk-environment: false
30+
- name: Close inactive release PRs
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
run: yarn tsx scripts/close-stale-release-prs.mts

.github/workflows/lint-build-test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,11 @@ jobs:
382382
node-version: ${{ matrix.node-version }}
383383
- name: Build wallet-cli and its dependencies
384384
run: yarn workspaces foreach --topological-dev --recursive --from '@metamask/wallet-cli' run build
385+
- name: Install anvil for the real-chain e2e
386+
run: yarn workspace @metamask/wallet-cli run test:e2e:install-anvil
385387
- run: yarn workspace @metamask/wallet-cli run test:e2e
388+
env:
389+
MM_E2E_REQUIRE_ANVIL: 'true'
386390
- name: Require clean working directory
387391
shell: bash
388392
run: |

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,7 @@ packages/*/*.tsbuildinfo
5858
# Docusaurus
5959
**/.docusaurus
6060
packages/wallet-framework-docs/site/build
61+
62+
# Foundry (anvil) binaries cached by @metamask/foundryup for the wallet-cli
63+
# real-chain e2e (enableGlobalCache is off, so the cache lands in-repo).
64+
.metamask/

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,7 @@ linkStyle default opacity:0.5
478478
network_connection_banner_controller --> messenger;
479479
network_connection_banner_controller --> network_controller;
480480
network_connection_banner_controller --> network_enablement_controller;
481+
network_controller --> analytics_controller;
481482
network_controller --> base_controller;
482483
network_controller --> connectivity_controller;
483484
network_controller --> controller_utils;
@@ -660,10 +661,13 @@ linkStyle default opacity:0.5
660661
wallet --> seedless_onboarding_controller;
661662
wallet --> storage_service;
662663
wallet --> transaction_controller;
664+
wallet_cli --> analytics_controller;
663665
wallet_cli --> base_controller;
666+
wallet_cli --> messenger;
664667
wallet_cli --> remote_feature_flag_controller;
665668
wallet_cli --> storage_service;
666669
wallet_cli --> wallet;
670+
wallet_cli --> foundryup;
667671
```
668672

669673
<!-- end dependency graph -->

docs/processes/releasing.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Have changes that you need to release? There are a few things to understand:
44

55
- The responsibility of maintenance is not the only thing shared among multiple teams at MetaMask; releases are as well. That means **if you work on a team that has codeownership over a package, you are free to create a new release without needing the Wallet Framework team to do so.**
66
- Unlike clients, releases are not issued on a schedule; **anyone may create a release at any time**. Because of this, you may wish to review the Pull Requests tab on GitHub and ensure that no one else has a release candidate already in progress. If not, then you are free to start the process.
7+
- Release PRs on `release/*` branches that sit inactive for **3 hours** are automatically closed, with the branch deleted, so abandoned releases do not block others. Add the `release:keep-open` label if you need a longer-lived release PR in exceptional cases.
78
- The release process is a work in progress. Further improvements to simplify the process are planned, but in the meantime, if you encounter any issues, please reach out to the Wallet Framework team.
89
- Breaking changes take special consideration. [Read the guide](./breaking-changes.md) on how to prepare and handle them effectively.
910

knip.config.mts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@ const config: KnipConfig = {
217217
ignoreDependencies: ['immer'],
218218
},
219219
'packages/wallet-cli': {
220+
// `anvil` (from Foundry) is an external system binary the real-chain send
221+
// e2e probes and spawns; it's installed via `foundryup`, not an npm
222+
// package, so knip can't tie the invocation to a dependency.
223+
ignoreBinaries: ['anvil'],
220224
// `tsx` is the dev-mode loader: it's referenced only as a `node --import`
221225
// argument string (in `daemon-spawn`'s source-entry path and `bin/dev`),
222226
// never as a traceable import, so knip can't see it.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metamask/core-monorepo",
3-
"version": "1152.0.0",
3+
"version": "1156.0.0",
44
"private": true,
55
"description": "Monorepo for packages shared between MetaMask clients",
66
"repository": {
@@ -59,6 +59,8 @@
5959
"workspaces:list-versions": "./scripts/list-workspace-versions.sh"
6060
},
6161
"devDependencies": {
62+
"@actions/core": "^3.0.1",
63+
"@actions/github": "^9.1.1",
6264
"@lavamoat/allow-scripts": "^3.0.4",
6365
"@lavamoat/preinstall-always-fail": "^2.1.0",
6466
"@metamask/create-release-branch": "^4.2.1",
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"extends": ["./tsconfig.json", "../../tsconfig.packages.lint.json"],
3+
"compilerOptions": {
4+
"outDir": "./.tsc-lint-cache",
5+
"tsBuildInfoFile": "./.tsc-lint-cache/tsconfig.tsbuildinfo"
6+
},
7+
"references": [
8+
{
9+
"path": "../base-controller/tsconfig.lint.json"
10+
},
11+
{
12+
"path": "../messenger/tsconfig.lint.json"
13+
}
14+
]
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"extends": ["./tsconfig.json", "../../tsconfig.packages.lint.json"],
3+
"compilerOptions": {
4+
"outDir": "./.tsc-lint-cache",
5+
"tsBuildInfoFile": "./.tsc-lint-cache/tsconfig.tsbuildinfo"
6+
},
7+
"references": [
8+
{
9+
"path": "../base-controller/tsconfig.lint.json"
10+
},
11+
{
12+
"path": "../messenger/tsconfig.lint.json"
13+
}
14+
]
15+
}

packages/assets-controller/CHANGELOG.md

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,39 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Changed
11+
12+
- **BREAKING:** `AccountActivityDataSource` is now the highest-priority balance data source and participates in chain-claiming: chains it reports as "up" from `AccountActivityService:statusChanged`. The `AssetsController` messenger must now allow the `AccountActivityService:statusChanged` event ([#9517](https://github.com/MetaMask/core/pull/9517))
13+
14+
### Removed
15+
16+
- **BREAKING:** Remove `BackendWebsocketDataSource` and its factory/types (`BackendWebsocketDataSource`, `createBackendWebsocketDataSource`, `BackendWebsocketDataSourceOptions`, `BackendWebsocketDataSourceState`). Real-time balance updates and per-chain status are now consumed from `AccountActivityService` via `AccountActivityDataSource`, which manages the WebSocket connection and subscriptions. Consumers no longer need to delegate `BackendWebSocketService` actions/events to the `AssetsController` messenger ([#9517](https://github.com/MetaMask/core/pull/9517))
17+
18+
## [11.3.0]
19+
1020
### Added
1121

1222
- `SnapDataSource` now preserves optional balance `metadata` from snap keyrings into `assetsBalance` when handling `AccountsController:accountBalancesUpdated` and `getAccountBalances` results ([#9564](https://github.com/MetaMask/core/pull/9564))
1323

1424
### Changed
1525

26+
- Bump `@metamask/assets-controllers` from `^110.0.0` to `^110.0.1` ([#9693](https://github.com/MetaMask/core/pull/9693))
27+
- Bump `@metamask/core-backend` from `^7.0.0` to `^8.0.0` ([#9693](https://github.com/MetaMask/core/pull/9693))
28+
- Bump `@metamask/transaction-controller` from `^69.2.1` to `^69.3.0` ([#9693](https://github.com/MetaMask/core/pull/9693))
29+
- Nest AssetsController Sentry spans (`AssetsDataSourceTiming`, `AssetsDataSourceError`, `AssetsControllerFirstInitFetch`, pipeline summaries) as subspans under parent `AssetsFullFetch` / `AssetsUpdatePipeline` / `AssetsBackgroundFetch` traces, and emit a single `AggregatedBalanceSelector` span for `calculateBalanceForAllWallets` instead of one root span per account group, to avoid Sentry rate limits ([#9672](https://github.com/MetaMask/core/pull/9672))
30+
- Pipeline / data-source / update enrichment spans emit only on the unlock (first-init) fetch per session; later polls, force updates, and subscription enrichment skip tracing.
31+
- Tracing helpers live in `utils/trace.ts` (`emitTrace` / `withTrace`); omit `trace` to no-op so call sites stay free of gating `if`s. Fast and background fetch lanes are sibling `withTrace` calls (not nested).
32+
- Dashboard-facing spans (`AssetsFullFetch`, `AssetsUpdatePipeline`, `AggregatedBalanceSelector`, etc.) record `duration_ms` as a Sentry measurement (and backdate `startTime`) so Spans widgets charting `p95(duration_ms)` receive data. Nesting parents use `AssetsFetchPipeline` / `AssetsUpdateEnrichment` / `AssetsBackgroundFetch` / `AggregatedBalance`.
33+
- `AggregatedBalanceSelector` is nested under an `AggregatedBalance` parent span via `parentContext`.
1634
- Bump `@metamask/keyring-api` from `^23.5.0` to `^23.7.0` ([#9676](https://github.com/MetaMask/core/pull/9676))
1735
- Bump `@metamask/keyring-internal-api` from `^11.0.1` to `^11.0.2` ([#9676](https://github.com/MetaMask/core/pull/9676))
1836
- Bump `@metamask/keyring-snap-client` from `^9.2.0` to `^9.2.1` ([#9676](https://github.com/MetaMask/core/pull/9676))
19-
- `AccountActivityDataSource` is now the highest-priority balance data source and participates in chain-claiming: chains it reports as "up" (from `AccountActivityService:statusChanged`) are claimed first so the polling data sources (`AccountsApiDataSource`/`RpcDataSource`) do not also poll them ([#9517](https://github.com/MetaMask/core/pull/9517))
20-
- `AssetsController` no longer references `BackendWebSocketService` actions/events; real-time balances and chain status are consumed exclusively from `AccountActivityService`
21-
22-
### Removed
23-
24-
- **BREAKING:** Remove `BackendWebsocketDataSource` and its factory/types (`BackendWebsocketDataSource`, `createBackendWebsocketDataSource`, `BackendWebsocketDataSourceOptions`, `BackendWebsocketDataSourceState`). Real-time balance updates and per-chain status are now consumed from `AccountActivityService` via `AccountActivityDataSource`, which manages the WebSocket connection and subscriptions. Consumers no longer need to delegate `BackendWebSocketService` actions/events to the `AssetsController` messenger ([#9517](https://github.com/MetaMask/core/pull/9517))
2537

2638
### Fixed
2739

40+
- `withTrace` treats a rejected parent `trace` promise as best-effort (like `emitTrace`), so Sentry/adapter failures cannot fail full fetches or `handleAssetsUpdate` enrichment ([#9672](https://github.com/MetaMask/core/pull/9672))
2841
- `SnapDataSource` now delivers snap-sourced balance updates directly to `AssetsController` via a constructor-supplied `onAssetsUpdate` callback instead of fanning out to `activeSubscriptions`, so updates (e.g. Tron energy/bandwidth) are no longer dropped when no active subscription is tracked for the chain in the SnapDataSource ([#9656](https://github.com/MetaMask/core/pull/9656))
42+
- Balance aggregation selectors (`getAggregatedBalanceForAccount`, `getAggregatedBalanceForAccountIds`, `calculateBalanceForAllWallets`, `calculateBalanceChangeForAccountGroup`) no longer rescale balances whose amount is greater than or equal to `10^decimals`. Amounts in `assetsBalance` state are always human-readable, so the removed raw-vs-human magnitude heuristic corrupted legitimately large balances (e.g. 54.06B tokens with 9 decimals were divided by `10^9`), excluding them from aggregated fiat totals ([#9653](https://github.com/MetaMask/core/pull/9653))
2943

3044
## [11.2.1]
3145

@@ -75,6 +89,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7589
- `TokensApiClient` (used by `RpcDataSource` / `TokenDetector`) now sets the token-list `occurrenceFloor` query param from the same Token API `GET /v1/suggestedOccurrenceFloors` endpoint (cached 1h), replacing the hardcoded Linea/MegaETH/Tempo special cases. Missing chains or failed fetches fall back to 3 ([#9537](https://github.com/MetaMask/core/pull/9537))
7690
- Bump `@metamask/network-enablement-controller` from `^5.5.0` to `^5.6.0` ([#9520](https://github.com/MetaMask/core/pull/9520))
7791
- Bump `@metamask/phishing-controller` from `^17.2.1` to `^17.3.0` ([#9532](https://github.com/MetaMask/core/pull/9532))
92+
- Bump `@metamask/transaction-controller` from `^69.0.0` to `^69.1.0` ([#9568](https://github.com/MetaMask/core/pull/9568))
93+
94+
### Fixed
95+
96+
- `TokenDataSource` now also fetches token metadata for assets present in `assetsBalance` that are missing `assetsInfo` (previously only detected assets without metadata were enriched) ([#9547](https://github.com/MetaMask/core/pull/9547))
7897

7998
## [11.0.0]
8099

@@ -798,7 +817,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
798817
- Refactor `RpcDataSource` to delegate polling to `BalanceFetcher` and `TokenDetector` services ([#7709](https://github.com/MetaMask/core/pull/7709))
799818
- Refactor `BalanceFetcher` and `TokenDetector` to extend `StaticIntervalPollingControllerOnly` for independent polling management ([#7709](https://github.com/MetaMask/core/pull/7709))
800819

801-
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/assets-controller@11.2.1...HEAD
820+
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/assets-controller@11.3.0...HEAD
821+
[11.3.0]: https://github.com/MetaMask/core/compare/@metamask/assets-controller@11.2.1...@metamask/assets-controller@11.3.0
802822
[11.2.1]: https://github.com/MetaMask/core/compare/@metamask/assets-controller@11.2.0...@metamask/assets-controller@11.2.1
803823
[11.2.0]: https://github.com/MetaMask/core/compare/@metamask/assets-controller@11.1.1...@metamask/assets-controller@11.2.0
804824
[11.1.1]: https://github.com/MetaMask/core/compare/@metamask/assets-controller@11.1.0...@metamask/assets-controller@11.1.1

0 commit comments

Comments
 (0)