Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(mmi): start implementing mmi ofa feature #24749

Merged
merged 17 commits into from
Jun 19, 2024
Merged

Conversation

albertolive
Copy link
Contributor

@albertolive albertolive commented May 23, 2024

Description

As Order Flow Auction (OFA) has launched on MetaMask retail side, MMI is exploring ways to add support of OFA on the MMI extension and for their user base. The architecture will be slightly different as MMI has the custodian in between the transaction flow where the signing is happening. In general custodians do the signing and broadcasting themselves but we have introduced an updated API on our side (namely ECA3) which allows custodians to send back signed raw transactions which then is broadcasted by MMI through a backend service (unlike how MetaMask works).

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/MMI-5059

Manual testing steps

  1. Toggle On Smart Transactions in the settings
  2. Perform a transaction and sign it on the custody website
  3. Check in Servo that it has been broadcasted successfully

Screenshots/Recordings

Before

After

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've completed the PR template to the best of my ability
  • 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.

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.

Copy link
Contributor

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.

Copy link

codecov bot commented May 30, 2024

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 65.73%. Comparing base (a85b6cf) to head (0dd3ba7).

Current head 0dd3ba7 differs from pull request most recent head c2fb078

Please upload reports for the commit c2fb078 to get more accurate results.

Files Patch % Lines
...saction-base/confirm-transaction-base.component.js 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           develop   #24749    +/-   ##
=========================================
  Coverage    65.73%   65.73%            
=========================================
  Files         1369     1363     -6     
  Lines        54417    54274   -143     
  Branches     14161    14111    -50     
=========================================
- Hits         35766    35674    -92     
+ Misses       18651    18600    -51     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@metamaskbot
Copy link
Collaborator

Builds ready [0dd3ba7]
Page Load Metrics (206 ± 275 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint6412889168
domContentLoaded8421473
load532700206572275
domInteractive8421473
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 109 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@albertolive albertolive changed the title Start implementing OFA feature feat(mmi): start implementing mmi ofa feature Jun 4, 2024
@albertolive albertolive added the team-mmi PRs from the MMI team label Jun 4, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [aeda3db]
Page Load Metrics (141 ± 159 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint7213299147
domContentLoaded10371363
load451580141331159
domInteractive10371363
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 109 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [f5faf08]
Page Load Metrics (51 ± 6 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint6213284157
domContentLoaded9311263
load399851136
domInteractive9311263
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 109 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@albertolive albertolive marked this pull request as ready for review June 13, 2024 13:02
@albertolive albertolive requested a review from a team as a code owner June 13, 2024 13:02
@metamaskbot
Copy link
Collaborator

Builds ready [84521d5]
Page Load Metrics (137 ± 182 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint6810582115
domContentLoaded9141111
load411792137380182
domInteractive9141111
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 109 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

DDDDDanica
DDDDDanica previously approved these changes Jun 18, 2024
zone-live
zone-live previously approved these changes Jun 18, 2024
@@ -836,6 +838,13 @@ export default class ConfirmTransactionBase extends Component {
txData.metadata.note = noteText;
}

if (
smartTransactionsOptInStatus &&
Copy link
Member

Choose a reason for hiding this comment

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

If we're trying to detect if this is a smart transaction, should we be using the getSmartTransactionsEnabled selector as it also checks the feature flag so if the service is live?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the quick response @matthewwalsh0 ! I appreciate it; I didn't know that it existed. I'll do the changes

smartTransactionsOptInStatus &&
currentChainSupportsSmartTransactions
) {
txData.origin += '#smartTransaction';
Copy link
Member

Choose a reason for hiding this comment

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

Why are we mutating an existing property in this instance as opposed to using a new property for example?

Is the origin not traditionally a host name so won't this break that assumption and potentially impact other UX?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@matthewwalsh0, we are using the origin because we don’t want to add any new properties for now, as it would impact our Ethereum custodian API.

Copy link
Member

Choose a reason for hiding this comment

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

As long as you're sure it won't break any of the UI, fair enough given this branch is specific to MMI.

@metamaskbot
Copy link
Collaborator

Builds ready [cf59707]
Page Load Metrics (49 ± 6 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint641017995
domContentLoaded9271142
load398749126
domInteractive9271142
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 106 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@albertolive albertolive merged commit 038f3d6 into develop Jun 19, 2024
72 of 73 checks passed
@albertolive albertolive deleted the MMI-5059-ofa-feature branch June 19, 2024 18:00
@github-actions github-actions bot locked and limited conversation to collaborators Jun 19, 2024
@metamaskbot metamaskbot added the release-12.1.0 Issue or pull request that will be included in release 12.1.0 label Jun 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.1.0 Issue or pull request that will be included in release 12.1.0 team-mmi PRs from the MMI team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants