-
Notifications
You must be signed in to change notification settings - Fork 477
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
Refactor: Upgrade ethers to v6 and protocol-kit to v2 #3087
Conversation
Branch preview✅ Deploy successful! |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
📦 Next.js Bundle Analysis for safe-wallet-webThis analysis was generated by the Next.js Bundle Analysis action. 🤖
|
Page | Size (compressed) |
---|---|
global |
1.03 MB (🟡 +159.88 KB) |
Details
The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.
Any third party scripts you have added directly to your app using the <script>
tag are not accounted for in this analysis
If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!
Sixteen Pages Changed Size
The following pages changed size from the code in this PR compared to its base branch:
Page | Size (compressed) | First Load |
---|---|---|
/apps |
47.84 KB (🟢 -1.66 KB) |
1.08 MB |
/apps/custom |
39.25 KB (🟢 -1.66 KB) |
1.07 MB |
/apps/open |
64.03 KB (🟢 -1.78 KB) |
1.09 MB |
/balances/nfts |
20.43 KB (-2 B) |
1.05 MB |
/home |
40.74 KB (🟢 -1.68 KB) |
1.07 MB |
/licenses |
5.1 KB (🟢 -21 B) |
1.04 MB |
/new-safe/create |
29.66 KB (🟢 -15 B) |
1.06 MB |
/settings/modules |
9.46 KB (🟡 +1 B) |
1.04 MB |
/settings/safe-apps |
24 KB (🟢 -1.66 KB) |
1.05 MB |
/settings/security-login |
29.61 KB (🟢 -13 B) |
1.06 MB |
/share/safe-app |
10.91 KB (🟡 +4 B) |
1.04 MB |
/transactions |
92.54 KB (🟢 -140 B) |
1.12 MB |
/transactions/history |
92.51 KB (🟢 -140 B) |
1.12 MB |
/transactions/messages |
49.35 KB (🟢 -115 B) |
1.08 MB |
/transactions/queue |
44.44 KB (🟢 -139 B) |
1.07 MB |
/transactions/tx |
33.97 KB (🟢 -140 B) |
1.06 MB |
Details
Only the gzipped size is provided here based on an expert tip.
First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link
is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.
Any third party scripts you have added directly to your app using the <script>
tag are not accounted for in this analysis
Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.
Coverage report
Show new covered files 🐣
Show files with reduced coverage 🔻
Test suite run success1380 tests passing in 186 suites. Report generated by 🧪jest coverage report action from 5006a34 |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
b5b5a2e
to
7949282
Compare
ESLint Summary View Full Report
Report generated by eslint-plus-action |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Left some questions.
ESLint Summary View Full Report
Report generated by eslint-plus-action |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
fixes #2901 (#2901) fixes #1984 (#1984) This PR upgrades ethers to version 6 and protocol kit to v2. I’ve followed the migration guide from v5 to perform the update: https://docs.ethers.org/v6/migrating/ Co-authored-by: Usame Algan <usame@safe-global> Co-authored-by: Manuel Gellfart <manu@safe.global>
When creating a pending Safe the the tx’s value was a bigInt 0n, this was causing the json Serializer to crash. The JSON standard doesn’t know how to treat BigInts, but. thankfully the parse an serialize functions have a second argument that can be used for custom types. Whenever we stumble on a BigInt we store it in the storage as an object of {__type: ‘bigint’, __value: ‘0x…’} Later when we load the key, we transform it back to a BigInt(0x…)
* fix: spending limit gasLimit estimation
* fix: Show more accurate total fee during safe creation * fix: Write tests for totalFee calculation
* fix: show zero wallet balance * test: unittest for walletbalance component * fix: unused imports
* fix: UI not updating if signing from walletconnect If another safe is owner of a safe and we use walletconnect to sign transaction the UI was not updating. It turns out we need to port the UncheckedJsonRpcSigner from ethers v5. The UncheckedJsonRpcSigner fakes a transaction receipt without actually having one, and this is needed for transactions that don’t actually end on-chain. * fix: failing tests and linting * feat: use uncheckedSigner for getDelayModifier
* fix: do not pad the chainId to bytes * refactor: use utils function
ethers v6 converts the chainId to a hex value: https://github.com/ethers-io/ethers.js/blob/50b74b8806ef2064f2764b09f89c7ac75fda3a3c/src.ts/hash/typed-data.ts#L75 Our SDK expects a number, that's why we convert the hex value from ethers v6 to number. If this gets fixed here: safe-global/safe-eth-py#748 we can remove this workaround
Verified |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀 🚀 🌔
What it solves
fixes #2901 (#2901)
fixes #1984 (#1984)
This PR upgrades ethers to version 6 and protocol kit to v2.
I’ve followed the migration guide from v5 to perform the update:
https://docs.ethers.org/v6/migrating/
How this PR fixes it
How to test it
Screenshots
Checklist