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

add TimestampAsserter to sync-layer-stable #1057

Merged

Conversation

perekopskiy
Copy link
Contributor

What ❔

Adds TimestampAsserter to sync-layer-stable

Why ❔

Required to port zksync-era:main changes to sync-layer-stable

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 Nov 8, 2024

Coverage after merging sync-layer-stable-with-timestamp-asserter 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,

Copy link

github-actions bot commented Nov 8, 2024

Changes to gas cost

Generated at commit: 6a1f34ca732272a8542a5d4e89d86ad3dbd15fec, compared to commit: 5b8b0785e4f7bae0b6d09d2dcd3d2b324204c16d

🧾 Summary (100% most significant diffs)

Contract Method Avg (+/-) %
DummyBridgehubSetter addChainTypeManager
createNewChain
removeChainTypeManager
requestL2TransactionDirect
requestL2TransactionTwoBridges
setAddresses
setPendingAdmin
+2 ❌
-1,334 ✅
-2 ✅
-734 ✅
-2 ✅
-2 ✅
+1 ❌
+0.00%
-1.22%
-0.01%
-0.76%
-0.00%
-0.00%
+0.00%
DiamondProxy finalizeEthWithdrawal
requestL2Transaction
-129 ✅
-3 ✅
-0.16%
-0.00%
ChainAdmin setUpgradeTimestamp +17 ❌ +0.04%
TransparentUpgradeableProxy setAllowedData +5 ❌ +0.01%
DummyChainTypeManagerWBH setZKChain -2 ✅ -0.00%
TestnetERC20Token approve -2 ✅ -0.00%

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,907 (+12)
28,649 (-408)
0 (0)
0 (0)
0 (0)
23,844 (+12)
33,020 (0)
31,017 (+12)
24,336 (-12)
25,999 (-12)
+0.05%
-1.40%
+∞%
+∞%
+∞%
+0.05%
0.00%
+0.04%
-0.05%
-0.05%
44,150 (+2)
107,766 (-1,334)
1,398 (+8)
1,507 (-6)
1,640 (+35)
25,467 (-2)
95,507 (-734)
149,032 (-2)
66,061 (-2)
47,721 (+1)
+0.00%
-1.22%
+0.58%
-0.40%
+2.18%
-0.01%
-0.76%
-0.00%
-0.00%
+0.00%
47,621 (0)
36,509 (0)
985 (-6)
1,100 (-3)
1,191 (0)
25,832 (0)
74,954 (-1,115)
46,925 (-270)
71,205 (0)
49,885 (0)
0.00%
0.00%
-0.61%
-0.27%
0.00%
0.00%
-1.47%
-0.57%
0.00%
0.00%
47,621 (0)
877,466 (-12,989)
3,625 (0)
3,852 (-21)
4,069 (0)
26,244 (0)
227,201 (+279)
425,711 (+72)
91,345 (0)
49,897 (0)
0.00%
-1.46%
0.00%
-0.54%
0.00%
0.00%
+0.12%
+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% 51,821 (-124) -0.24% 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 (0)
0.00%
0.00%
0.00%
79,146 (-129)
131,403 (-3)
33,798 (-17)
-0.16%
-0.00%
-0.05%
80,015 (-12)
170,024 (-12)
33,756 (0)
-0.01%
-0.01%
0.00%
80,291 (0)
191,977 (0)
34,128 (0)
0.00%
0.00%
0.00%
257 (0)
771 (0)
519 (0)
ChainAdmin 784,876 (0) setUpgradeTimestamp 25,361 (0) 0.00% 45,325 (+17) +0.04% 45,345 (+36) +0.08% 45,645 (0) 0.00% 256 (0)
MerkleTest 463,574 (0) calculateRoot(bytes32[],uint256,bytes32) 571 (0) 0.00% 2,930 (-1) -0.03% 2,982 (0) 0.00% 3,026 (0) 0.00% 265 (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,395 (-6)
49,923 (-12)
49,368 (-2)
-0.01%
-0.02%
-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)
TransparentUpgradeableProxy 644,375 (0) setAllowedData
setSelectorIsValidated
55,427 (0)
54,738 (0)
0.00%
0.00%
56,486 (+5)
54,768 (-2)
+0.01%
-0.00%
56,120 (+12)
54,786 (0)
+0.02%
0.00%
58,235 (+12)
54,786 (0)
+0.02%
0.00%
257 (0)
258 (0)
L1NativeTokenVault 3,323,475 (0) bridgeBurn 12,777 (0) 0.00% 85,880 (+7) +0.01% 100,649 (0) 0.00% 100,649 (0) 0.00% 1,299 (0)
DummyChainTypeManagerWBH 3,848,191 (0) setZKChain 44,101 (0) 0.00% 44,137 (-2) -0.00% 44,149 (-12) -0.03% 44,161 (0) 0.00% 256 (0)
TestnetERC20Token 640,427 (0) approve
mint
transfer
24,272 (0)
34,031 (0)
46,377 (0)
0.00%
0.00%
0.00%
46,257 (-2)
61,798 (-1)
46,716 (-1)
-0.00%
-0.00%
-0.00%
46,232 (+12)
68,255 (0)
46,641 (0)
+0.03%
0.00%
0.00%
46,568 (0)
68,615 (0)
46,977 (0)
0.00%
0.00%
0.00%
1,527 (0)
1,704 (0)
257 (0)
PermanentRestriction 1,543,705 (0) setAllowedData 26,818 (0) 0.00% 27,262 (+1) +0.00% 27,089 (0) 0.00% 27,902 (0) 0.00% 257 (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 merged commit 2451c42 into sync-layer-stable Nov 11, 2024
24 of 25 checks passed
@perekopskiy perekopskiy deleted the sync-layer-stable-with-timestamp-asserter branch November 11, 2024 14:34
@perekopskiy perekopskiy restored the sync-layer-stable-with-timestamp-asserter branch November 11, 2024 18:51
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