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

feat: sync layer cleaned up contracts #463

Open
wants to merge 155 commits into
base: kl/custom-asset-bridging
Choose a base branch
from

Conversation

kelemeno
Copy link
Contributor

@kelemeno kelemeno commented May 10, 2024

What ❔

  • in order to provide better migration of hyperchains, we can migrate them through the l1SharedBridge
  • to do this we need to enable general bridging in the L1SharedBridge, and we also need to move the holding of native tokens to their own NativeTokenVault
  • this solution will also later allow to bridge L2 native tokens, as well as other assets.

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 title move things around feat: native token vault, general messaging. May 13, 2024
@kelemeno kelemeno changed the title feat: native token vault, general messaging. feat: cleaner chain migration, native token vault, general bridging via L1SharedBridge May 14, 2024
@kelemeno kelemeno changed the title feat: cleaner chain migration, native token vault, general bridging via L1SharedBridge feat: chain migration via general asseted bridging in L1SharedBridge May 27, 2024
import {IL1DAValidator, L1DAValidatorOutput} from "./IL1DAValidator.sol";

contract ValidiumL1DAValidator is IL1DAValidator {
function checkDA(
Copy link
Collaborator

Choose a reason for hiding this comment

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

docs missing

@@ -72,7 +74,7 @@ contract L1SharedBridge is IL1SharedBridge, ReentrancyGuard, Ownable2StepUpgrade
IL1ERC20Bridge public override legacyBridge;

/// @dev A mapping chainId => bridgeProxy. Used to store the bridge proxy's address, and to see if it has been deployed yet.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we should explain why it's been deprecated

Copy link

Coverage after merging kl/sync-layer-reorg into kl/custom-asset-bridging will be

88.08%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
../da-contracts/contracts
   RollupL1DAValidator.sol69.74%58.33%83.33%73.91%130, 132, 132, 132–133, 135, 25, 25, 25–26, 26, 26, 28, 30–31, 35–36, 91, 94, 94, 94, 96
contracts/bridge
   L1AssetRouter.sol96.66%96.34%97.22%96.69%304, 304–307, 778–781
   L1ERC20Bridge.sol95.24%100%87.50%96.15%247
   L1NativeTokenVault.sol94.56%95.83%80%96.43%272, 277, 53, 53, 53
contracts/bridgehub
   Bridgehub.sol89.01%88.89%80%91.59%127, 172, 268–269, 343, 346, 346, 346, 390, 397, 397, 397–398, 535, 540
   MessageRoot.sol53.73%62.50%50%51.35%101, 135, 135, 135–136, 138, 141, 143, 145, 149–152, 155, 161–162, 164, 164, 164, 166, 64, 64, 64, 97
   STMDeploymentTracker.sol82.86%100%77.78%77.78%137, 93, 95, 98
contracts/common
   ReentrancyGuard.sol100%100%100%100%
contracts/common/libraries
   DynamicIncrementalMerkle.sol100%100%100%100%
   FullMerkle.sol100%100%100%100%
   L2ContractHelper.sol64.71%60%60%68.42%46–47, 47, 47, 49, 49, 49, 56, 86, 90
   Merkle.sol75.38%72.73%75%76.92%52–53, 53, 53–54, 54, 54–55, 55, 55, 57–59, 62, 65
   Messaging.sol50%100%50%50%10
   SemVer.sol100%100%100%100%
   UncheckedMath.sol100%100%100%100%
   UnsafeBytes.sol100%100%100%100%
contracts/governance
   Governance.sol100%100%100%100%
contracts/state-transition
   StateTransitionManager.sol66.09%88.24%43.24%66.99%101–105, 111, 192, 194–195, 200–201, 201, 201, 203–205, 207–208, 237, 242, 257, 262, 267, 276, 281, 287, 293, 299, 305, 311, 320, 320, 320, 322, 335, 408, 89, 96
   TestnetVerifier.sol75%50%100%75%28, 32
   ValidatorTimelock.sol98.61%100%100%97.67%236
   Verifier.sol91.21%92.86%96.30%90.93%1674, 287–302, 305–308, 311–318, 321–328, 331–332, 335–336, 339, 385, 396, 407, 418, 429, 445, 454, 454–455, 905
contracts/state-transition/chain-deps
   DiamondInit.sol100%100%100%100%
   DiamondProxy.sol84.62%75%100%88.24%16, 16, 16–17
contracts/state-transition/chain-deps/facets
   Admin.sol87.72%81.82%80.95%91.51%103, 103, 103–105, 130, 130, 130–131, 131, 131, 133, 154, 203–204, 206, 316
   Executor.sol83.74%88.14%80.65%81.36%164–165, 165, 165–166, 166, 166, 177, 181, 181, 181, 199, 224, 227, 272, 272, 272, 275, 278, 280–281, 287–288, 307–310, 312, 342, 366, 366, 366–369, 371, 374, 377–378, 386, 404–405, 421–422, 442, 509, 524
   Getters.sol84.87%70%86.36%86.15%104, 107, 113, 116, 127, 130, 175, 226, 232, 64, 79, 84
   Mailbox.sol63.13%70%59.26%61.61%100, 108, 124–125, 125, 125, 127–128, 136–138, 148, 160–161, 163–164, 166, 171, 175, 175, 175–177, 177, 177–178, 180, 180, 180, 184, 186–187, 189, 194, 196, 199–200, 205–208, 211–212, 229, 235, 235, 235, 243, 248, 541, 541, 541–542, 68, 78
   ZkSyncHyperchainBase.sol85.71%85.71%85.71%85.71%56, 56, 56
contracts/state-transition/data-availability
   CalldataDA.sol100%100%100%100%
   RelayedSLDAValidator.sol100%100%100%100%
contracts/state-transition/libraries
   Diamond.sol95.07%88.64%100%97.73%112, 114, 116, 119, 287, 289, 294
   LibMap.sol100%100%100%100%
   PriorityQueue.sol100%100%100%100%
   PriorityTree.sol100%100%100%100%
   TransactionValidator.sol100%100%100%100%
contracts/upgrades
   BaseZkSyncUpgrade.sol81.10%86.36%100%74.65%102, 102, 102, 104, 107, 110–111, 122, 122, 122, 124, 127, 130–131, 145–147, 165–167, 246, 246, 246, 279
   BaseZkSyncUpgradeGenesis.sol83.33%100%100%71.43%26, 34, 41, 53, 63, 66
   CustomAssetBridging.sol0%100%0%0%20–21
   DefaultUpgrade.sol100%100%100%100%
   L1GenesisUpgrade.sol100%100%100%100%
contracts/vendor
   AddressAliasHelper.sol100%100%100%100%
deploy-scripts
   Gateway.s.sol100%100%100%100%
   RegisterHyperchain.s.sol88.89%68.75%100%90.91%112, 120, 120, 120–121, 124, 131, 134–135, 143, 209, 235, 235–236

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.

None yet

8 participants