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: l2-native-token, bridge fixes #811

Merged
merged 50 commits into from
Oct 8, 2024
Merged

Conversation

kelemeno
Copy link
Contributor

@kelemeno kelemeno commented Sep 17, 2024

What ❔

  • some l2 bridge contract fixes
  • reworking l2 foundry tests:
    • previous WETH and ERC20 tests are split, with the shared deployment utils put in _SharedL2ContractL2DeployerUtils and SharedL2ContractDeployer.sol
    • tests are moved to abstract contracts, so they can also be run in l1 tests, for faster foundry.
    • the DeployL1 is split so we can compile for L2, and other small changes, e.g. deployViaCreate2 is modified.
    • adding l2 integration tests for GW

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.

@kelemeno kelemeno changed the base branch from kl/sync-layer-reorg to sync-layer-stable September 28, 2024 16:55
@kelemeno kelemeno changed the base branch from sync-layer-stable to kl/sync-layer-reorg September 28, 2024 16:55
@kelemeno kelemeno changed the base branch from kl/sync-layer-reorg to sync-layer-stable September 28, 2024 16:56
Copy link

github-actions bot commented Oct 1, 2024

Changes to gas cost

Generated at commit: 0a10895ade7c5bdea6bc1bf0c36f2b04ed483dc6, compared to commit: c3030f58e6c13fb523cdc2fa5c095fa2f49c0666

🧾 Summary (100% most significant diffs)

Contract Method Avg (+/-) %
DeployL1Script runForTest +10,464,054 ❌ +132.27%
TransparentUpgradeableProxy allowAdminImplementation
bridgeCheckCounterpartAddress
bridgeRecoverFailedTransfer
bridgehubDeposit
bridgehubDepositBaseToken
claimFailedDeposit
createNewChain
depositLegacyErc20Bridge
finalizeDeposit
finalizeWithdrawal
getERC20Getters
getHyperchain
legacyBridge
nativeTokenVault
paused
protocolVersion
registerEthToken
registerToken
setAllowedData
transferFundsFromSharedBridge
unpause
validatorTimelock
+2 ❌
+67 ❌
-16 ✅
+204 ❌
+15 ❌
+1,944 ❌
+631,602 ❌
+912 ❌
+2,887 ❌
+2,223 ❌
-22 ✅
-2,500 ✅
+22 ❌
+22 ❌
-67 ✅
-387 ✅
+22,177 ❌
+22,174 ❌
-44 ✅
+2,232 ❌
+22 ❌
-625 ✅
+0.00%
+0.86%
-0.02%
+0.23%
+0.02%
+2.28%
+29.42%
+0.59%
+2.24%
+2.03%
-0.18%
-51.59%
+0.50%
+0.70%
-6.42%
-7.31%
+20.91%
+17.28%
-0.08%
+4.53%
+0.07%
-10.50%
Bridgehub ctmAssetIdFromChainId
setAssetHandlerAddress
-188 ✅
+22,166 ❌
-3.69%
+43.23%
L1NativeTokenVault bridgeBurn
bridgeCheckCounterpartAddress
bridgeRecoverFailedTransfer
getERC20Getters
registerEthToken
registerToken
transferFundsFromSharedBridge
+386 ❌
+67 ❌
+37 ❌
-22 ✅
+22,177 ❌
+23,700 ❌
+2,232 ❌
+0.45%
+9.94%
+0.19%
-0.47%
+28.49%
+24.13%
+10.25%
L1AssetRouter assetHandlerAddress
bridgeRecoverFailedTransfer
bridgehubDeposit
bridgehubDepositBaseToken
depositLegacyErc20Bridge
finalizeDeposit
finalizeWithdrawal
setAssetHandlerAddressThisChain
transferFundsToNTV
unpause
+22 ❌
+37 ❌
+204 ❌
+15 ❌
+911 ❌
-621 ✅
+2,223 ❌
+225 ❌
+20 ❌
+22 ❌
+4.32%
+0.11%
+0.34%
+0.03%
+0.68%
-1.29%
+2.70%
+0.57%
+0.24%
+0.25%
DiamondProxy finalizeEthWithdrawal
getProtocolVersion
requestL2Transaction
-117 ✅
-643 ✅
-11 ✅
-0.15%
-6.66%
-0.01%
ChainTypeManager initialize +8,393 ❌ +7.29%
L1Nullifier bridgeRecoverFailedTransfer
claimFailedDeposit
finalizeDeposit
-17 ✅
+1,944 ❌
+2,283 ❌
-0.03%
+3.20%
+3.27%
DummyBridgehubSetter acceptOwnership
baseToken
createNewChain
l2TransactionBaseCost
pause
requestL2TransactionDirect
requestL2TransactionTwoBridges
-67 ✅
+7 ❌
-244 ✅
+22 ❌
+22 ❌
-762 ✅
+3,692 ❌
-0.26%
+0.06%
-0.23%
+1.86%
+0.05%
-0.79%
+2.54%
ChainAdmin setUpgradeTimestamp -73 ✅ -0.16%
MerkleTest calculateRoot(bytes32[],uint256,bytes32) -1 ✅ -0.03%
PermanentRestriction setAllowedData -9 ✅ -0.03%
TestnetERC20Token approve
transfer
-1 ✅
-9 ✅
-0.00%
-0.02%
DummyChainTypeManagerWBH setZKChain +1 ❌ +0.00%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
DeployL1Script 57,720,399 (+1,444,340) runForTest 18,374,972 (+10,464,054) +132.27% 18,374,972 (+10,464,054) +132.27% 18,374,972 (+10,464,054) +132.27% 18,374,972 (+10,464,054) +132.27% 3 (0)
TransparentUpgradeableProxy 644,375 (-202,575) allowAdminImplementation
bridgeCheckCounterpartAddress
bridgeRecoverFailedTransfer
bridgehubDeposit
bridgehubDepositBaseToken
claimFailedDeposit
createNewChain
depositLegacyErc20Bridge
finalizeDeposit
finalizeWithdrawal
getERC20Getters
getHyperchain
legacyBridge
nativeTokenVault
paused
protocolVersion
registerEthToken
registerToken
setAllowedData
setSelectorIsValidated
tokenAddress
transferFundsFromSharedBridge
unpause
validatorTimelock
54,651 (-12)
7,897 (+67)
45,682 (0)
46,736 (+67)
29,946 (0)
49,282 (+1,894)
55,179 (0)
39,966 (+22)
125,069 (+22)
56,800 (0)
11,925 (-22)
2,346 (-2,500)
1,064 (+22)
1,042 (+22)
976 (-67)
1,046 (0)
123,173 (+22,156)
29,007 (0)
55,856 (+429)
54,738 (0)
0 (0)
39,753 (+2,232)
32,075 (+22)
1,075 (0)
-0.02%
+0.86%
0.00%
+0.14%
0.00%
+4.00%
0.00%
+0.06%
+0.02%
0.00%
-0.18%
-51.59%
+2.11%
+2.16%
-6.42%
0.00%
+21.93%
0.00%
+0.77%
0.00%
+∞%
+5.95%
+0.07%
0.00%
54,916 (+2)
7,897 (+67)
88,358 (-16)
88,256 (+204)
84,873 (+15)
87,023 (+1,944)
2,778,137 (+631,602)
155,901 (+912)
131,565 (+2,887)
111,750 (+2,223)
11,925 (-22)
2,346 (-2,500)
4,464 (+22)
3,167 (+22)
976 (-67)
4,909 (-387)
128,218 (+22,177)
150,462 (+22,174)
56,417 (-44)
54,765 (-4)
3,952 (+215)
51,519 (+2,232)
32,075 (+22)
5,325 (-625)
+0.00%
+0.86%
-0.02%
+0.23%
+0.02%
+2.28%
+29.42%
+0.59%
+2.24%
+2.03%
-0.18%
-51.59%
+0.50%
+0.70%
-6.42%
-7.31%
+20.91%
+17.28%
-0.08%
-0.01%
+5.75%
+4.53%
+0.07%
-10.50%
55,035 (0)
7,897 (+67)
98,761 (-22)
89,635 (+1,335)
82,552 (+22)
95,105 (+1,872)
3,304,472 (-226,332)
213,836 (+1,356)
131,565 (+2,887)
126,455 (+22)
11,925 (-22)
2,346 (-2,500)
1,064 (+22)
1,042 (+22)
976 (-67)
1,046 (-4,250)
127,764 (+22,178)
150,918 (+22,200)
56,012 (-84)
54,786 (0)
3,195 (0)
51,308 (+2,232)
32,075 (+22)
5,325 (-1,250)
0.00%
+0.86%
-0.02%
+1.51%
+0.03%
+2.01%
-6.41%
+0.64%
+2.24%
+0.02%
-0.18%
-51.59%
+2.11%
+2.16%
-6.42%
-80.25%
+21.00%
+17.25%
-0.15%
0.00%
0.00%
+4.55%
+0.07%
-19.01%
55,035 (0)
7,897 (+67)
110,227 (-22)
133,917 (-163)
115,495 (+22)
105,788 (+2,138)
3,530,804 (0)
213,901 (+1,356)
138,062 (+5,752)
136,170 (+22)
11,925 (-22)
2,346 (-2,500)
9,564 (+22)
9,542 (+22)
976 (-67)
9,546 (0)
134,895 (+22,178)
158,049 (+22,200)
58,247 (+12)
54,786 (0)
9,695 (0)
62,285 (+2,232)
32,075 (+22)
9,575 (0)
0.00%
+0.86%
-0.02%
-0.12%
+0.02%
+2.06%
0.00%
+0.64%
+4.35%
+0.02%
-0.18%
-51.59%
+0.23%
+0.23%
-6.42%
0.00%
+19.68%
+16.34%
+0.02%
0.00%
0.00%
+3.72%
+0.07%
0.00%
258 (0)
1 (0)
4 (0)
12 (0)
9 (0)
8 (0)
11 (+6)
3 (0)
2 (0)
20 (0)
1 (0)
24 (0)
5 (0)
4 (0)
3 (0)
11 (+7)
880 (0)
881 (0)
257 (0)
258 (0)
3,881 (-525)
5 (0)
1 (0)
4 (0)
Bridgehub 4,283,793 (+3,000) ctmAssetIdFromChainId
setAssetHandlerAddress
4,913 (-188)
73,443 (+22,166)
-3.69%
+43.23%
4,913 (-188)
73,443 (+22,166)
-3.69%
+43.23%
4,913 (-188)
73,443 (+22,166)
-3.69%
+43.23%
4,913 (-188)
73,443 (+22,166)
-3.69%
+43.23%
5 (0)
24 (0)
L1NativeTokenVault 3,323,475 (+167,181) bridgeBurn
bridgeCheckCounterpartAddress
bridgeRecoverFailedTransfer
getERC20Getters
registerEthToken
registerToken
tokenAddress
transferFundsFromSharedBridge
12,777 (+22)
741 (+67)
5,271 (-22)
4,701 (-22)
94,984 (+22,156)
671 (+164)
564 (0)
11,177 (+2,232)
+0.17%
+9.94%
-0.42%
-0.47%
+30.42%
+32.35%
0.00%
+24.95%
85,873 (+386)
741 (+67)
19,401 (+37)
4,701 (-22)
100,029 (+22,177)
121,906 (+23,700)
1,630 (+7)
24,003 (+2,232)
+0.45%
+9.94%
+0.19%
-0.47%
+28.49%
+24.13%
+0.43%
+10.25%
100,649 (-18)
741 (+67)
22,403 (-22)
4,701 (-22)
99,575 (+22,178)
122,358 (+22,200)
2,564 (0)
22,976 (+2,232)
-0.02%
+9.94%
-0.10%
-0.47%
+28.65%
+22.16%
0.00%
+10.76%
100,649 (-18)
741 (+67)
30,029 (+244)
4,701 (-22)
106,706 (+22,178)
129,489 (+22,200)
2,564 (0)
35,852 (+2,232)
-0.02%
+9.94%
+0.82%
-0.47%
+26.24%
+20.69%
0.00%
+6.64%
1,299 (0)
1 (0)
9 (0)
1 (0)
880 (0)
881 (-258)
3,840 (-513)
5 (0)
L1AssetRouter 3,370,691 (+130,736) assetHandlerAddress
bridgeRecoverFailedTransfer
bridgehubDeposit
bridgehubDepositBaseToken
depositLegacyErc20Bridge
finalizeDeposit
finalizeWithdrawal
legacyBridge
nativeTokenVault
paused
setAssetHandlerAddressThisChain
transferFundsToNTV
unpause
531 (+22)
16,785 (-22)
16,556 (+67)
572 (0)
10,298 (+22)
25,913 (+22)
26,129 (0)
436 (+22)
414 (+22)
348 (-67)
29,623 (+21,922)
1,303 (+22)
8,686 (+22)
+4.32%
-0.13%
+0.41%
0.00%
+0.21%
+0.08%
0.00%
+5.31%
+5.61%
-16.14%
+284.66%
+1.72%
+0.25%
531 (+22)
34,703 (+37)
60,867 (+204)
58,170 (+15)
134,498 (+911)
47,646 (-621)
84,650 (+2,223)
1,236 (+22)
914 (+22)
348 (-67)
39,573 (+225)
8,237 (+20)
8,686 (+22)
+4.32%
+0.11%
+0.34%
+0.03%
+0.68%
-1.29%
+2.70%
+1.81%
+2.47%
-16.14%
+0.57%
+0.24%
+0.25%
531 (+22)
36,830 (-22)
59,848 (+1,335)
53,185 (+22)
196,572 (+1,356)
46,675 (-3,655)
99,275 (+22)
436 (+22)
414 (+22)
348 (-67)
39,573 (+9,972)
7,951 (+22)
8,686 (+22)
+4.32%
-0.06%
+2.28%
+0.04%
+0.69%
-7.26%
+0.02%
+5.31%
+5.61%
-16.14%
+33.69%
+0.28%
+0.25%
531 (+22)
44,456 (+244)
113,580 (-138)
90,928 (+22)
196,625 (+1,356)
54,029 (+22)
112,119 (+22)
2,436 (+22)
2,414 (+22)
348 (-67)
49,523 (+22)
32,372 (-18)
8,686 (+22)
+4.32%
+0.55%
-0.12%
+0.02%
+0.69%
+0.04%
+0.02%
+0.91%
+0.92%
-16.14%
+0.04%
-0.06%
+0.25%
512 (0)
9 (0)
12 (0)
9 (0)
3 (0)
14 (0)
20 (0)
5 (0)
4 (0)
3 (0)
156 (-1)
19 (0)
1 (0)
DiamondProxy 2,405,277 (0) finalizeEthWithdrawal
getAdmin
getProtocolVersion
requestL2Transaction
util_setChainId
37,779 (0)
1,146 (0)
5,152 (-4,500)
33,295 (0)
28,944 (0)
0.00%
0.00%
-46.62%
0.00%
0.00%
79,630 (-117)
5,229 (+402)
9,009 (-643)
131,404 (-11)
33,764 (-24)
-0.15%
+8.33%
-6.66%
-0.01%
-0.07%
79,979 (+24)
5,146 (0)
9,652 (0)
170,012 (-36)
33,756 (0)
+0.03%
0.00%
0.00%
-0.02%
0.00%
80,291 (0)
9,646 (0)
9,652 (0)
191,977 (0)
34,128 (0)
0.00%
0.00%
0.00%
0.00%
0.00%
257 (0)
12 (+1)
7 (+1)
771 (0)
519 (0)
ChainTypeManager 3,826,188 (0) createNewChain
initialize
protocolVersion
1,046 (0)
22,764 (0)
418 (0)
0.00%
0.00%
0.00%
3,238,888 (+2,715)
123,572 (+8,393)
1,327 (-91)
+0.08%
+7.29%
-6.42%
3,474,483 (0)
210,092 (+187,328)
418 (-1,000)
0.00%
+822.91%
-70.52%
3,476,483 (0)
228,483 (+18,391)
2,418 (0)
0.00%
+8.75%
0.00%
35 (+6)
81 (+6)
11 (+7)
L1Nullifier 2,584,759 (+4,675) bridgeRecoverFailedTransfer
claimFailedDeposit
finalizeDeposit
14,140 (0)
18,793 (+1,894)
10,085 (0)
0.00%
+11.21%
0.00%
60,618 (-17)
62,681 (+1,944)
72,067 (+2,283)
-0.03%
+3.20%
+3.27%
73,386 (-22)
70,818 (+1,872)
86,961 (+22)
-0.03%
+2.72%
+0.03%
81,562 (-22)
87,475 (+2,138)
114,679 (+5,752)
-0.03%
+2.51%
+5.28%
4 (0)
8 (0)
22 (0)
DummyBridgehubSetter 4,313,059 (+2,990) acceptOwnership
addChainTypeManager
baseToken
createNewChain
l2TransactionBaseCost
owner
pause
proveL1ToL2TransactionStatus
proveL2LogInclusion
proveL2MessageInclusion
removeChainTypeManager
requestL2TransactionDirect
requestL2TransactionTwoBridges
setAddresses
25,513 (-67)
23,895 (0)
3,324 (+22)
28,685 (-828)
1,206 (+22)
430 (+22)
46,850 (+22)
0 (0)
0 (0)
0 (0)
23,832 (0)
33,029 (+9)
31,017 (0)
24,348 (0)
-0.26%
0.00%
+0.67%
-2.81%
+1.86%
+5.39%
+0.05%
+∞%
+∞%
+∞%
0.00%
+0.03%
0.00%
0.00%
25,513 (-67)
44,148 (+1)
12,157 (+7)
107,341 (-244)
1,206 (+22)
1,949 (+22)
46,850 (+22)
1,400 (+7)
1,512 (-35)
1,580 (-28)
25,469 (+4)
95,784 (-762)
149,061 (+3,692)
66,065 (-1)
-0.26%
+0.00%
+0.06%
-0.23%
+1.86%
+1.14%
+0.05%
+0.50%
-2.26%
-1.74%
+0.02%
-0.79%
+2.54%
-0.00%
25,513 (-67)
47,621 (0)
14,324 (0)
36,503 (-6)
1,206 (+22)
2,430 (+22)
46,850 (+22)
985 (-3)
1,100 (-3)
1,194 (-3)
25,832 (0)
74,251 (+204)
58,070 (-684)
71,205 (0)
-0.26%
0.00%
0.00%
-0.02%
+1.86%
+0.91%
+0.05%
-0.30%
-0.27%
-0.25%
0.00%
+0.28%
-1.16%
0.00%
25,513 (-67)
47,621 (0)
18,824 (0)
877,414 (-5,837)
1,206 (+22)
2,430 (+22)
46,850 (+22)
3,639 (+7)
3,873 (0)
4,055 (+7)
26,244 (0)
223,332 (-1,960)
425,603 (+22,110)
91,345 (0)
-0.26%
0.00%
0.00%
-0.66%
+1.86%
+0.91%
+0.05%
+0.19%
0.00%
+0.17%
0.00%
-0.87%
+5.48%
0.00%
34 (0)
6,656 (0)
1,536 (0)
2,560 (0)
256 (0)
1,348 (0)
256 (0)
512 (0)
512 (0)
512 (0)
2,048 (0)
1,024 (0)
1,535 (0)
3,328 (0)
GettersFacet 922,106 (0) getAdmin 375 (0) 0.00% 2,041 (+30) +1.49% 2,375 (0) 0.00% 2,375 (0) 0.00% 12 (+1)
L1GenesisUpgrade 2,678,069 (0) genesisUpgrade 113,912 (0) 0.00% 114,457 (+323) +0.28% 113,912 (0) 0.00% 115,912 (0) 0.00% 33 (+6)
AdminFacet 3,414,210 (0) genesisUpgrade 125,221 (0) 0.00% 125,766 (+323) +0.26% 125,221 (0) 0.00% 127,221 (0) 0.00% 33 (+6)
MailboxFacet 2,743,534 (0) finalizeEthWithdrawal 8,251 (0) 0.00% 52,315 (-123) -0.23% 52,735 (0) 0.00% 52,735 (0) 0.00% 257 (0)
ChainAdmin 784,876 (0) setUpgradeTimestamp 25,361 (0) 0.00% 45,163 (-73) -0.16% 45,339 (-18) -0.04% 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,037 (+11) +0.36% 265 (0)
PermanentRestriction 1,543,705 (0) setAllowedData 27,089 (+271) +1.01% 27,240 (-9) -0.03% 27,089 (0) 0.00% 27,902 (0) 0.00% 257 (0)
DiamondInit 439,771 (0) initialize 22,599 (0) 0.00% 376,535 (+110) +0.03% 378,218 (0) 0.00% 398,118 (0) 0.00% 147 (+9)
TestnetERC20Token 640,427 (0) approve
mint
transfer
24,272 (0)
34,031 (0)
46,377 (0)
0.00%
0.00%
0.00%
46,257 (-1)
61,797 (-1)
46,723 (-9)
-0.00%
-0.00%
-0.02%
46,232 (+12)
68,255 (0)
46,665 (-12)
+0.03%
0.00%
-0.03%
46,568 (0)
68,615 (0)
46,977 (0)
0.00%
0.00%
0.00%
1,527 (0)
1,704 (0)
257 (0)
AccessControlRestriction 1,329,782 (-12) grantRole
setRequiredRoleForCall
setRequiredRoleForFallback
51,166 (0)
48,687 (0)
48,037 (0)
0.00%
0.00%
0.00%
51,395 (+3)
49,925 (-4)
49,374 (+1)
+0.01%
-0.01%
+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)
DummyChainTypeManagerWBH 3,848,191 (0) setZKChain 44,101 (0) 0.00% 44,139 (+1) +0.00% 44,155 (+6) +0.01% 44,161 (0) 0.00% 256 (0)
ReenterL1ERC20Bridge 321,825 (+12)
Governance 987,208 (+24)
ValidatorTimelock 785,839 (-12)
DefaultUpgrade 1,332,845 (+12)
TestExecutorFacet 2,833,342 (+12)

@kelemeno kelemeno changed the title fix: bridge fixes fix: l2-native-token, bridge fixes Oct 4, 2024
Copy link
Collaborator

@StanislavBreadless StanislavBreadless left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, since you have a PR into zksync-era, maybe it makes sense to target sync-layer-stable?

@@ -153,6 +150,11 @@ contract L2AssetRouter is AssetRouterBase, IL2AssetRouter {
}

function withdrawToken(address _l2NativeToken, bytes memory _assetData) public returns (bytes32) {
bytes32 recordedAssetId = INativeTokenVault(L2_NATIVE_TOKEN_VAULT_ADDR).assetId(_l2NativeToken);
bytes32 recordedOriginChainId = INativeTokenVault(L2_NATIVE_TOKEN_VAULT_ADDR).originChainId(recordedAssetId);
if (recordedOriginChainId == L1_CHAIN_ID) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure this is correct, the more correct check is to have != block.chainid check

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, because we will probably want to withdraw tokens that are native to other L2s, and those will be encoded using the new format

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use the simple withdraw() for them, but this is also ok I think

l1-contracts/contracts/bridge/ntv/L1NativeTokenVault.sol Outdated Show resolved Hide resolved
l1-contracts/contracts/bridge/ntv/NativeTokenVault.sol Outdated Show resolved Hide resolved
l1-contracts/contracts/common/L1ContractErrors.sol Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Oct 7, 2024

Coverage after merging kl/l2-native-token into kl/sync-layer-reorg 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,

@kelemeno kelemeno merged commit 53b0283 into kl/sync-layer-reorg Oct 8, 2024
25 checks passed
@kelemeno kelemeno deleted the kl/l2-native-token branch October 8, 2024 08:38
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