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

fix: oz link for system contracts #1042

Merged
merged 2 commits into from
Oct 29, 2024

Conversation

perekopskiy
Copy link
Contributor

What ❔

fixes oz link for system contracts

Why ❔

to be able to compile with foundry

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 28, 2024

Changes to gas cost

Generated at commit: dd3f2a051b816ee8ae1d90873d01d97adc013491, compared to commit: 5b8b0785e4f7bae0b6d09d2dcd3d2b324204c16d

🧾 Summary (100% most significant diffs)

Contract Method Avg (+/-) %
DummyBridgehubSetter createNewChain
requestL2TransactionDirect
requestL2TransactionTwoBridges
setPendingAdmin
-2,268 ✅
-725 ✅
-49 ✅
+1 ❌
-2.08%
-0.75%
-0.03%
+0.00%
ChainAdmin setUpgradeTimestamp -234 ✅ -0.52%
DiamondProxy finalizeEthWithdrawal +375 ❌ +0.47%
TransparentUpgradeableProxy setAllowedData +61 ❌ +0.11%
MerkleTest calculateRoot(bytes32[],uint256,bytes32) -1 ✅ -0.03%
TestnetERC20Token approve
transfer
-1 ✅
+12 ❌
-0.00%
+0.03%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
DummyBridgehubSetter 4,313,059 (0) addChainTypeManager
createNewChain
proveL1ToL2TransactionStatus
proveL2LogInclusion
proveL2MessageInclusion
removeChainTypeManager
requestL2TransactionDirect
requestL2TransactionTwoBridges
setAddresses
setPendingAdmin
23,895 (0)
28,613 (-444)
0 (0)
0 (0)
0 (0)
23,832 (0)
33,044 (+24)
31,017 (+12)
24,348 (0)
25,999 (-12)
0.00%
-1.53%
+∞%
+∞%
+∞%
0.00%
+0.07%
+0.04%
0.00%
-0.05%
44,146 (-2)
106,832 (-2,268)
1,396 (+6)
1,508 (-5)
1,597 (-8)
25,468 (-1)
95,516 (-725)
148,985 (-49)
66,066 (+3)
47,721 (+1)
-0.00%
-2.08%
+0.43%
-0.33%
-0.50%
-0.00%
-0.75%
-0.03%
+0.00%
+0.00%
47,621 (0)
36,509 (0)
988 (-3)
1,103 (0)
1,191 (0)
25,832 (0)
76,589 (+520)
47,069 (-126)
71,205 (0)
49,885 (0)
0.00%
0.00%
-0.30%
0.00%
0.00%
0.00%
+0.68%
-0.27%
0.00%
0.00%
47,621 (0)
882,178 (-8,277)
3,639 (+14)
3,859 (-14)
4,048 (-21)
26,244 (0)
228,720 (+1,798)
425,735 (+96)
91,345 (0)
49,897 (0)
0.00%
-0.93%
+0.39%
-0.36%
-0.52%
0.00%
+0.79%
+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,743,534 (0) finalizeEthWithdrawal 8,251 (0) 0.00% 52,315 (+370) +0.71% 52,735 (0) 0.00% 52,735 (0) 0.00% 257 (0)
ChainAdmin 784,876 (0) setUpgradeTimestamp 25,361 (0) 0.00% 45,074 (-234) -0.52% 45,333 (+24) +0.05% 45,645 (0) 0.00% 256 (0)
DiamondProxy 2,405,277 (0) finalizeEthWithdrawal
requestL2Transaction
util_setChainId
37,779 (0)
33,295 (0)
28,944 (0)
0.00%
0.00%
0.00%
79,650 (+375)
131,400 (-6)
33,778 (-37)
+0.47%
-0.00%
-0.11%
80,003 (-24)
170,036 (0)
33,756 (0)
-0.03%
0.00%
0.00%
80,291 (0)
191,977 (0)
34,128 (0)
0.00%
0.00%
0.00%
257 (0)
771 (0)
519 (0)
TransparentUpgradeableProxy 644,375 (0) allowAdminImplementation
setAllowedData
setSelectorIsValidated
54,663 (0)
55,427 (0)
54,738 (0)
0.00%
0.00%
0.00%
54,910 (+6)
56,542 (+61)
54,767 (-3)
+0.01%
+0.11%
-0.01%
55,035 (0)
56,192 (+84)
54,786 (0)
0.00%
+0.15%
0.00%
55,035 (0)
58,235 (+12)
54,786 (0)
0.00%
+0.02%
0.00%
258 (0)
257 (0)
258 (0)
PermanentRestriction 1,543,705 (0) setAllowedData 26,818 (0) 0.00% 27,281 (+20) +0.07% 27,089 (0) 0.00% 27,902 (0) 0.00% 257 (0)
MerkleTest 463,574 (0) calculateRoot(bytes32[],uint256,bytes32) 571 (0) 0.00% 2,930 (-1) -0.03% 2,982 (0) 0.00% 3,037 (+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,258 (-1)
61,798 (-1)
46,729 (+12)
-0.00%
-0.00%
+0.03%
46,232 (+12)
68,255 (0)
46,653 (+12)
+0.03%
0.00%
+0.03%
46,568 (0)
68,615 (0)
46,977 (0)
0.00%
0.00%
0.00%
1,527 (0)
1,704 (0)
257 (0)
AccessControlRestriction 1,329,782 (0) grantRole
setRequiredRoleForCall
setRequiredRoleForFallback
51,166 (0)
48,687 (0)
48,037 (0)
0.00%
0.00%
0.00%
51,403 (+2)
49,934 (-1)
49,372 (+2)
+0.00%
-0.00%
+0.00%
51,538 (0)
49,059 (0)
48,409 (0)
0.00%
0.00%
0.00%
51,538 (0)
54,114 (0)
53,925 (0)
0.00%
0.00%
0.00%
1,024 (0)
1,280 (0)
1,280 (0)
MerkleTreeNoSort 534,636 (0) getProof 2,594 (0) 0.00% 32,739 (+1) +0.00% 33,193 (0) 0.00% 33,215 (0) 0.00% 277 (0)

@perekopskiy perekopskiy changed the base branch from kl/merge-protocol-defense to sync-layer-stable October 29, 2024 13:23
Copy link

Coverage after merging fix-sc-oz-links into sync-layer-stable will be

85.84%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
../da-contracts/contracts
   RollupL1DAValidator.sol64.94%37.50%83.33%70.91%145, 148, 148, 148, 150, 183–184, 187–188, 27, 27–28, 30, 30–31, 34, 36–37, 41–42, 65, 67, 67, 67–68, 70
contracts/bridge
   BridgeHelper.sol93.33%50%100%100%22
   BridgedStandardERC20.sol74.03%25%92.31%76.79%121–122, 127–128, 140–141, 165–166, 207, 207, 214, 214, 221, 221, 232, 62–63, 94–95
   L1ERC20Bridge.sol93.18%80%100%93.75%188–189, 264
   L1Nullifier.sol77.23%58.82%80%83.22%116–117, 132, 132–133, 140, 140–141, 148, 148–149, 178–179, 238–239, 241–242, 251–252, 260–261, 263, 429, 431–432, 432, 432, 434–435, 435, 435, 460–461, 482–483, 522, 617, 652–653, 706, 708, 710, 723, 737, 742
contracts/bridge/asset-router
   AssetRouterBase.sol83.78%40%100%88%138–139, 57–58, 85–86
   L1AssetRouter.sol88.75%72%88.89%92.59%204–205, 241, 250, 252, 255, 350, 57–58, 603, 622, 73–74, 81–82
contracts/bridge/ntv
   L1NativeTokenVault.sol78.91%61.76%93.33%83.54%137, 142, 145–146, 146, 146–148, 148, 148–150, 150, 150–151, 153, 205, 214, 216, 216, 216–217, 219, 254, 254–255
   NativeTokenVault.sol87.26%68%90.48%90.99%202, 204, 222–223, 230–231, 384, 386, 398–399, 433–434, 437–438, 464, 469, 67–68
contracts/bridgehub
   Bridgehub.sol79.12%48.48%89.36%85.90%114, 114–115, 121–122, 129–130, 136–137, 143, 143–144, 173, 188–189, 235–236, 236, 236–237, 244–245, 247–248, 251–252, 262–263, 277–278, 327–328, 330–331, 388–389, 404–405, 435–436, 442, 519–520, 601, 700, 703–704, 708–709, 744–745, 758, 801–802, 804–805, 807–808, 842–843, 846–847, 849–850, 885, 890
   CTMDeploymentTracker.sol79.07%50%90%94.74%115, 119, 34, 41, 64, 91, 94, 96
   MessageRoot.sol91.07%63.64%100%96.97%116–117, 148, 69, 87
contracts/common
   ReentrancyGuard.sol90%66.67%100%92.86%78–79
contracts/common/libraries
   DataEncoding.sol77.14%50%100%80%108, 112, 119, 129, 131, 134, 75, 83
   DynamicIncrementalMerkle.sol74.42%100%80%72.22%67–70, 72–74, 76–78
   FullMerkle.sol100%100%100%100%
   L2ContractHelper.sol55.56%0%66.67%64%100, 100–101, 109, 68–69, 74–75, 78–79, 93, 95, 95–96
   Merkle.sol96.61%90.91%100%97.67%80–81
   MessageHashing.sol100%100%100%100%
   SemVer.sol100%100%100%100%
   SystemContractsCaller.sol0%0%0%0%114, 122–125, 135–138, 138–139, 141, 141–142, 33, 33–34, 37, 45, 47, 49, 51, 53, 66, 66, 66, 69, 72, 75, 78, 89, 91, 93, 96, 98
   UncheckedMath.sol100%100%100%100%
   UnsafeBytes.sol84.21%100%83.33%84.62%35–36
contracts/governance
   AccessControlRestriction.sol100%100%100%100%
   ChainAdmin.sol95.12%80%100%96.15%27–28
   Governance.sol98.15%94.74%100%98.55%45–46
   L2ProxyAdminDeployer.sol0%100%0%0%17–18, 20
   PermanentRestriction.sol89.43%82.61%100%89.41%110, 110–111, 138, 201, 201–202, 205, 207, 207–208, 248–249
   TransitionaryOwner.sol0%100%0%0%17, 22–23
contracts/state-transition
   ChainTypeManager.sol70.99%33.33%68.57%80.58%108, 135–136, 138–139, 141–142, 144–145, 200–201, 252, 276, 295, 302, 309, 317, 324, 332, 339, 355, 357, 419, 438, 438, 438, 441, 441, 441, 443, 456, 461, 486, 74, 87–88
   TestnetVerifier.sol77.78%66.67%100%75%16, 28
   ValidatorTimelock.sol95.08%83.33%100%95.24%200, 82–83
   Verifier.sol89.90%40%96.30%90.93%1674–1675, 287–302, 305–308, 311–318, 321–328, 331–332, 335–336, 339, 383–384, 394–395, 405–406, 416–417, 427–428, 443–444, 453, 453–454, 905–906
contracts/state-transition/chain-deps
   DiamondInit.sol80.43%50%100%88.24%39–40, 42–43, 45–46, 48–49, 73
   DiamondProxy.sol92.31%75%100%100%16, 27
contracts/state-transition/chain-deps/facets
   Admin.sol80.56%50%95.45%91.18%104–105, 115–116, 130, 130–131, 133–134, 157–158, 239, 241, 254–255, 261, 266, 284, 295–296, 301, 313, 315, 315, 315, 321, 321, 321–322, 322, 322–323, 325, 354, 356, 360, 369, 379, 383, 40, 40
   Executor.sol81.61%62.34%96%87.02%120–121, 173, 178, 183, 188, 193, 198, 202–203, 208–210, 212–213, 227–228, 246–247,

@StanislavBreadless StanislavBreadless merged commit 9de1edc into sync-layer-stable Oct 29, 2024
25 checks passed
@StanislavBreadless StanislavBreadless deleted the fix-sc-oz-links branch October 29, 2024 13:50
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.

2 participants