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 token info upon migration #760

Merged

Conversation

StanislavBreadless
Copy link
Collaborator

@StanislavBreadless StanislavBreadless commented Aug 30, 2024

What ❔

  • baseTokenAssetId supported on GW also
  • baseToken() will receive with explicit panic if the asset handelr is not yet there

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

github-actions bot commented Sep 2, 2024

Changes to gas cost

Generated at commit: 6c1935293e6a362a1fc68c6ee698d085c4119f5b, compared to commit: d669a5f2ca0696f393ea86a714f4a8030dadd4b2

🧾 Summary (100% most significant diffs)

Contract Method Avg (+/-) %
MessageRoot addChainBatchRoot
addNewChain
getAggregatedRoot
updateFullTree
+5,679 ❌
+64,260 ❌
+1,122 ❌
+15,715 ❌
+7.89%
+41.78%
+23.22%
+37.65%
DummyBridgehubSetter addTokenAssetId
getHyperchain
l2TransactionBaseCost
setAddresses
setHyperchain
setSTM
stateTransitionManager
+22 ❌
-11 ✅
+11 ❌
-66 ✅
-2 ✅
-2 ✅
-11 ✅
+0.06%
-1.49%
+0.97%
-0.13%
-0.00%
-0.00%
-0.53%
MerkleTest calculateRoot(bytes32[],uint256,bytes32) +1 ❌ +0.03%
DiamondProxy finalizeEthWithdrawal
requestL2Transaction
-1 ✅
-4 ✅
-0.00%
-0.00%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
MessageRoot 1,394,108 (+156,643) addChainBatchRoot
addNewChain
chainRegistered
getAggregatedRoot
updateFullTree
27,646 (+60)
21,837 (0)
489 (+42)
955 (+122)
57,460 (+15,715)
+0.22%
0.00%
+9.40%
+14.65%
+37.65%
77,616 (+5,679)
218,081 (+64,260)
1,489 (+42)
5,955 (+1,122)
57,460 (+15,715)
+7.89%
+41.78%
+2.90%
+23.22%
+37.65%
102,601 (+8,488)
283,496 (+85,680)
1,489 (+42)
5,955 (+1,122)
57,460 (+15,715)
+9.02%
+43.31%
+2.90%
+23.22%
+37.65%
102,601 (+8,488)
283,496 (+85,680)
2,489 (+42)
10,955 (+2,122)
57,460 (+15,715)
+9.02%
+43.31%
+1.72%
+24.02%
+37.65%
3 (0)
4 (0)
6 (0)
2 (0)
1 (0)
DummyBridgehubSetter 4,244,500 (+60,584) addStateTransitionManager
addTokenAssetId
admin
getHyperchain
l2TransactionBaseCost
owner
proveL1ToL2TransactionStatus
proveL2LogInclusion
removeStateTransitionManager
setAddresses
setHyperchain
setPendingAdmin
setSTM
stateTransitionManager
23,857 (0)
24,174 (+22)
435 (-11)
727 (-11)
1,148 (+11)
430 (-11)
0 (0)
0 (0)
23,833 (0)
51,043 (-66)
111,344 (0)
26,003 (0)
44,253 (0)
575 (-11)
0.00%
+0.09%
-2.47%
-1.49%
+0.97%
-2.49%
+∞%
+∞%
0.00%
-0.13%
0.00%
0.00%
0.00%
-1.88%
41,135 (+1)
36,617 (+22)
1,435 (-11)
727 (-11)
1,148 (+11)
1,988 (-11)
1,410 (-4)
1,551 (-5)
25,469 (+2)
51,043 (-66)
111,380 (-2)
41,661 (-1)
44,289 (-2)
2,075 (-11)
+0.00%
+0.06%
-0.76%
-1.49%
+0.97%
-0.55%
-0.28%
-0.32%
+0.01%
-0.13%
-0.00%
-0.00%
-0.00%
-0.53%
47,583 (0)
36,972 (+22)
1,435 (-11)
727 (-11)
1,148 (+11)
2,430 (-11)
1,008 (+6)
1,137 (+9)
25,833 (0)
51,043 (-66)
111,380 (-24)
49,685 (0)
44,289 (-24)
2,575 (-11)
0.00%
+0.06%
-0.76%
-1.49%
+0.97%
-0.45%
+0.60%
+0.80%
0.00%
-0.13%
-0.02%
0.00%
-0.05%
-0.43%
47,583 (0)
47,598 (+22)
2,435 (-11)
727 (-11)
1,148 (+11)
2,430 (-11)
3,674 (+7)
3,929 (+7)
26,245 (0)
51,043 (-66)
111,404 (0)
49,901 (0)
44,313 (0)
2,575 (-11)
0.00%
+0.05%
-0.45%
-1.49%
+0.97%
-0.45%
+0.19%
+0.18%
0.00%
-0.13%
0.00%
0.00%
0.00%
-0.43%
3,584 (0)
1,536 (0)
2,048 (0)
256 (0)
256 (0)
1,314 (0)
512 (0)
512 (0)
2,048 (0)
512 (0)
768 (0)
1,280 (0)
768 (0)
1,024 (0)
MerkleTest 442,705 (-12) calculateRoot(bytes32[],uint256,bytes32) 571 (0) 0.00% 2,931 (+1) +0.03% 2,982 (0) 0.00% 3,037 (+11) +0.36% 265 (0)
MerkleTreeNoSort 534,636 (0) getProof 2,594 (0) 0.00% 32,737 (-2) -0.01% 33,193 (0) 0.00% 33,215 (0) 0.00% 277 (0)
DiamondProxy 2,428,645 (0) finalizeEthWithdrawal
requestL2Transaction
37,779 (0)
33,295 (0)
0.00%
0.00%
76,534 (-1)
130,192 (-4)
-0.00%
-0.00%
77,003 (+12)
167,108 (-24)
+0.02%
-0.01%
77,303 (0)
191,247 (0)
0.00%
0.00%
257 (0)
771 (0)
L1ERC20Bridge 1,109,528 (+12)
DiamondCutTestContract 1,824,527 (+12)
PriorityTreeTest 907,968 (-12)
StateTransitionManager 3,855,371 (-12)
ValidatorTimelock 917,747 (-12)
GenerateForceDeploymentsData 1,313,275 (+62,058)
UtilsFacet 704,752 (+12)

Copy link

github-actions bot commented Sep 2, 2024

Coverage after merging sb-fix-token-info-upon-migration into kl/sync-layer-reorg will be

87.03%

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.sol73.93%38.18%90.91%85.82%104–105, 115–116, 130, 130–131, 133–134, 157, 157, 157–158, 158, 158, 160, 239, 241, 254–255, 261, 278, 289–290, 295, 307, 307, 309, 309, 309, 315, 315, 315–316, 316, 316–318, 318, 318–319, 319, 319–321, 348, 350, 354, 363, 373, 377, 40, 40
   Executor.sol78.32%64.94%92.86%81.37%119–120, 201, 207–208, 208–209, 211, 211–212, 224, 224, 228, 228, 228, 252–253, 270, 273, 319, 319–320, 324, 328, 330–331, 337–338, 357–360, 362, 37, 418, 418, 418–421, 423, 426, 429–430, 447, 450–451, 453–455, 468–470, 531–532, 540–541, 563–564, 574–575, 626–627, 653–654
   Getters.sol81.82%62.50%82.22%83.82%110, 113, 119, 122, 133, 136, 178, 231, 237, 241, 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, 62, 62–63
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%

@StanislavBreadless StanislavBreadless merged commit 3a1aecc into kl/sync-layer-reorg Sep 2, 2024
24 checks passed
@StanislavBreadless StanislavBreadless deleted the sb-fix-token-info-upon-migration branch September 2, 2024 15:14
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.

3 participants