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: Add new completion_time_onchain property to Transaction Finalized events #29474

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

pedronfigueiredo
Copy link
Contributor

@pedronfigueiredo pedronfigueiredo commented Jan 7, 2025

Description

The new property completion_time_onchain has the number of seconds (rounded to the hundredths) between submitted time and the block timestamp.

This number is necessarily lower than the previously existing completion_time property, which captures the time between block validation and UI finalization and depends on the polling interval.

Open in GitHub Codespaces

Related issues

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

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Screenshot 2025-01-07 at 13 39 29

Pre-merge author checklist

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.

@pedronfigueiredo pedronfigueiredo added the team-confirmations Push issues to confirmations team label Jan 7, 2025
@pedronfigueiredo pedronfigueiredo self-assigned this Jan 7, 2025
@pedronfigueiredo pedronfigueiredo requested a review from a team as a code owner January 7, 2025 13:40
Copy link
Contributor

github-actions bot commented Jan 7, 2025

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.

@pedronfigueiredo pedronfigueiredo changed the title Add new completion_time_onchain property to Transaction Finalized events feat: Add new completion_time_onchain property to Transaction Finalized events Jan 7, 2025
@pedronfigueiredo pedronfigueiredo changed the title feat: Add new completion_time_onchain property to Transaction Finalized events feat: Add new completion_time_onchain property to Transaction Finalized events Jan 7, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [af59f40]
Page Load Metrics (1837 ± 182 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint31726821613499240
domContentLoaded145527161814373179
load150127461837378182
domInteractive25223655727
backgroundConnect107028189
firstReactRender16100442813
getState577232311
initialActions00000
loadScripts108320521367292140
setupStore689172110
uiStartup169730982113425204

matthewwalsh0
matthewwalsh0 previously approved these changes Jan 7, 2025
app/scripts/lib/transaction/metrics.ts Outdated Show resolved Hide resolved
app/scripts/lib/transaction/metrics.ts Show resolved Hide resolved
app/scripts/lib/transaction/metrics.ts Show resolved Hide resolved
@metamaskbot
Copy link
Collaborator

Builds ready [be72aa4]
Page Load Metrics (1546 ± 42 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1378171215558943
domContentLoaded1370169815248541
load1379171115468842
domInteractive20138413416
backgroundConnect866282110
firstReactRender15107453417
getState45411136
initialActions01000
loadScripts972125110957134
setupStore680222512
uiStartup159423371900219105
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 164 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@@ -828,6 +829,67 @@ describe('Transaction metrics', () => {
mockTransactionMetricsRequest.finalizeEventFragment,
).toHaveBeenCalledWith(expectedUniqueId);
});

it.only('should create, update, finalize event fragment with completion_time_onchain', async () => {
Copy link
Member

Choose a reason for hiding this comment

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

only accidental?


const blockTimestampSeconds = Number(hexToDecimal(blockTimestampHex));
const completionTimeSeconds = blockTimestampSeconds - submittedTimeMs / 1000;
const completionTimeSecondsRoundedToThousands =
Copy link
Member

Choose a reason for hiding this comment

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

Should this be completionTimeSecondsRoundedToHundredths or even completionTimeSecondsRounded for simplicity?

@metamaskbot
Copy link
Collaborator

Builds ready [0b99632]
Page Load Metrics (1722 ± 73 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint26421781656354170
domContentLoaded15312163170015775
load15432179172215373
domInteractive26108452411
backgroundConnect116725178
firstReactRender1797532613
getState515821
initialActions01000
loadScripts10941690127314067
setupStore684202311
uiStartup17712458198517785
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 164 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-confirmations Push issues to confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants