matter-labs / era-contracts

Smart Contract Submodule For zkSync Era
MIT License
490 stars 348 forks source link

Fix tests for the contest #1048

Closed vladbochok closed 3 weeks ago

vladbochok commented 3 weeks ago

What โ”

Why โ”

Checklist

github-actions[bot] commented 3 weeks ago

Changes to gas cost

Generated at commit: c0386897bd21d5848597ee1e2370bc7bcbfee8a3, compared to commit: 85046c1bae2ee85395825766d964a3c0c6eb0bfc

๐Ÿงพ Summary (100% most significant diffs)

Contract Method Avg (+/-) %
DummyBridgehubSetter addChainTypeManager
createNewChain
requestL2TransactionDirect
requestL2TransactionTwoBridges
setAddresses
setPendingAdmin
0 โž–
+3,063 โŒ
+576 โŒ
-13 โœ…
+2 โŒ
+2 โŒ
0.00%
+2.88%
+0.49%
-0.01%
+0.00%
+0.00%
DiamondProxy finalizeEthWithdrawal
requestL2Transaction
_utilsetChainId
+988 โŒ
+8 โŒ
-70 โœ…
+1.25%
+0.01%
-0.21%
ChainAdmin setUpgradeTimestamp -245 โœ… -0.54%
TransparentUpgradeableProxy setAllowedData +104 โŒ +0.18%
MerkleTest calculateRoot(bytes32[],uint256,bytes32) -3 โœ… -0.10%
TestnetERC20Token approve
transfer
+5 โŒ
+15 โŒ
+0.01%
+0.03%
DummyChainTypeManagerWBH setZKChain 0 โž– 0.00%

Full diff report ๐Ÿ‘‡
| Contract | Deployment Cost (+/-) | Method | Min (+/-) | % | Avg (+/-) | % | Median (+/-) | % | Max (+/-) | % | # Calls (+/-) | |:-|-:|:-|-:|-:|-:|-:|-:|-:|-:|-:|-:| | **DummyBridgehubSetter** | 4,350,895 (0) | _addChainTypeManager_
_createNewChain_
_proveL1ToL2TransactionStatus_
_proveL2LogInclusion_
_proveL2MessageInclusion_
_removeChainTypeManager_
_requestL2TransactionDirect_
_requestL2TransactionTwoBridges_
_setAddresses_
_setPendingAdmin_ | 23,895 (-12)
29,945 (+1,332)
0 (0)
0 (0)
0 (0)
23,854 (0)
33,020 (-24)
31,035 (0)
24,358 (-12)
26,011 (+12) | **-0.05%**
**+4.66%**
**+โˆž%**
**+โˆž%**
**+โˆž%**
**0.00%**
**-0.07%**
**0.00%**
**-0.05%**
**+0.05%** | 44,149 (0)
109,294 (+3,063)
1,382 (+6)
1,497 (-9)
1,594 (-22)
25,492 (+4)
118,928 (+576)
151,416 (-13)
66,089 (+2)
47,721 (+2) | **0.00%**
**+2.88%**
**+0.44%**
**-0.60%**
**-1.36%**
**+0.02%**
**+0.49%**
**-0.01%**
**+0.00%**
**+0.00%** | 47,621 (0)
36,509 (0)
985 (0)
1,100 (-3)
1,191 (-6)
25,854 (0)
96,799 (+218)
46,853 (-606)
71,227 (0)
49,885 (0) | **0.00%**
**0.00%**
**0.00%**
**-0.27%**
**-0.50%**
**0.00%**
**+0.23%**
**-1.28%**
**0.00%**
**0.00%** | 47,621 (0)
879,795 (-3,884)
3,632 (-7)
3,873 (+7)
4,048 (-14)
26,266 (0)
295,851 (-4,823)
434,490 (-108)
91,367 (0)
49,897 (0) | **0.00%**
**-0.44%**
**-0.19%**
**+0.18%**
**-0.34%**
**0.00%**
**-1.60%**
**-0.02%**
**0.00%**
**0.00%** | 6,656 (0)
2,560 (0)
512 (0)
512 (0)
512 (0)
2,048 (0)
1,024 (0)
1,536 (0)
3,328 (0)
4,864 (0) | | **MailboxFacet** | 2,681,325 (0) | _finalizeEthWithdrawal_ | 8,251 (0) | **0.00%** | 52,438 (+987) | **+1.92%** | 52,735 (0) | **0.00%** | 52,735 (0) | **0.00%** | 257 (0) | | **DiamondProxy** | 2,405,277 (0) | _finalizeEthWithdrawal_
_requestL2Transaction_
_util_setChainId_ | 37,779 (0)
33,295 (0)
28,944 (-4,812) | **0.00%**
**0.00%**
**-14.26%** | 79,759 (+988)
131,436 (+8)
33,745 (-70) | **+1.25%**
**+0.01%**
**-0.21%** | 79,979 (-12)
170,036 (+36)
33,756 (0) | **-0.02%**
**+0.02%**
**0.00%** | 80,291 (0)
191,977 (0)
34,128 (0) | **0.00%**
**0.00%**
**0.00%** | 257 (0)
771 (0)
519 (0) | | **ChainAdmin** | 835,016 (0) | _setUpgradeTimestamp_ | 25,361 (-19,912) | **-43.98%** | 45,151 (-245) | **-0.54%** | 45,309 (-42) | **-0.09%** | 45,645 (0) | **0.00%** | 256 (0) | | **TransparentUpgradeableProxy** | 644,397 (0) | _setAllowedAdminImplementation_
_setAllowedData_ | 54,675 (0)
55,405 (0) | **0.00%**
**0.00%** | 54,915 (-5)
56,540 (+104) | **-0.01%**
**+0.18%** | 55,047 (0)
56,158 (+60) | **0.00%**
**+0.11%** | 55,047 (0)
58,225 (0) | **0.00%**
**0.00%** | 258 (0)
257 (0) | | **TestPermanentRestriction** | 1,450,178 (0) | _setAllowedData_ | 26,796 (0) | **0.00%** | 27,263 (+32) | **+0.12%** | 27,067 (0) | **0.00%** | 27,880 (0) | **0.00%** | 257 (0) | | **MerkleTest** | 436,733 (0) | _calculateRoot(bytes32[],uint256,bytes32)_ | 571 (0) | **0.00%** | 2,927 (-3) | **-0.10%** | 2,982 (0) | **0.00%** | 3,026 (-11) | **-0.36%** | 265 (0) | | **TestnetERC20Token** | 640,427 (0) | _approve_
_mint_
_transfer_ | 24,272 (0)
34,031 (0)
46,377 (0) | **0.00%**
**0.00%**
**0.00%** | 46,256 (+5)
61,796 (+5)
46,731 (+15) | **+0.01%**
**+0.01%**
**+0.03%** | 46,220 (+12)
68,255 (0)
46,677 (+36) | **+0.03%**
**0.00%**
**+0.08%** | 46,568 (0)
68,615 (0)
46,977 (0) | **0.00%**
**0.00%**
**0.00%** | 1,527 (0)
1,704 (0)
257 (0) | | **MerkleTreeNoSort** | 534,636 (0) | _getProof_ | 2,594 (0) | **0.00%** | 32,745 (+7) | **+0.02%** | 33,193 (0) | **0.00%** | 33,215 (0) | **0.00%** | 277 (0) | | **L1NativeTokenVault** | 3,438,536 (0) | _bridgeBurn_ | 12,799 (0) | **0.00%** | 89,766 (-8) | **-0.01%** | 106,025 (0) | **0.00%** | 106,025 (0) | **0.00%** | 1,299 (0) | | **AccessControlRestriction** | 1,357,213 (0) | _grantRole_
_setRequiredRoleForCall_ | 51,277 (0)
24,360 (0) | **0.00%**
**0.00%** | 51,519 (+4)
45,737 (+4) | **+0.01%**
**+0.01%** | 51,649 (0)
49,094 (0) | **0.00%**
**0.00%** | 51,649 (0)
54,114 (0) | **0.00%**
**0.00%** | 1,024 (0)
1,536 (0) | | **DummyChainTypeManagerWBH** | 3,757,044 (0) | _setZKChain_ | 44,123 (0) | **0.00%** | 44,160 (0) | **0.00%** | 44,177 (+6) | **+0.01%** | 44,183 (0) | **0.00%** | 256 (0) |