feat: adopt optimized Money Account deposit quote pipeline#33433
feat: adopt optimized Money Account deposit quote pipeline#33433pedronfigueiredo wants to merge 3 commits into
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Feature Flag Registry CheckThis PR introduces feature flag references that are not yet registered in the Unregistered flags
How to fixAdd an entry for each flag in myNewFlag: {
name: 'myNewFlag',
type: FeatureFlagType.Remote,
inProd: false,
productionDefault: false,
status: FeatureFlagStatus.Active,
},Set If you access the flag via a constant (e.g. |
🧪 Flaky unit test detectionRun history flaky detectionHistorical failure rate is a hint, not proof — review each suggestion in context. See the flaky-test-detection skill for the full pattern reference and manual audit workflow. Failures / runs sampled per window:
AI-detected flaky patterns
|
ae400c9 to
bd3f5ea
Compare
bd3f5ea to
d183541
Compare
|



Description
This builds on the Money Account loading-state work in MetaMask/metamask-mobile#33325 and is the first Mobile adoption of the generic amount-update-and-quote pipeline introduced by MetaMask/core#9543.
Money Account deposits are the initial scope because one amount change coherently updates required assets plus approval and deposit calldata, making the duplicated parent rebuild/quote-generation cost especially visible. The core APIs remain generic and can be adopted by other Transaction Pay flows after their correctness and strategy requirements are validated.
This PR:
previewDeposit, the existing 0.2% minimum-mint protection, amount precision, required assets, and approval/deposit calldata;TransactionPayController.updateAmountwhen the version-gatedmoneyAccountDepositQuotePipelineflag or local override is enabled;addMusdandcardintents on the existing pipeline until their max/gas-station and multi-stage fiat behavior is validated separately;Benchmark
Using the same anchors in two iOS simulator React Native DevTools traces:
The observed total was 8.503 s → 7.437 s, but Relay independently varied from 4.108 s to 5.119 s. Holding Relay constant at the baseline gives a normalized PoC total of 6.427 s, a 2.076 s / 24.4% end-to-end improvement. These are individual simulator traces, not production percentiles.
Dependency and rollout status
This draft depends on the controller APIs in MetaMask/core#9543. Package versions must be updated after those packages are released; the local validation below used local builds from that core branch.
The new remote flag is registered with a disabled production default.
Security/privacy approval is required before rollout to confirm Sentinel/vendor-disclosure ordering. A Sentinel-blocked revision must never become executable.
Future work
Changelog
CHANGELOG entry: Improved Money Account deposit quote loading performance
Related issues
Refs: MetaMask/core#9543
Refs: #33325
Manual testing steps
Automated validation:
yarn lint:tscScreenshots/Recordings
Before
N/A — no visual design change. Baseline trace measured 8.503 seconds from Update/Done to executable quote.
After
N/A — no visual design change. PoC trace measured 7.437 seconds observed / 6.427 seconds normalized to the baseline Relay duration.
Pre-merge author checklist
Performance checks (if applicable)
Pre-merge reviewer checklist