-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(zk_toolbox): Deploy ConsensusRegistry (BFT-504) (#2713)
## What ❔ Adds a `zk_inception chain deploy-consensus-registry` command. TODO: - [x] Change `contracts` submodule back to `main` once matter-labs/era-contracts#735 is merged ### Contract Owner The agreement was that on testnet the `ConsensusRegistry` contract should be owned by the governor account, which is 0xD64e136566a9E04eb05B30184fF577F52682D182, while on mainnet it should be owned by the [developer multisig account](https://app.safe.global/transactions/queue?safe=eth:0x9e543149DdfEEE18e95A4655D07096398Dd2Bf52). The owner is set in [DeployL2ContractsInput::consensus_registry_owner](https://github.com/matter-labs/zksync-era/blob/f4b7c12431d4bb063c735947f74e30c749119b5f/zk_toolbox/crates/config/src/forge_interface/deploy_l2_contracts/input.rs#L19) which has access to contract and wallet configuration and these are written to a config file just before deployment. ~~I added an optional `developer_multisig` wallet to `WalletConfig`, so the address can be added at the same place as the `governor` address is; if `developer_multisig` is missing then `governor` is used. I suppose it could be made part of the `ContractsConfig` instead, but since this is a wallet with funds that developers can access, I thought it wouldn't be out of place in `wallets.yaml` even if one doesn't have any of the corresponding private keys. Let me know if I should be using something else.~~ ### Testing Since the `zk_toolbox` is replacing the `zk` commands, and `zk init` doesn't deploy the consensus registry, we have to use the following commands to see that the contract is built, deployed and its address is written to the config file: ```shell ./bin/zkt zk_inception ecosystem create zk_inception containers zk_inception ecosystem init --dev ``` After this we can check if we see the address in the generated config file: ```console ❯ cat ./chains/era/configs/contracts.yaml | yq .l2.consensus_registry 0x72ada8c211f45e768c9a7781793da84daf1d0d1b ``` Finally clean up: ```shell zk_supervisor clean all ``` ## Why ❔ So that we can deploy the L2 consensus registry contract using the `zk_toolbox`. ## Checklist <!-- Check your PR fulfills the following items. --> <!-- For draft PRs check the boxes as you complete them. --> - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [x] Tests for the changes have been added / updated. - [x] Documentation comments have been added / updated. - [x] Code has been formatted via `zk fmt` and `zk lint`. --------- Co-authored-by: Grzegorz Prusak <pompon.pompon@gmail.com>
- Loading branch information
Showing
6 changed files
with
106 additions
and
42 deletions.
There are no files selected for viewing
Submodule contracts
updated
13 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters