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

Migration to custom errors #948

Draft
wants to merge 13 commits into
base: oz-audit-sep-head
Choose a base branch
from

Conversation

StanislavBreadless
Copy link
Collaborator

What ❔

Why ❔

Checklist

  • PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.

Copy link

github-actions bot commented Oct 18, 2024

Changes to gas cost

Generated at commit: 3c76fd761fecd22c288068545a65a49a9881e592, compared to commit: d158962664aa1e6eaf583964ee6cf99eb4e9ac47

🧾 Summary (100% most significant diffs)

Contract Method Avg (+/-) %
TestCalldataDA processCalldataDA
processL2RollupDAValidatorOutputHash
-66 ✅
+20 ❌
-9.61%
+1.23%
DummyBridgehubSetter createNewChain
requestL2TransactionDirect
requestL2TransactionTwoBridges
setAddresses
+622 ❌
+297 ❌
-76 ✅
-4 ✅
+0.59%
+0.33%
-0.06%
-0.01%
ChainAdmin setUpgradeTimestamp +237 ❌ +0.52%
L1Nullifier bridgeRecoverFailedTransfer
finalizeDeposit
nullifyChainBalanceByNTV
-40 ✅
+10 ❌
-22 ✅
-0.07%
+0.01%
-0.48%
MerkleTest calculateRoot(bytes32[],bytes32[],uint256,bytes32[])
calculateRoot(bytes32[],uint256,bytes32)
-16 ✅
+2 ❌
-0.28%
+0.07%
TransparentUpgradeableProxy allowAdminImplementation
bridgeRecoverFailedTransfer
finalizeDeposit
finalizeWithdrawal
nullifyChainBalanceByNTV
registerToken
setAllowedData
setNativeTokenVault
transferFundsFromSharedBridge
-21 ✅
-44 ✅
+12 ❌
+9 ❌
-78 ✅
0 ➖
+4 ❌
-2 ✅
-4 ✅
-0.04%
-0.05%
+0.01%
+0.01%
-0.25%
0.00%
+0.01%
-0.00%
-0.01%
L1NativeTokenVault transferFundsFromSharedBridge 0 ➖ 0.00%
FullMerkleTest updateAllLeaves
updateLeaf
+25 ❌
-6 ✅
+0.05%
-0.02%
L1AssetRouter finalizeWithdrawal
setNativeTokenVault
+10 ❌
0 ➖
+0.01%
0.00%
PriorityTreeTest initFromCommitment
processBatch
+8 ❌
-16 ✅
+0.01%
-0.04%
RelayedSLDAValidator checkDA +12 ❌ +0.04%
DiamondProxy finalizeEthWithdrawal -18 ✅ -0.02%
MessageRoot addChainBatchRoot
addNewChain
-22 ✅
-3 ✅
-0.03%
-0.00%
TestnetERC20Token approve
transfer
+5 ❌
+8 ❌
+0.01%
+0.02%
DummyChainTypeManagerWBH setZKChain -2 ✅ -0.00%
PermanentRestriction setAllowedData +1 ❌ +0.00%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
TestCalldataDA 508,031 (-64,827) processCalldataDA
processL2RollupDAValidatorOutputHash
610 (-66)
610 (-15)
-9.76%
-2.40%
621 (-66)
1,644 (+20)
-9.61%
+1.23%
610 (-66)
1,609 (+154)
-9.76%
+10.58%
2,488 (0)
2,795 (0)
0.00%
0.00%
260 (0)
5 (0)
DummyBridgehubSetter 5,381,688 (+17,156) addChainTypeManager
admin
createNewChain
proveL1ToL2TransactionStatus
proveL2LogInclusion
proveL2MessageInclusion
requestL2TransactionDirect
requestL2TransactionTwoBridges
setAddresses
setCTM
setPendingAdmin
setZKChain
23,865 (0)
411 (0)
28,811 (+288)
0 (0)
0 (0)
0 (0)
32,938 (0)
30,893 (+6)
24,282 (+12)
44,193 (0)
25,880 (0)
111,315 (0)
0.00%
0.00%
+1.01%
+∞%
+∞%
+∞%
0.00%
+0.02%
+0.05%
0.00%
0.00%
0.00%
44,090 (-1)
1,523 (-1)
106,902 (+622)
1,364 (-34)
1,477 (-2)
1,548 (+7)
90,230 (+297)
134,096 (-76)
65,949 (-4)
44,231 (+2)
47,598 (-4)
111,353 (+2)
-0.00%
-0.07%
+0.59%
-2.43%
-0.14%
+0.45%
+0.33%
-0.06%
-0.01%
+0.00%
-0.01%
+0.00%
47,558 (0)
2,411 (0)
36,343 (0)
958 (-9)
1,066 (+6)
1,147 (+3)
73,330 (-1,776)
46,968 (-30,630)
71,130 (0)
44,241 (0)
49,745 (0)
111,363 (0)
0.00%
0.00%
0.00%
-0.93%
+0.57%
+0.26%
-2.36%
-39.47%
0.00%
0.00%
0.00%
0.00%
47,558 (0)
2,411 (0)
879,131 (+15,819)
3,585 (0)
3,785 (-7)
3,934 (-28)
202,258 (-2,945)
359,809 (+108)
91,270 (0)
44,253 (0)
49,757 (0)
111,375 (0)
0.00%
0.00%
+1.83%
0.00%
-0.18%
-0.71%
-1.44%
+0.03%
0.00%
0.00%
0.00%
0.00%
6,656 (0)
2,301 (+1)
2,560 (0)
512 (0)
512 (0)
512 (0)
1,024 (0)
1,536 (+1)
3,328 (0)
2,816 (0)
4,861 (+1)
2,816 (0)
ChainAdmin 909,847 (0) setUpgradeTimestamp 45,273 (+19,912) +78.51% 45,399 (+237) +0.52% 45,327 (+6) +0.01% 45,645 (0) 0.00% 256 (0)
L1Nullifier 3,209,878 (-98,917) bridgeRecoverFailedTransfer
finalizeDeposit
nullifyChainBalanceByNTV
14,025 (0)
9,950 (0)
2,544 (-66)
0.00%
0.00%
-2.53%
60,015 (-40)
70,684 (+10)
4,553 (-22)
-0.07%
+0.01%
-0.48%
72,616 (-81)
87,590 (+12)
5,558 (0)
-0.11%
+0.01%
0.00%
80,804 (0)
108,123 (+12)
5,558 (0)
0.00%
+0.01%
0.00%
4 (0)
21 (0)
3 (0)
MerkleTest 492,725 (-27,279) calculateRoot(bytes32[],bytes32[],uint256,bytes32[])
calculateRoot(bytes32[],uint256,bytes32)
1,595 (0)
565 (0)
0.00%
0.00%
5,715 (-16)
2,931 (+2)
-0.28%
+0.07%
1,823 (-33)
2,982 (0)
-1.78%
0.00%
13,520 (0)
3,026 (-11)
0.00%
-0.36%
8 (0)
265 (0)
TransparentUpgradeableProxy 787,868 (0) allowAdminImplementation
bridgeRecoverFailedTransfer
finalizeDeposit
finalizeWithdrawal
nullifyChainBalanceByNTV
registerToken
setAllowedData
setNativeTokenVault
setSelectorIsValidated
transferFundsFromSharedBridge
54,635 (0)
45,531 (0)
124,368 (+12)
56,436 (0)
31,215 (-78)
28,833 (-78)
55,764 (+429)
32,930 (-67)
54,680 (0)
37,272 (-78)
0.00%
0.00%
+0.01%
0.00%
-0.25%
-0.27%
+0.78%
-0.20%
0.00%
-0.21%
54,856 (-21)
87,715 (-44)
127,919 (+12)
110,001 (+9)
31,215 (-78)
128,005 (0)
56,414 (+4)
74,683 (-2)
54,708 (-4)
48,974 (-4)
-0.04%
-0.05%
+0.01%
+0.01%
-0.25%
0.00%
+0.01%
-0.00%
-0.01%
-0.01%
54,995 (-12)
98,007 (0)
127,919 (+12)
125,774 (+12)
31,215 (-78)
128,480 (0)
56,028 (0)
75,827 (0)
54,728 (0)
48,833 (0)
-0.02%
0.00%
+0.01%
+0.01%
-0.25%
0.00%
0.00%
0.00%
0.00%
0.00%
55,007 (0)
109,315 (-177)
131,470 (+12)
135,132 (+12)
31,215 (-78)
135,575 (0)
58,155 (0)
75,827 (0)
54,728 (0)
59,670 (+60)
0.00%
-0.16%
+0.01%
+0.01%
-0.25%
0.00%
0.00%
0.00%
0.00%
+0.10%
258 (0)
4 (0)
2 (0)
19 (0)
1 (0)
876 (0)
257 (0)
75 (0)
258 (0)
5 (0)
L1NativeTokenVault 3,775,496 (-53,037) bridgeBurn
bridgeRecoverFailedTransfer
transferFundsFromSharedBridge
12,557 (0)
5,239 (0)
8,744 (-66)
0.00%
0.00%
-0.75%
68,959 (+11)
19,250 (-11)
21,498 (0)
+0.02%
-0.06%
0.00%
79,756 (0)
22,363 (0)
20,537 (0)
0.00%
0.00%
0.00%
79,756 (0)
29,535 (0)
33,215 (0)
0.00%
0.00%
0.00%
1,297 (0)
9 (0)
5 (0)
FullMerkleTest 836,995 (-14,759) updateAllLeaves
updateLeaf
26,046 (+100)
24,359 (-12)
+0.39%
-0.05%
47,354 (+25)
35,301 (-6)
+0.05%
-0.02%
43,729 (0)
35,301 (-6)
0.00%
-0.02%
75,915 (0)
46,244 (0)
0.00%
0.00%
4 (0)
2 (0)
L1AssetRouter 4,107,641 (-20,659) bridgeRecoverFailedTransfer
finalizeWithdrawal
setNativeTokenVault
16,546 (0)
25,801 (0)
4,642 (-55)
0.00%
0.00%
-1.17%
34,320 (-15)
83,126 (+10)
66,728 (0)
-0.04%
+0.01%
0.00%
36,544 (0)
101,451 (+12)
68,735 (0)
0.00%
+0.01%
0.00%
43,716 (0)
111,117 (+12)
68,735 (0)
0.00%
+0.01%
0.00%
9 (0)
19 (0)
843 (0)
PriorityTreeTest 951,816 (-47,099) initFromCommitment
processBatch
54,078 (+8)
23,662 (0)
+0.01%
0.00%
54,078 (+8)
37,356 (-16)
+0.01%
-0.04%
54,078 (+8)
36,221 (-33)
+0.01%
-0.09%
54,078 (+8)
53,319 (0)
+0.01%
0.00%
1 (0)
4 (0)
RelayedSLDAValidator 681,315 (-86,917) checkDA 27,650 (-37) -0.13% 31,367 (+12) +0.04% 29,782 (+22) +0.07% 38,256 (+42) +0.11% 4 (0)
DiamondProxy 2,475,597 (0) finalizeEthWithdrawal
util_setChainId
37,590 (0)
28,906 (0)
0.00%
0.00%
76,361 (-18)
33,744 (-10)
-0.02%
-0.03%
76,707 (-48)
33,718 (0)
-0.06%
0.00%
77,007 (0)
34,090 (0)
0.00%
0.00%
257 (0)
519 (0)
MessageRoot 1,501,618 (-7,081) addChainBatchRoot
addNewChain
27,470 (-66)
21,823 (-13)
-0.24%
-0.06%
77,492 (-22)
218,086 (-3)
-0.03%
-0.00%
102,503 (0)
283,507 (0)
0.00%
0.00%
102,503 (0)
283,507 (0)
0.00%
0.00%
3 (0)
4 (0)
AccessControlRestriction 1,759,703 (+12) grantRole
setRequiredRoleForCall
setRequiredRoleForFallback
51,036 (0)
48,605 (0)
47,940 (0)
0.00%
0.00%
0.00%
51,272 (-7)
49,417 (-12)
48,851 (+10)
-0.01%
-0.02%
+0.02%
51,408 (0)
48,977 (0)
48,312 (0)
0.00%
0.00%
0.00%
51,408 (0)
51,877 (0)
51,658 (0)
0.00%
0.00%
0.00%
1,024 (0)
1,280 (0)
1,280 (0)
TestnetERC20Token 800,383 (0) approve
mint
transfer
24,247 (0)
34,018 (0)
46,273 (0)
0.00%
0.00%
0.00%
46,240 (+5)
61,949 (+4)
46,629 (+8)
+0.01%
+0.01%
+0.02%
46,207 (+12)
68,242 (0)
46,573 (+24)
+0.03%
0.00%
+0.05%
46,543 (0)
68,602 (0)
46,873 (0)
0.00%
0.00%
0.00%
1,512 (0)
1,679 (0)
257 (0)
MerkleTreeNoSort 583,114 (0) getProof 2,608 (0) 0.00% 32,750 (-3) -0.01% 33,207 (0) 0.00% 33,229 (0) 0.00% 277 (0)
DummyChainTypeManagerWBH 4,515,893 (-60,886) setZKChain 44,085 (0) 0.00% 44,121 (-2) -0.00% 44,121 (-24) -0.05% 44,145 (0) 0.00% 256 (0)
PermanentRestriction 1,998,755 (0) setAllowedData 27,033 (+271) +1.01% 27,212 (+1) +0.00% 27,033 (0) 0.00% 27,846 (0) 0.00% 257 (0)
TestExecutor 3,353,142 (-131,819) commitBatchesSharedBridge 7,814 (0) 0.00% 32,189 (-1) -0.00% 32,224 (0) 0.00% 46,788 (0) 0.00% 23 (0)
L1ERC20Bridge 1,380,432 (+12)
Bridgehub 5,344,373 (+16,949)
DummyChainTypeManager 4,514,145 (-60,874)
DummyZKChain 3,456,331 (-97,618)
PriorityQueueTest 328,668 (+12)
Governance 1,218,207 (-12)
ChainTypeManager 4,486,126 (-60,874)
DiamondInit 625,064 (-12)
AdminFacet 4,284,880 (-313,263)
GettersFacet 1,152,473 (+12)
MailboxFacet 3,189,834 (-97,578)
Utils 6,017,239 (-20,429)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant