Skip to content

Bump @metamask/transaction-controller to ^23.0.0#22979

Merged
adonesky1 merged 159 commits intodevelopfrom
jl/transaction-multichain-preview-test-feature-flag-in-env
Feb 22, 2024
Merged

Bump @metamask/transaction-controller to ^23.0.0#22979
adonesky1 merged 159 commits intodevelopfrom
jl/transaction-multichain-preview-test-feature-flag-in-env

Conversation

@jiexi
Copy link
Copy Markdown
Member

@jiexi jiexi commented Feb 15, 2024

Description

Currently, Extension can only process transactions for the active / globally selected network. This makes it not possible to facilitate multichain interactions without constantly rotating the active network or some other workaround that would hurt user experience. We want to keep Metamask competitive by making our multichain experience as seamless and frictionless as possible. This PR introduces an updated version of the TransactionController that is capable of handling transactions across multiple network clients concurrently which lays the groundwork for future multichain changes.

  • Bumps @metamask/transaction-controller to ^23.0.0
  • Adds TRANSACTION_MULTICHAIN environment variable
    • when set, enables the TransactionController to submit, process, and track transactions concurrently on mutiple networks
    • defaults off

NOTE: This PR does not introduce a CI pipeline for building and testing with TRANSACTION_MULTICHAIN enabled because the SwapController still needs to be updated to be compatible. This feature flag defaults off and does not change the current user facing TransactionController behavior, so current testing pipelines are sufficient.

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/1990

Manual testing steps

Testing the single globally selected transaction flow

There should be no user facing difference in behavior.

Testing the multichain transaction flow

  1. Make a build with TRANSACTION_MULTICHAIN set to 1
  2. Switch to local testnet network
  3. Send a transaction
  4. Quickly, before the transaction is marked confirmed, switch the globally selected network to a network on a different chain
  5. Wait a few moments
  6. Turn off the local testnet so that Metamask cannot connect to it anymore
  7. Switch back to the testnet network
  8. The transaction should be confirmed

This demonstrates that the TransactionController was polling the local testnet network for transaction updates while it was not the active / globally selected network and was able to confirm the transaction onchain (as opposed to it confirming the transaction right as it became the active / globally selected network again since Metamask wouldn't be able to reach the local testnet anymore)

Screenshots/Recordings

Before

multichain.off.mov

Notice that the transaction was not confirmed when we switched to mainnet and that when we switched back to localhost that it confirmed instantly when we turned ganache back on, implying that the TransactionController is only polling for the currently active network.

After (with TRANSACTION_MULTICHAIN flag enabled)

multichain.enabled.mov

Notice that the local testnet transaction was not confirmed before we switched to mainnet, but was confirmed by the time we switched back to it despite us being on mainnet and turning off ganache, implying that the TransactionController was polling for the local testnet transaction while mainnet was the globally selected network.

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

jiexi and others added 30 commits January 30, 2024 14:29
…tion-multichain-preview-test-feature-flag-on
…tion-multichain-preview-test-feature-flag-on
…tion-multichain-preview-test-feature-flag-on
…tion-multichain-preview-test-feature-flag-on
@metamaskbot
Copy link
Copy Markdown
Collaborator

Policies updated

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [788416c]
Page Load Metrics (2081 ± 145 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1122921724321
domContentLoaded107933178
load178827082081301145
domInteractive107933178
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: -127.07 KiB (-3.74%)
  • ui: 2.05 KiB (0.03%)
  • common: 166.69 KiB (3.31%)

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [97e797c]
Page Load Metrics (2109 ± 112 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1144332057536
domContentLoaded1091302210
load176928172109233112
domInteractive1091302210
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: -127.07 KiB (-3.74%)
  • ui: 2.05 KiB (0.03%)
  • common: 166.69 KiB (3.31%)

adonesky1
adonesky1 previously approved these changes Feb 21, 2024
Copy link
Copy Markdown
Contributor

@adonesky1 adonesky1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥳

@adonesky1
Copy link
Copy Markdown
Contributor

@metamaskbot update-policies

@jiexi
Copy link
Copy Markdown
Member Author

jiexi commented Feb 22, 2024

@metamaskbot update-policies

@jiexi
Copy link
Copy Markdown
Member Author

jiexi commented Feb 22, 2024

@metamaskbot update-policies

@metamaskbot
Copy link
Copy Markdown
Collaborator

Policies updated

@metamaskbot
Copy link
Copy Markdown
Collaborator

Policy update failed. You can review the logs or retry the policy update here

@metamaskbot
Copy link
Copy Markdown
Collaborator

No policy changes

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [322cc4a]
Page Load Metrics (1722 ± 59 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint943531956933
domContentLoaded146131147
load14681912172212359
domInteractive146131147
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: -129.28 KiB (-3.40%)
  • ui: 42 Bytes (0.00%)
  • common: 140.34 KiB (3.07%)

@adonesky1 adonesky1 merged commit 275523a into develop Feb 22, 2024
@adonesky1 adonesky1 deleted the jl/transaction-multichain-preview-test-feature-flag-in-env branch February 22, 2024 19:43
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 22, 2024
@metamaskbot metamaskbot added the release-11.12.0 Issue or pull request that will be included in release 11.12.0 label Feb 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-11.12.0 Issue or pull request that will be included in release 11.12.0 team-confirmations-system-deprecated DEPRECATED: please use "team-confirmations" instead team-wallet-api-platform-deprecated DEPRECATED: please use "team-wallet-integrations" instead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants