-
Notifications
You must be signed in to change notification settings - Fork 428
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
[Multichain] Feat: disable adding new chains to safes created from old mastercopy versions [SW-167] #4161
[Multichain] Feat: disable adding new chains to safes created from old mastercopy versions [SW-167] #4161
Conversation
Branch preview✅ Deploy successful! Storybook: |
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 |
978.79 KB (🟡 +38.39 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!
Nineteen Pages Changed Size
The following pages changed size from the code in this PR compared to its base branch:
Page | Size (compressed) | First Load |
---|---|---|
/ |
507 B (🟢 -24.36 KB) |
979.29 KB |
/address-book |
26.11 KB (🟡 +3 B) |
1004.91 KB |
/apps/open |
54.74 KB (🟡 +1 B) |
1.01 MB |
/balances |
30.64 KB (-3 B) |
1009.43 KB |
/home |
60.28 KB (🟡 +31 B) |
1.01 MB |
/new-safe/advanced-create |
36.51 KB (🟡 +1.37 KB) |
1015.31 KB |
/new-safe/create |
35.76 KB (🟡 +1.36 KB) |
1014.56 KB |
/new-safe/load |
16.38 KB (🟢 -7 B) |
995.18 KB |
/settings/modules |
9.76 KB (🟢 -1 B) |
988.56 KB |
/settings/setup |
35.96 KB (🟡 +1 B) |
1014.75 KB |
/share/safe-app |
9.72 KB (🟢 -2 B) |
988.51 KB |
/terms |
11.24 KB (🟡 +60 B) |
990.04 KB |
/transactions |
73.47 KB (🟡 +1 B) |
1.03 MB |
/transactions/history |
73.44 KB (🟡 +1 B) |
1.03 MB |
/transactions/messages |
39.12 KB (-1 B) |
1017.91 KB |
/transactions/msg |
29.5 KB (-1 B) |
1008.29 KB |
/transactions/queue |
31.22 KB (🟡 +1 B) |
1010.02 KB |
/transactions/tx |
21.05 KB (🟡 +1 B) |
999.85 KB |
/welcome |
6.77 KB (🟢 -1 B) |
985.56 KB |
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 success1522 tests passing in 206 suites. Report generated by 🧪jest coverage report action from ef06e9a |
fc5b23f
to
d74bfb4
Compare
d74bfb4
to
4ca5876
Compare
} | ||
}) | ||
|
||
it('should remove already deployed chains from result', () => { |
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.
I moved this filtering to outside the hook because I needed to distinguish between
- there being no more chains left to deploy to (already deployed on all chains)
- there being no chains at all (unsupported safe creation version)
<Typography variant="body2">Loading Safe data</Typography> | ||
</Stack> | ||
) : isUnsupportedSafeCreationVersion ? ( | ||
<Typography> |
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.
Lets wrap this in an ErrorMessage
.
const replayableChains = useReplayableNetworks(safeCreationResult[0], deployedChainIds) | ||
const allCompatibleChains = useCompatibleNetworks(safeCreationResult[0]) | ||
const isUnsupportedSafeCreationVersion = Boolean(!allCompatibleChains?.length) | ||
const replayableChains = allCompatibleChains?.filter((config) => !deployedChainIds.includes(config.chainId)) || [] |
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.
I think we need to memoize this with useMemo
@@ -175,18 +198,21 @@ export const CreateSafeOnNewChain = ({ | |||
) | |||
|
|||
const safeCreationResult = useSafeCreationData(safeAddress, deployedChains) | |||
const replayableChains = useReplayableNetworks(safeCreationResult[0], deployedChainIds) | |||
const allCompatibleChains = useCompatibleNetworks(safeCreationResult[0]) | |||
const isUnsupportedSafeCreationVersion = Boolean(!allCompatibleChains?.length) |
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.
This will also be true for zkSync Safes as they have no compatible networks.
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.
For zkSync, allCompatibleChains will just contain zkSync (because it's before you filter out the chains it's already deployed on). I tested it out just now and it behaves the same as it does on the epic branch.
But I think this speaks to the fact that this block is not super readable, and it's unclear what allCompatibleChains
means. Any suggestions?
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.
Also, I created a ticket for when there are no available chains to deploy to (like with zkSync): https://www.notion.so/safe-global/76f265123c0a4ad680947ce489804342?v=f9f164524ec4464286fdc38f31589d0c&p=4ec720b334ea410bbe8abb083509bf7b&pm=s
Right now it just shows the network selector with no options
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.
Okay we can keep it as is then.
@jmealy , could you re-check "add network" in side menu
|
Screen.Recording.2024-09-13.at.13.17.45.mov |
@liliya-soroka All errors are expected.
|
ESLint Summary View Full Report
Report generated by eslint-plus-action |
What it solves
Resolves: https://www.notion.so/safe-global/Do-not-offer-adding-networks-for-1-1-1-created-Safes-9608b9ee16a549e891b795fe18b5e831?pvs=4
How this PR fixes it
How to test it
Screenshots
Checklist