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: chain id to hexadecimal format #7999

Merged
merged 106 commits into from
Feb 14, 2024
Merged

Conversation

tommasini
Copy link
Contributor

@tommasini tommasini commented Dec 4, 2023

Description

On this PR we updated the missing dependencies to the metamask controllers v53

  • AddressBookController: ^3.0.0
  • AssetsController: ^8.0.0
  • ControllerUtils: ^4.0.0
  • GasFeeController: 6.0.0
  • NetworkController: ^9.0.0
  • TransactionController: ^6.1.0

(Small minor version of cockatiel update just because it was a missing dependency on solving some conflicts running yarn add cockatiel it added with a minor version update, the changelog seems pretty trivial but we can revert it, let me know your thoughts)

It was needed to change the chain id across the project to use hexadecimal format, and on Ramp files was needed to have attention and change the selector to change it back to decimal and see all of the interaction across.

Created a new patch for SwapsController to change the chainId to hexadecimal format. This PR addresses that change

Created a a core branch to easily reading the assets controller current patch - v53-mobile-assets-controllers-patch

Implemented migrations for all the state objects that had chain id values and for other breaking changes like networkDetails object and rpcUrl instead of rpcTarget

Related issues

Fixes: #

Manual testing steps

I will mention flows instead of enumerating single steps and upload their recordings, just because it's a wide change around the app

  1. Add Tokens with and without auto detection and via dapp
  1. Add NFts with and without auto detection (https://recordit.co/8f2LpXal7p) manually: https://recordit.co/qkrdSOWhJs
  2. Send transaction (https://recordit.co/JAunxorgFI)
  3. Send dapp transaction (https://recordit.co/do2baJ6C4Z)
  4. Go to uniswap start a swap flow (https://recordit.co/oZNY4gPivJ)
  5. Add and switch between networks (https://recordit.co/2XlUdSWAZB)
  6. Add contacts to address book (https://recordit.co/2QNOcKr2tj)
  7. Send a swap https://recordit.co/Yi7DpbRwRV
  8. Install the previous version, perform a transaction, and install new version the transaction history should be kept (https://recordit.co/zJ1pjUC9ao -> After installing 7.12.0 tag and upgrading to this branch after performing a sepolia transaction, we can see that it persisted on the history view)
  9. Show incoming transaction by network - https://recordit.co/MGCP3vugJy
  10. Add custom network manually with chain id hexadecimal and decimal format - https://recordit.co/sWAs9XwlxH | https://recordit.co/8ioDINw8vM
  11. deeplink to transaction - https://recordit.co/1RiklQ4C80
  12. Token detection for optimism and arbitrum and linea - https://recordit.co/AIn88afpSy

Screenshots/Recordings

Before

After

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • 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.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

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.

…r gas fee controller, replace breaking changes on network controller and a migration for it, NetworkChainId to chainId on controller-utils
Copy link
Contributor

github-actions bot commented Dec 4, 2023

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

socket-security bot commented Dec 5, 2023

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report↗︎

tommasini and others added 20 commits December 11, 2023 18:06
…tches for controller utils and assets-controllers, changed on new missing plances rpcTarget for rpcUrl, upgraded controller utils to v4
…onverting the chainId on that state for hexadecimal
Fix chain ID middleware.
…st on networks constants for hexadecimal format
@tommasini
Copy link
Contributor Author

NEW PR smoke E2E pipeline: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/f6fd0da9-20de-4fb0-9f89-de9d7717a9a4

@sleepytanya
Copy link
Contributor

Transaction status is not updated in mobile app while Etherscan shows transactions as confirmed (transactions are stuck for over 30 mins):

Screenshot_20240202_144714_MetaMask-QA

Screenshot_20240202_144747_MetaMask-QA
Screenshot 2024-02-02 at 2 58 10 PM
Steps to reproduce:

  1. Queue multiple transactions

I used QA build for current branch on Samsung Note20 5G (physical device).

@tommasini
Copy link
Contributor Author

@sleepytanya I can't reproduce this behaviour, could you share more details on how you reproduced this scenario?

@tommasini
Copy link
Contributor Author

Hey @sleepytanya I was able to reproduce this issue and I was able to reproduce it on main as well:
https://recordit.co/WEo7BbJFRZ

Cal-L
Cal-L previously approved these changes Feb 8, 2024
Copy link
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

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

LGTM, could you fix the lint issue?

@sleepytanya
Copy link
Contributor

sleepytanya commented Feb 8, 2024

QA build, Samsung s24 + (physical device) :

  • Transactions - send ETH origin MM
  • Transactions - send ETH origin DAPP
  • Transactions - send ERC20 token origin MM
  • Transactions - send ERC20 token origin DAPP
  • Transactions - send ERC721 token origin MM
  • Transactions - send ERC721 token origin DAPP
  • Transactions - speed up transaction
  • Transactions - cancel transaction
  • Transactions - speed up cancellation
  • Create multiple pending transactions / cancel one of the pending transactions
  • Tokens - import ERC20 token origin MM
  • Tokens - import ERC20 token origin DAPP
  • Tokens - import ERC721 token origin MM - test DAPP token is displayed as a black square, not related to this PR, also exists on 7.14.0 (1242)
  • Tokens - import ERC721 token - DAPP 'Watch NFT' and 'Watch all NFTs' don't work, not related to this PR, also exists on 7.14.0 (1242)
  • Tokens - import ERC1155 token origin MM
  • Tokens - import ERC1155 token origin DAPP
  • Tokens - approve ERC1155 token
  • Tokens - approve ERC20 token
  • Tokens - approve ERC721 token
  • Tokens - autodetect tokens
  • Tokens - autodetect NFTs
  • ENS - name resolution
  • Gas fee - EIP-1559 gas
  • Gas fee - legacy gas
  • Sign - ETH sign
  • Sign - personal sign
  • Sign - sign in with Ethereum
  • Sign - sign typed with data
  • Permissions - connecting and disconnecting from a DAPP
  • Swap - swap ETH
  • Incoming transactions - detected in the 'Activity' tab
  • Use custom nonce

@sleepytanya sleepytanya added the QA Passed A successful QA run through has been done label Feb 8, 2024
jpcloureiro
jpcloureiro previously approved these changes Feb 13, 2024
@tommasini tommasini dismissed stale reviews from Cal-L and jpcloureiro via 33928d9 February 13, 2024 20:56
Copy link

sonarcloud bot commented Feb 13, 2024

Copy link
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

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

LGTM

@tommasini tommasini added the Run Smoke E2E Triggers smoke e2e on Bitrise label Feb 14, 2024
Copy link
Contributor

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/8516b725-81b4-4ea9-b708-ee37000bed89
You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

Copy link
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

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

Excellent PR description and videos! LGTM 🚀

  • Checked local build and TabBar works as expected
  • Searched for removed locales key

As an aside the TabBar could probably be moved out of the component-library folder it's not really a reusable component cc @brianacnguyen

locales/languages/en.json Show resolved Hide resolved
@tommasini tommasini merged commit e571db7 into main Feb 14, 2024
28 checks passed
@tommasini tommasini deleted the feat/7490-chain-id-to-hex-format branch February 14, 2024 18:02
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Feb 14, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Feb 14, 2024
@metamaskbot metamaskbot added the release-7.17.0 Issue or pull request that will be included in release 7.17.0 label Feb 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
QA Passed A successful QA run through has been done ramp-qa-passed release-7.17.0 Issue or pull request that will be included in release 7.17.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-mobile-platform
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet