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

Limitations for the l2 migrated chain #707

Conversation

StanislavBreadless
Copy link
Collaborator

What ❔

Ensure that the gateway-migrated chain does not certain unneeded abilities

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

Changes to gas cost

Generated at commit: 93160681d57cd80b11e352265522747d3e6af7ff, compared to commit: df1c5c8576133acd9531cbd36987c201e7284926

🧾 Summary (100% most significant diffs)

Contract Method Avg (+/-) %
DummyBridgehubSetter addToken
removeStateTransitionManager
setHyperchain
setSTM
-1 ✅
-9 ✅
+1 ❌
+1 ❌
-0.00%
-0.04%
+0.00%
+0.00%
AdminFacet changeFeeParams
setTokenMultiplier
setTransactionFilterer
+15 ❌
+22 ❌
+15 ❌
+0.17%
+0.08%
+0.12%
DiamondProxy changeFeeParams
setTokenMultiplier
setTransactionFilterer
+15 ❌
+22 ❌
+14 ❌
+0.04%
+0.04%
+0.03%
MerkleTest calculateRoot(bytes32[],uint256,bytes32) 0 ➖ 0.00%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
DummyBridgehubSetter 3,899,764 (0) addStateTransitionManager
addToken
proveL1ToL2TransactionStatus
proveL2LogInclusion
removeStateTransitionManager
setHyperchain
setPendingAdmin
setSTM
23,875 (0)
24,134 (0)
0 (0)
0 (0)
23,863 (+12)
111,406 (0)
26,052 (0)
44,186 (0)
0.00%
0.00%
+∞%
+∞%
+0.05%
0.00%
0.00%
0.00%
41,136 (-2)
36,591 (-1)
1,409 (+4)
1,513 (+7)
25,501 (-9)
111,444 (+1)
37,986 (-9)
44,224 (+1)
-0.00%
-0.00%
+0.28%
+0.46%
-0.04%
+0.00%
-0.02%
+0.00%
47,566 (0)
36,872 (+6)
996 (-9)
1,111 (-3)
25,861 (0)
111,466 (+12)
37,962 (0)
44,246 (+12)
0.00%
+0.02%
-0.90%
-0.27%
0.00%
+0.01%
0.00%
+0.03%
47,566 (0)
47,609 (0)
3,661 (+7)
3,895 (0)
26,318 (0)
111,466 (0)
49,872 (0)
44,246 (0)
0.00%
0.00%
+0.19%
0.00%
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)
AdminFacet 3,282,601 (+64,285) changeFeeParams
setTokenMultiplier
setTransactionFilterer
4,720 (0)
28,877 (+22)
2,686 (0)
0.00%
+0.08%
0.00%
9,027 (+15)
28,877 (+22)
12,591 (+15)
+0.17%
+0.08%
+0.12%
5,039 (+22)
28,877 (+22)
8,994 (+22)
+0.44%
+0.08%
+0.25%
17,323 (+22)
28,877 (+22)
26,094 (+22)
+0.13%
+0.08%
+0.08%
3 (0)
30 (0)
3 (0)
DiamondProxy 2,456,702 (0) changeFeeParams
setTokenMultiplier
setTransactionFilterer
34,064 (0)
57,501 (+22)
31,411 (0)
0.00%
+0.04%
0.00%
38,365 (+15)
57,501 (+22)
41,303 (+14)
+0.04%
+0.04%
+0.03%
34,380 (+22)
57,501 (+22)
37,700 (+22)
+0.06%
+0.04%
+0.06%
46,651 (+22)
57,501 (+22)
54,800 (+22)
+0.05%
+0.04%
+0.04%
3 (0)
30 (0)
3 (0)
MerkleTreeNoSort 534,636 (0) getProof 32,953 (0) 0.00% 33,180 (+1) +0.00% 33,193 (0) 0.00% 33,215 (0) 0.00% 273 (0)
MerkleTest 468,218 (0) calculateRoot(bytes32[],uint256,bytes32) 606 (0) 0.00% 2,922 (0) 0.00% 2,943 (0) 0.00% 2,998 (+11) +0.37% 261 (0)
DummyHyperchain 3,204,243 (+51,601)
MailboxFacet 3,008,460 (+51,679)

Copy link

Coverage after merging sb-limitations-for-the-l2-migrated-chain into kl/sync-layer-reorg will be

89.26%

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.81%89.29%97.37%98.40%129, 144, 201, 258, 311, 363, 498, 515, 536, 719–720, 855
   L1ERC20Bridge.sol100%100%100%100%
   L1NativeTokenVault.sol96.12%97.62%84.62%97.30%252, 257, 45
contracts/bridgehub
   Bridgehub.sol75.61%46.05%85.71%89.63%103, 109, 114, 114, 153, 182–183, 183, 183–184, 184, 184, 186–187, 187, 187–188, 279–282, 284–286, 288, 316, 370–371, 373, 373, 373, 416, 424–425, 428, 428, 428–429, 451, 489, 513–514, 593, 596–597, 601–602, 629–630, 635–636, 664, 669, 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.sol70.48%48.57%57.14%83.33%103, 130–132, 136, 189, 232, 239, 257, 263, 270, 282, 289, 296, 304, 311, 319, 326, 335, 335, 335–336, 349, 351, 417, 431, 434, 449, 454, 473, 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%80
   TransactionValidator.sol97.18%94.12%100%100%

@StanislavBreadless StanislavBreadless merged commit 4c82e7d into kl/sync-layer-reorg Aug 16, 2024
24 checks passed
@StanislavBreadless StanislavBreadless deleted the sb-limitations-for-the-l2-migrated-chain branch August 16, 2024 11:28
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