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: multi chain polling for token prices #28158

Merged
merged 48 commits into from
Nov 4, 2024
Merged

Conversation

bergeron
Copy link
Contributor

@bergeron bergeron commented Oct 29, 2024

Description

Multi chain polling for the token rates controller. This will fetch erc20 token prices across all evm chains.

Open in GitHub Codespaces

Related issues

Manual testing steps

no visual changes, you should just see the network tab hitting price api across multiple chains, correct prices when switching chains, when adding new tokens, and marketData updated in state across chains

Screenshots/Recordings

Before

After

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.

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.

@bergeron bergeron changed the base branch from develop to brian/asset-controller-39 October 29, 2024 15:39
ui/pages/index.js Outdated Show resolved Hide resolved
Base automatically changed from brian/asset-controller-39 to develop October 29, 2024 16:11
@metamaskbot
Copy link
Collaborator

Builds ready [3bf7b78]
Page Load Metrics (2370 ± 114 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint33628762172653314
domContentLoaded201528642333240115
load207628772370237114
domInteractive29144763215
backgroundConnect786392613
firstReactRender823811528239
getState7100292411
initialActions01000
loadScripts15012181176219192
setupStore1589352612
uiStartup227432442703334161
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 82 Bytes (0.00%)
  • ui: 2.66 KiB (0.03%)
  • common: 556 Bytes (0.01%)

bergeron added a commit to MetaMask/core that referenced this pull request Nov 1, 2024
…ient id (#4887)

## Explanation

Updates the polling input for `TokenRatesController` to a chain id
instead of a network client id.


## References

* Related to MetaMask/metamask-extension#28158

## Changelog

<!--
If you're making any consumer-facing changes, list those changes here as
if you were updating a changelog, using the template below as a guide.

(CATEGORY is one of BREAKING, ADDED, CHANGED, DEPRECATED, REMOVED, or
FIXED. For security-related issues, follow the Security Advisory
process.)

Please take care to name the exact pieces of the API you've added or
changed (e.g. types, interfaces, functions, or methods).

If there are any breaking changes, make sure to offer a solution for
consumers to follow once they upgrade to the changes.

Finally, if you're only making changes to development scripts or tests,
you may replace the template below with "None".
-->

### `@metamask/assets-controllers`

- **BREAKING**: The `TokenRatesController` now accepts `{chainId: Hex}`
as its polling input to `startPolling()` instead of `{networkClientId:
NetworkClientId}`

## Checklist

- [ ] I've updated the test suite for new or updated code as appropriate
- [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [ ] I've highlighted breaking changes using the "BREAKING" category
above as appropriate
- [ ] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes
@bergeron bergeron marked this pull request as ready for review November 4, 2024 01:42
@metamaskbot
Copy link
Collaborator

Builds ready [316da04]
Page Load Metrics (1931 ± 101 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint159023741936210101
domContentLoaded158123591909208100
load159023781931211101
domInteractive17104612211
backgroundConnect88723199
firstReactRender49193973014
getState567252411
initialActions01000
loadScripts11381871142118087
setupStore1170332211
uiStartup178826382172222107
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 125 Bytes (0.00%)
  • ui: 1.98 KiB (0.03%)
  • common: 1.05 KiB (0.01%)

@metamaskbot
Copy link
Collaborator

Builds ready [9a777f6]
Page Load Metrics (1908 ± 211 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint31221371579517248
domContentLoaded163035551882437210
load163935781908439211
domInteractive168646199
backgroundConnect896312512
firstReactRender472611045225
getState45815178
initialActions00000
loadScripts117028921398390187
setupStore1091332612
uiStartup179640762155522251
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 125 Bytes (0.00%)
  • ui: 1.98 KiB (0.03%)
  • common: 1.05 KiB (0.01%)

@bergeron bergeron added this pull request to the merge queue Nov 4, 2024
Merged via the queue into develop with commit eab6233 Nov 4, 2024
76 checks passed
@bergeron bergeron deleted the brian/multiexchangerate branch November 4, 2024 16:18
@github-actions github-actions bot locked and limited conversation to collaborators Nov 4, 2024
@metamaskbot metamaskbot added the release-12.8.0 Issue or pull request that will be included in release 12.8.0 label Nov 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. release-12.8.0 Issue or pull request that will be included in release 12.8.0 team-assets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants