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

Sb sync layer reorg stable sync 2 #712

Merged

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.

@StanislavBreadless
Copy link
Collaborator Author

The Ci already passed during review of the same PR.+ it was approved by @kelemeno , so merging

@StanislavBreadless StanislavBreadless merged commit e7865bc into kl/sync-layer-reorg Aug 19, 2024
39 checks passed
@StanislavBreadless StanislavBreadless deleted the sb-sync-layer-reorg-stable-sync-2 branch August 19, 2024 13:04
Copy link

Changes to gas cost

Generated at commit: 26625ff112fbe4fb840545392bf66760c1cfe296, compared to commit: 4c82e7dfc6b903367560a9e7fe0337ba31ca729c

🧾 Summary (100% most significant diffs)

Contract Method Avg (+/-) %
StateTransitionManager acceptAdmin
createNewChain
initialize
setChainCreationParams
setNewVersionUpgrade
setPendingAdmin
setUpgradeDiamondCut
setValidatorTimelock
-22 ✅
+109 ❌
-22 ✅
-22 ✅
-22 ✅
-22 ✅
-22 ✅
-22 ✅
-0.07%
+0.81%
-0.02%
-0.05%
-0.01%
-0.08%
-0.05%
-0.27%
TransparentUpgradeableProxy acceptAdmin
createNewChain
initialCutHash
l1GenesisUpgrade
protocolVersion
setChainCreationParams
setNewVersionUpgrade
setPendingAdmin
setUpgradeDiamondCut
setValidatorTimelock
storedBatchZero
upgradeCutHash
validatorTimelock
-22 ✅
+109 ❌
-22 ✅
-22 ✅
+89 ❌
-22 ✅
-22 ✅
-22 ✅
-22 ✅
-22 ✅
-22 ✅
-22 ✅
-22 ✅
-0.04%
+0.16%
-0.42%
-2.04%
+1.71%
-0.02%
-0.01%
-0.04%
-0.02%
-0.06%
-2.11%
-1.96%
-0.37%
DummyBridgehubSetter setHyperchain
setPendingAdmin
setSTM
+1 ❌
+8 ❌
+1 ❌
+0.00%
+0.02%
+0.00%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
StateTransitionManager 3,938,492 (-47,255) acceptAdmin
createNewChain
initialCutHash
initialize
l1GenesisUpgrade
protocolVersion
setChainCreationParams
setNewVersionUpgrade
setPendingAdmin
setUpgradeDiamondCut
setValidatorTimelock
storedBatchZero
upgradeCutHash
validatorTimelock
30,672 (-22)
1,295 (+109)
373 (-22)
22,836 (-22)
426 (-22)
418 (+89)
45,213 (-22)
151,062 (-22)
28,418 (-22)
46,685 (-22)
4,840 (-22)
394 (-22)
470 (-22)
447 (-22)
-0.07%
+9.19%
-5.57%
-0.10%
-4.91%
+27.05%
-0.05%
-0.01%
-0.08%
-0.05%
-0.45%
-5.29%
-4.47%
-4.69%
30,672 (-22)
13,569 (+109)
1,373 (-22)
111,736 (-22)
426 (-22)
1,418 (+89)
45,213 (-22)
151,062 (-22)
28,418 (-22)
46,685 (-22)
8,078 (-22)
394 (-22)
470 (-22)
1,447 (-22)
-0.07%
+0.81%
-1.58%
-0.02%
-4.91%
+6.70%
-0.05%
-0.01%
-0.08%
-0.05%
-0.27%
-5.29%
-4.47%
-1.50%
30,672 (-22)
13,569 (+109)
1,373 (-22)
22,836 (-22)
426 (-22)
1,418 (+89)
45,213 (-22)
151,062 (-22)
28,418 (-22)
46,685 (-22)
8,078 (-22)
394 (-22)
470 (-22)
1,447 (-22)
-0.07%
+0.81%
-1.58%
-0.10%
-4.91%
+6.70%
-0.05%
-0.01%
-0.08%
-0.05%
-0.27%
-5.29%
-4.47%
-1.50%
30,672 (-22)
25,844 (+109)
2,373 (-22)
209,526 (-22)
426 (-22)
2,418 (+89)
45,213 (-22)
151,062 (-22)
28,418 (-22)
46,685 (-22)
11,317 (-22)
394 (-22)
470 (-22)
2,447 (-22)
-0.07%
+0.42%
-0.92%
-0.01%
-4.91%
+3.82%
-0.05%
-0.01%
-0.08%
-0.05%
-0.19%
-5.29%
-4.47%
-0.89%
1 (0)
2 (0)
2 (0)
21 (0)
1 (0)
4 (0)
1 (0)
1 (0)
2 (0)
1 (0)
2 (0)
1 (0)
2 (0)
4 (0)
TransparentUpgradeableProxy 641,727 (-203,632) acceptAdmin
createNewChain
initialCutHash
l1GenesisUpgrade
protocolVersion
setChainCreationParams
setNewVersionUpgrade
setPendingAdmin
setUpgradeDiamondCut
setValidatorTimelock
storedBatchZero
upgradeCutHash
validatorTimelock
54,061 (-22)
54,673 (+109)
1,001 (-22)
1,054 (-22)
1,046 (+89)
97,606 (-22)
202,905 (-22)
56,978 (-22)
98,187 (-22)
33,200 (-22)
1,022 (-22)
1,101 (-22)
1,075 (-22)
-0.04%
+0.20%
-2.15%
-2.04%
+9.30%
-0.02%
-0.01%
-0.04%
-0.02%
-0.07%
-2.11%
-1.96%
-2.01%
54,061 (-22)
66,947 (+109)
5,251 (-22)
1,054 (-22)
5,296 (+89)
97,606 (-22)
202,905 (-22)
56,978 (-22)
98,187 (-22)
36,430 (-22)
1,022 (-22)
1,101 (-22)
5,950 (-22)
-0.04%
+0.16%
-0.42%
-2.04%
+1.71%
-0.02%
-0.01%
-0.04%
-0.02%
-0.06%
-2.11%
-1.96%
-0.37%
54,061 (-22)
66,947 (+109)
5,251 (-22)
1,054 (-22)
5,296 (+89)
97,606 (-22)
202,905 (-22)
56,978 (-22)
98,187 (-22)
36,430 (-22)
1,022 (-22)
1,101 (-22)
6,575 (-22)
-0.04%
+0.16%
-0.42%
-2.04%
+1.71%
-0.02%
-0.01%
-0.04%
-0.02%
-0.06%
-2.11%
-1.96%
-0.33%
54,061 (-22)
79,222 (+109)
9,501 (-22)
1,054 (-22)
9,546 (+89)
97,606 (-22)
202,905 (-22)
56,978 (-22)
98,187 (-22)
39,661 (-22)
1,022 (-22)
1,101 (-22)
9,575 (-22)
-0.04%
+0.14%
-0.23%
-2.04%
+0.94%
-0.02%
-0.01%
-0.04%
-0.02%
-0.06%
-2.11%
-1.96%
-0.23%
1 (0)
2 (0)
2 (0)
1 (0)
4 (0)
1 (0)
1 (0)
2 (0)
1 (0)
2 (0)
1 (0)
2 (0)
4 (0)
DummyBridgehubSetter 3,914,909 (-28,535) addStateTransitionManager
addToken
proveL1ToL2TransactionStatus
proveL2LogInclusion
removeStateTransitionManager
setHyperchain
setPendingAdmin
setSTM
23,875 (0)
24,112 (0)
0 (0)
0 (0)
23,851 (0)
111,406 (0)
26,052 (0)
44,209 (0)
0.00%
0.00%
+∞%
+∞%
0.00%
0.00%
0.00%
0.00%
41,139 (+2)
36,571 (+1)
1,412 (-10)
1,506 (+6)
25,516 (+16)
111,444 (+1)
37,995 (+8)
44,247 (+1)
+0.00%
+0.00%
-0.70%
+0.40%
+0.06%
+0.00%
+0.02%
+0.00%
47,566 (0)
36,844 (0)
999 (+3)
1,111 (0)
25,861 (0)
111,466 (+12)
37,968 (+6)
44,269 (+12)
0.00%
0.00%
+0.30%
0.00%
0.00%
+0.01%
+0.02%
+0.03%
47,566 (0)
47,587 (0)
3,661 (0)
3,888 (-7)
26,318 (0)
111,466 (0)
49,872 (0)
44,269 (0)
0.00%
0.00%
0.00%
-0.18%
0.00%
0.00%
0.00%
0.00%
3,584 (0)
1,536 (0)
512 (0)
512 (0)
2,048 (0)
768 (0)
512 (0)
768 (0)
MerkleTest 468,218 (0) calculateRoot(bytes32[],uint256,bytes32) 606 (0) 0.00% 2,921 (+1) +0.03% 2,943 (0) 0.00% 2,987 (0) 0.00% 261 (0)
MerkleTreeNoSort 534,636 (0) getProof 32,953 (0) 0.00% 33,179 (-2) -0.01% 33,193 (0) 0.00% 33,215 (0) 0.00% 273 (0)
DummyHyperchain 3,204,231 (-12)
DummyStateTransitionManager 3,958,782 (-39,037)
DiamondProxy 1,819,081 (-172,244)
MailboxFacet 3,008,460 (+12)

Copy link

Coverage after merging sb-sync-layer-reorg-stable-sync-2 into kl/sync-layer-reorg will be

88.73%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
../da-contracts/contracts
   RollupL1DAValidator.sol67.11%50%83.33%73.91%134, 137, 137, 137, 139, 170, 172, 25, 25, 25–26, 26, 26, 28, 30–31, 35–36, 59, 61, 61, 61–62, 64
contracts/bridge
   BridgeHelper.sol100%100%100%100%
   L1AssetRouter.sol95.19%89.29%94.87%97.88%137, 152, 209, 229, 274, 327, 379, 514, 531, 552, 735–736, 871
   L1ERC20Bridge.sol100%100%100%100%
   L1NativeTokenVault.sol96.12%97.62%84.62%97.30%252, 257, 45
contracts/bridgehub
   Bridgehub.sol73.02%44.16%83.33%86.33%103, 109, 114, 114, 153, 181, 181–182, 184–185, 185, 185–186, 192–193, 193, 193–194, 194, 194, 196–197, 197, 197–198, 289–291, 293–295, 297, 325, 379–380, 382, 382, 382, 425, 433–434, 437, 437, 437–438, 460, 498, 522–523, 602, 605–606, 610–611, 638–639, 644–645, 673, 678, 93, 98
   MessageRoot.sol91.38%61.54%100%100%156, 162, 69, 76, 94
   STMDeploymentTracker.sol79.49%50%90%94.12%110, 114, 31, 38, 61, 88, 91
contracts/common
   ReentrancyGuard.sol100%100%100%100%
contracts/common/libraries
   DataEncoding.sol80%100%100%66.67%72, 80
   DynamicIncrementalMerkle.sol74.42%100%80%72.22%67–70, 72–74, 76–78
   FullMerkle.sol100%100%100%100%
   L2ContractHelper.sol55.88%30%60%68.42%29, 32–33, 46–47, 47, 47, 49, 49, 49, 56, 86, 90
   Merkle.sol73.85%68.18%75%76.92%52–53, 53, 53–54, 54, 54–55, 55, 55, 57–59, 62, 65, 83
   MessageHashing.sol100%100%100%100%
   SemVer.sol100%100%100%100%
   UncheckedMath.sol100%100%100%100%
   UnsafeBytes.sol100%100%100%100%
contracts/governance
   ChainAdmin.sol22.22%20%33.33%20%16, 28–29, 38, 38, 38, 40, 42–43, 43, 46, 49
   Governance.sol99.07%96.77%100%100%44
contracts/state-transition
   StateTransitionManager.sol72.67%51.52%58.82%85.11%103, 130–132, 136, 189, 232, 239, 257, 263, 270, 282, 289, 296, 304, 311, 319, 326, 339, 341, 407, 421, 424, 439, 444, 463, 73, 78, 84, 84
   TestnetVerifier.sol77.78%66.67%100%75%16, 32
   ValidatorTimelock.sol98.57%100%100%97.67%236
   Verifier.sol89.88%35.71%96.30%90.93%1673–1674, 287–302, 305–308, 311–318, 321–328, 331–332, 335–336, 339, 384–385, 395–396, 406–407, 417–418, 428–429, 444–445, 454, 454–455, 904–905
contracts/state-transition/chain-deps
   DiamondInit.sol88.24%70%100%100%33–37, 63
   DiamondProxy.sol80.77%62.50%100%88.24%16, 16, 16–17, 27
contracts/state-transition/chain-deps/facets
   Admin.sol81.61%54.35%86.36%92.45%107, 119, 119, 119–121, 147, 147, 147–148, 148, 148, 150, 171, 217–218, 220, 233–234, 240, 259–260, 265, 302, 312, 316, 39, 39, 95
   Executor.sol78.44%72.81%81.25%81.61%107, 167, 171–172, 172, 172–173, 173, 173, 184, 184, 188, 188, 188, 206, 220, 231, 234, 279, 279, 279, 282, 285, 287–288, 294–295, 314–317, 319, 36, 368, 368, 368–371, 373, 376, 379–380, 389, 405, 408–409, 411–413, 424–426, 446, 487, 494, 513, 518, 527–528, 579, 604–605
   Getters.sol83.19%66.67%84.09%84.85%104, 107, 113, 116, 127, 130, 172, 223, 229, 233, 64, 79, 84
   Mailbox.sol57.87%47.22%57.14%61.40%107, 115, 131–132, 132, 132, 134–135, 143–145, 156, 167–168, 170–171, 173, 178, 182, 182–184, 184, 184–185, 188, 188, 188, 191, 193–194, 196, 201, 203, 206–207, 212–215, 218–219, 236, 242, 242, 242, 250, 255, 282, 311–312, 389, 400, 406, 52, 52, 545, 545, 545–546, 566, 75, 85
   ZkSyncHyperchainBase.sol82.14%78.57%85.71%85.71%48, 56, 56, 56
contracts/state-transition/data-availability
   CalldataDA.sol100%100%100%100%
   CalldataDAGateway.sol85.71%66.67%100%100%27–28
   RelayedSLDAValidator.sol96.67%83.33%100%100%94
contracts/state-transition/libraries
   Diamond.sol94.81%86.49%100%97.73%110, 112, 114, 116, 119, 184, 294
   LibMap.sol100%100%100%100%
   PriorityQueue.sol100%100%100%100%
   PriorityTree.sol97.62%80%100%100%

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