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

chore: emit cross-chain swaps metrics + validation error logic #28713

Merged
merged 35 commits into from
Dec 10, 2024

Conversation

micaelae
Copy link
Member

@micaelae micaelae commented Nov 26, 2024

Description

Changes include

  • Input/quote validation logic for isInsufficientBalance, isInsufficientGasBalance and isEstimatedReturnLow(no ui yet but these get included in metrics)
  • Type-safe event emitter for cross-chain swaps
  • Refactored token exchange rate fetching process so that values can be reused for metrics without additional network calls
  • Adding new events described in https://docs.google.com/document/d/1hAoqEzlSnPDMfmiYBf8FNykYZ_LLbmZjKyTtjPmeEbs/edit?tab=t.0
  • Note that these events that haven't been added bc they depend on tx status changes
    • ActionFailed
    • ActionCompleted

Open in GitHub Codespaces

Related issues

Depends on this segment-schema PR

Fixes: https://consensyssoftware.atlassian.net/browse/MMS-1453

Manual testing steps

  1. Open background inspector and filter requests including "batch"
  2. Perform an e2e transaction
  3. Verify that expected events are published

Screenshots/Recordings

Before

After

N/A

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.

@micaelae micaelae force-pushed the mms1453-bridge-metrics branch from a83e4d8 to 857539e Compare November 26, 2024 18:47
@micaelae micaelae changed the title chore: emit cross-chain swaps metrics for pre-confirmation events chore: emit cross-chain swaps metrics + validation error logic Nov 26, 2024
@micaelae micaelae force-pushed the mms1453-bridge-metrics branch 7 times, most recently from 064e1ab to 064329a Compare November 30, 2024 00:30
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.

@micaelae micaelae force-pushed the mms1453-bridge-metrics branch from 064329a to 36f6789 Compare November 30, 2024 00:33
@micaelae micaelae changed the base branch from develop to mb1571-cross-chain-swap-stx November 30, 2024 00:33
@micaelae micaelae force-pushed the mms1453-bridge-metrics branch from 36f6789 to a9085b0 Compare December 2, 2024 18:29
@metamaskbot
Copy link
Collaborator

Builds ready [fc76208]
Page Load Metrics (1872 ± 78 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint16882241189015675
domContentLoaded16212208185415876
load16322242187216278
domInteractive258540168
backgroundConnect8441794
firstReactRender156222126
getState2690662010
initialActions01000
loadScripts12131698141012761
setupStore65612147
uiStartup18392523214318488
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: -110 Bytes (-0.00%)
  • ui: 62.12 KiB (0.80%)
  • common: 3.95 KiB (0.05%)

@micaelae micaelae marked this pull request as ready for review December 2, 2024 19:22
@micaelae micaelae requested a review from a team as a code owner December 2, 2024 19:22
@micaelae micaelae requested a review from a team December 2, 2024 19:23
ui/ducks/bridge/selectors.ts Outdated Show resolved Hide resolved
ui/ducks/bridge/selectors.ts Outdated Show resolved Hide resolved
ui/ducks/bridge/selectors.ts Outdated Show resolved Hide resolved
ui/ducks/bridge/selectors.ts Outdated Show resolved Hide resolved
ui/ducks/bridge/selectors.ts Outdated Show resolved Hide resolved
ui/ducks/bridge/selectors.ts Outdated Show resolved Hide resolved
ui/ducks/bridge/utils.ts Show resolved Hide resolved
ui/ducks/bridge/utils.ts Outdated Show resolved Hide resolved
@infiniteflower
Copy link
Contributor

Loving the many small hooks!

@infiniteflower infiniteflower force-pushed the mb1571-cross-chain-swap-stx branch from f33d3f0 to 86e1202 Compare December 2, 2024 23:14
@infiniteflower infiniteflower requested a review from a team as a code owner December 2, 2024 23:14
@metamaskbot
Copy link
Collaborator

Builds ready [8efc675]
Page Load Metrics (1957 ± 62 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint18102278195412862
domContentLoaded17892212192110952
load18102283195713062
domInteractive257538136
backgroundConnect8204364421
firstReactRender1596282311
getState793131565727
initialActions01000
loadScripts1373180014829646
setupStore783202512
uiStartup205131012357260125
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: -110 Bytes (-0.00%)
  • ui: 62.52 KiB (0.80%)
  • common: 4.02 KiB (0.05%)

@micaelae micaelae force-pushed the mms1453-bridge-metrics branch from 8efc675 to 1af674b Compare December 3, 2024 16:44
infiniteflower
infiniteflower previously approved these changes Dec 3, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [1af674b]
Page Load Metrics (2108 ± 95 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint17632475211420398
domContentLoaded17532391207018287
load17652480210819795
domInteractive266740126
backgroundConnect1296422914
firstReactRender15422373
getState92155133178
initialActions01000
loadScripts12971894158916479
setupStore6221032
uiStartup203329152434243117
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 957 Bytes (0.02%)
  • ui: 26.34 KiB (0.34%)
  • common: 1.41 KiB (0.02%)

Base automatically changed from mb1571-cross-chain-swap-stx to main December 5, 2024 16:50
@infiniteflower infiniteflower dismissed their stale review December 5, 2024 16:50

The base branch was changed.

@micaelae micaelae force-pushed the mms1453-bridge-metrics branch from 1af674b to 562fcff Compare December 6, 2024 02:41
@metamaskbot
Copy link
Collaborator

Builds ready [562fcff]
Page Load Metrics (2086 ± 79 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint17892520208615775
domContentLoaded17262478205116479
load17382542208616579
domInteractive25513574
backgroundConnect883352512
firstReactRender16412053
getState841601262210
initialActions01000
loadScripts13241797157312158
setupStore723942
uiStartup20182772239517684
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 436 Bytes (0.01%)
  • ui: 25.17 KiB (0.32%)
  • common: 1.21 KiB (0.01%)

@micaelae micaelae force-pushed the mms1453-bridge-metrics branch from b717695 to b80879e Compare December 10, 2024 21:10
@micaelae micaelae added this pull request to the merge queue Dec 10, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [b80879e]
Page Load Metrics (1918 ± 85 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint16652368192618690
domContentLoaded16072226189517785
load16652238191817685
domInteractive248744199
backgroundConnect982262010
firstReactRender15110353015
getState723661598038
initialActions01000
loadScripts12501749147713967
setupStore66612136
uiStartup189431582319364175
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 436 Bytes (0.01%)
  • ui: 25.2 KiB (0.32%)
  • common: 1.24 KiB (0.02%)

Merged via the queue into main with commit 653177a Dec 10, 2024
75 checks passed
@micaelae micaelae deleted the mms1453-bridge-metrics branch December 10, 2024 22:08
@github-actions github-actions bot locked and limited conversation to collaborators Dec 10, 2024
@metamaskbot metamaskbot added the release-12.10.1 Issue or pull request that will be included in release 12.10.1 label Dec 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.10.1 Issue or pull request that will be included in release 12.10.1 team-bridge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants