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

Resolve some of the leftover todos #765

Merged
merged 18 commits into from
Sep 5, 2024

Conversation

StanislavBreadless
Copy link
Collaborator

@StanislavBreadless StanislavBreadless commented Sep 3, 2024

What ❔

  • Additional protection for GW->L1 migration
  • Fix some todos
  • Add tests for L2 DA contracts + uncomment old L1Messenger tests

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 StanislavBreadless requested review from kelemeno and removed request for vladbochok September 3, 2024 14:01
Copy link

github-actions bot commented Sep 4, 2024

Changes to gas cost

Generated at commit: 2446fb9bc5961a7e956501f1f52c1de1e4d40407, compared to commit: 213f990a1c07a709155d8bf93a21a4892755ba40

🧾 Summary (100% most significant diffs)

Contract Method Avg (+/-) %
Utils encodePacked -5,541 ✅ -27.74%
TestExecutor commitBatchesSharedBridge -970 ✅ -3.31%
DiamondProxy requestL2Transaction -4 ✅ -0.00%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
Utils 4,609,806 (-26,635) encodePacked 14,431 (-5,541) -27.74% 14,431 (-5,541) -27.74% 14,431 (-5,541) -27.74% 14,431 (-5,541) -27.74% 52 (0)
TestExecutor 2,454,138 (+7,810) commitBatchesSharedBridge 7,997 (0) 0.00% 28,364 (-970) -3.31% 28,029 (-1,457) -4.94% 44,376 (-1,427) -3.12% 15 (0)
DiamondProxy 2,428,633 (0) commitBatchesSharedBridge
finalizeEthWithdrawal
requestL2Transaction
util_setChainId
0 (0)
37,779 (0)
33,295 (0)
29,011 (0)
+∞%
0.00%
0.00%
0.00%
33,665 (-1,066)
76,035 (-745)
130,191 (-4)
33,845 (+4)
-3.07%
-0.97%
-0.00%
+0.01%
21,361 (0)
76,979 (0)
167,084 (-12)
33,823 (0)
0.00%
0.00%
-0.01%
0.00%
88,202 (-2,579)
77,303 (0)
191,247 (0)
34,195 (0)
-2.84%
0.00%
0.00%
0.00%
30 (0)
257 (0)
771 (0)
519 (0)
DummyBridgehubSetter 4,244,500 (-12) addStateTransitionManager
proveL1ToL2TransactionStatus
proveL2LogInclusion
removeStateTransitionManager
setPendingAdmin
23,857 (0)
0 (0)
0 (0)
23,833 (0)
26,003 (0)
0.00%
+∞%
+∞%
0.00%
0.00%
41,133 (-6)
1,423 (+18)
1,544 (+27)
25,467 (-1)
41,667 (-1)
-0.01%
+1.28%
+1.78%
-0.00%
-0.00%
47,583 (0)
1,002 (0)
1,131 (+3)
25,833 (0)
49,685 (0)
0.00%
0.00%
+0.27%
0.00%
0.00%
47,583 (0)
3,674 (0)
3,908 (-14)
26,245 (0)
49,901 (0)
0.00%
0.00%
-0.36%
0.00%
0.00%
3,584 (0)
512 (0)
512 (0)
2,048 (0)
1,280 (0)
MailboxFacet 3,004,808 (0) finalizeEthWithdrawal 8,251 (0) 0.00% 48,722 (-740) -1.50% 49,747 (0) 0.00% 49,747 (0) 0.00% 257 (0)
MerkleTest 442,717 (0) calculateRoot(bytes32[],uint256,bytes32) 571 (0) 0.00% 2,930 (+1) +0.03% 2,982 (0) 0.00% 3,037 (0) 0.00% 265 (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)
AdminFacet 3,414,210 (+26,089)

Copy link

github-actions bot commented Sep 4, 2024

Coverage after merging sb-set-of-fixes-3 into kl/sync-layer-reorg will be

86.94%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
../da-contracts/contracts
   RollupL1DAValidator.sol61.04%31.25%83.33%67.27%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, 80, 80–81
contracts/bridge
   BridgeHelper.sol100%100%100%100%
   L1AssetRouter.sol93.95%85.07%94.87%96.63%139–140, 155–156, 216, 236, 285, 338, 390, 550, 571, 613, 732–733, 754–755, 896
   L1ERC20Bridge.sol97.50%100%100%96.55%116
   L1NativeTokenVault.sol92.31%93.33%78.57%94.19%175–176, 256, 284, 289, 46–47
contracts/bridgehub
   Bridgehub.sol66.67%35.90%77.50%77.13%111, 111, 111, 116, 122, 127, 132, 164–165, 208, 208–209, 211–212, 212, 212–213, 219–220, 220, 220–221, 221, 221, 223–224, 224, 224–225, 233–234, 248–249, 296–297, 327–328, 330–331, 333–335, 337–338, 341–342, 345, 347–348, 350–351, 378–379, 389–390, 394, 394–395, 397, 425, 449–451, 454, 454–455, 499, 507–509, 513, 513–514, 516, 530–531, 543–544, 583, 607–608, 687, 690–691, 695–696, 724–725, 738, 783, 788, 793, 798
   MessageRoot.sol91.07%63.64%100%96.97%116–117, 148, 69, 87
   STMDeploymentTracker.sol79.07%50%90%94.74%115, 119, 34, 41, 64, 91, 94, 96
contracts/common
   ReentrancyGuard.sol90%66.67%100%92.86%78–79
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.sol47.06%0%60%54.17%100, 104, 29–30, 35–36, 39–40, 54, 56, 56–57, 61, 61–62, 70
   Merkle.sol96.61%90.91%100%97.67%80–81
   MessageHashing.sol100%100%100%100%
   SemVer.sol100%100%100%100%
   UncheckedMath.sol100%100%100%100%
   UnsafeBytes.sol100%100%100%100%
contracts/governance
   ChainAdmin.sol17.86%0%20%21.05%27–28, 39–40, 47–48, 56, 56–57, 60, 62–63, 63, 66, 69, 78, 78–79, 81
   Governance.sol98.15%94.74%100%98.55%44–45
contracts/state-transition
   StateTransitionManager.sol66.88%33.33%58.82%77.45%108, 137–138, 140–141, 143–144, 146–147, 202–203, 247, 254, 272, 278, 285, 297, 304, 311, 319, 326, 334, 341, 359, 361, 426, 445, 445, 445, 448, 448, 448, 450, 463, 468, 493, 74, 87–88
   TestnetVerifier.sol77.78%66.67%100%75%16, 32
   ValidatorTimelock.sol95.38%83.33%100%95.45%210, 83–84
   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.sol78%45.45%100%86.49%39–40, 42–43, 45–46, 48–49, 51–52, 77
   DiamondProxy.sol92.31%75%100%100%16, 27
contracts/state-transition/chain-deps/facets
   Admin.sol72.69%36.21%90.91%85.29%104–105, 115–116, 130, 130–131, 133–134, 157, 157, 157–158, 158, 158, 160, 239, 241, 254–255, 261, 263, 266, 266, 266, 284, 295–296, 301, 313, 313, 315, 315, 315, 321, 321, 321–322, 322, 322–324, 324, 324–325, 325, 325–327, 354, 356, 360, 369, 379, 383, 40, 40
   Executor.sol75.64%55.84%92.86%80.68%119–120, 172, 177, 182, 187, 192, 197, 201–202, 207, 207–208, 208–209, 211, 211–212, 222–224, 226, 226–227, 251–252, 269, 272, 318, 318–319, 323, 327, 329–330, 336–337, 356–359, 361, 37, 417, 417, 417–420, 422, 425, 428–429, 446, 449–450, 452–454, 467–469, 530–531, 539–540, 562–563, 573–574, 625–626, 652–653
   Getters.sol81.82%62.50%82.22%83.82%110, 113, 119, 122, 133, 136, 178, 231, 236, 240, 65, 70, 85, 90
   Mailbox.sol82.27%70.59%89.66%83.57%153, 188, 198, 207–208, 233, 237, 237, 237, 240, 242–243, 245, 250, 252, 255–257, 262–265, 267–268, 274, 274, 274, 276, 279–280, 374–375, 54
   ZkSyncHyperchainBase.sol71.43%71.43%71.43%71.43%55, 55–56,

@StanislavBreadless StanislavBreadless merged commit 566a54b into kl/sync-layer-reorg Sep 5, 2024
24 checks passed
@StanislavBreadless StanislavBreadless deleted the sb-set-of-fixes-3 branch September 5, 2024 09:44
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