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

Add verifiedOnBlockchain property to transaction meta #20890

Merged

Conversation

vinistevam
Copy link
Contributor

@vinistevam vinistevam commented Sep 14, 2023

Explanation

This PR aims to add verifiedOnBlockchain property to transaction metadata as part of the ongoing effort to align the extension transaction controller with the controller in the core repo.

For context, the core TransactionController uses a verifiedOnBlockchain property to indicate whether a transaction has completed the verification process and therefore the status is now fixed and no further checks will be performed.

If the transaction receipt indicates the transaction failed, the verifiedOnBlockchain is still set to true to prevent further processing.

Changes

  • added verifiedOnBlockchain to transaction metadata.
  • Created migration to set the value accordingly on existing transactions in the controller state.
  • added a check in PendingTransactionTracker.

Manual Testing Steps

Scenario 1

  • Go to the test-dapp
  • Create a token
  • Perform a transaction

Scenario 2

  • Switch to a test net
  • Send eth

Both scenarios should be successfully completed, as usual, with no functional changes.

Pre-merge author checklist

  • I've clearly explained:
    • What problem this PR is solving
    • How this problem was solved
    • How reviewers can test my changes
  • Sufficient automated test coverage has been added

Pre-merge reviewer checklist

  • Manual testing (e.g. pull and build branch, run in browser, test code being changed)
  • PR is linked to the appropriate GitHub issue
  • IF this PR fixes a bug in the release milestone, add this PR to the release milestone

If further QA is required (e.g. new feature, complex testing steps, large refactor), add the Extension QA Board label.

In this case, a QA Engineer approval will be be required.

@github-actions
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.

@vinistevam vinistevam force-pushed the 1100-add-verifiedOnBlockchain-property-transaction-meta branch from 765d855 to e1e9827 Compare September 14, 2023 15:26
@vinistevam vinistevam added the team-confirmations-system DEPRECATED: please use "team-confirmations" label instead label Sep 14, 2023
@vinistevam vinistevam marked this pull request as ready for review September 14, 2023 16:35
@vinistevam vinistevam requested a review from a team as a code owner September 14, 2023 16:35
@sleepytanya
Copy link
Contributor

sleepytanya commented Sep 14, 2023

Both scenarios work as expected.

  1. Sending Sepolia ETH:
s_eth.mov

Sending tokens:

tst_s.mov

@@ -963,6 +963,8 @@ export default class TransactionController extends EventEmitter {
if (blockTimestamp) {
txMeta.blockTimestamp = blockTimestamp;
}
// transaction verified on the blockchain
Copy link
Member

Choose a reason for hiding this comment

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

Minor, but is this comment adding much additional detail?

matthewwalsh0
matthewwalsh0 previously approved these changes Sep 16, 2023
@codecov
Copy link

codecov bot commented Sep 18, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.01% 🎉

Comparison is base (4ecc600) 68.26% compared to head (045aa32) 68.27%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #20890      +/-   ##
===========================================
+ Coverage    68.26%   68.27%   +0.01%     
===========================================
  Files         1002     1003       +1     
  Lines        40133    40150      +17     
  Branches     10742    10745       +3     
===========================================
+ Hits         27395    27411      +16     
- Misses       12738    12739       +1     
Files Changed Coverage Δ
...s/transactions/EtherscanRemoteTransactionSource.ts 89.74% <ø> (ø)
...ripts/controllers/transactions/tx-state-manager.js 92.31% <ø> (ø)
app/scripts/migrations/index.js 100.00% <ø> (ø)
shared/constants/transaction.ts 100.00% <ø> (ø)
app/scripts/controllers/transactions/index.js 72.64% <100.00%> (-0.08%) ⬇️
...pts/controllers/transactions/pending-tx-tracker.js 95.28% <100.00%> (ø)
app/scripts/migrations/098.ts 100.00% <100.00%> (ø)

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

@metamaskbot
Copy link
Collaborator

Builds ready [84ddc22]
Page Load Metrics (1651 ± 79 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint118192140178
domContentLoaded14682233165116579
load14692233165116579
domInteractive14682233165116579
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 970 Bytes (0.03%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [9a249b0]
Page Load Metrics (1568 ± 38 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint103168134189
domContentLoaded1435172315688038
load1435172315688038
domInteractive1435172315688038
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 970 Bytes (0.03%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [045aa32]
Page Load Metrics (1650 ± 41 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1192121512311
domContentLoaded1472184516508541
load1472184516508541
domInteractive1472184516508541
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 970 Bytes (0.03%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@vinistevam vinistevam merged commit 5a90125 into develop Sep 19, 2023
9 checks passed
@vinistevam vinistevam deleted the 1100-add-verifiedOnBlockchain-property-transaction-meta branch September 19, 2023 10:49
@github-actions github-actions bot locked and limited conversation to collaborators Sep 19, 2023
@metamaskbot metamaskbot added the release-11.3.0 Issue or pull request that will be included in release 11.3.0 label Sep 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-11.3.0 Issue or pull request that will be included in release 11.3.0 team-confirmations-system DEPRECATED: please use "team-confirmations" label instead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants