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(zk_toolbox): Deploy ConsensusRegistry (BFT-504) #2713

Merged
merged 13 commits into from
Sep 6, 2024

Conversation

aakoshh
Copy link
Contributor

@aakoshh aakoshh commented Aug 22, 2024

What ❔

Adds a zk_inception chain deploy-consensus-registry command.

TODO:

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.

The owner is set in DeployL2ContractsInput::consensus_registry_owner 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:

./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:

cat ./chains/era/configs/contracts.yaml | yq .l2.consensus_registry
0x72ada8c211f45e768c9a7781793da84daf1d0d1b

Finally clean up:

zk_supervisor clean all

Why ❔

So that we can deploy the L2 consensus registry contract using the zk_toolbox.

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.
  • Code has been formatted via zk fmt and zk lint.

@aakoshh aakoshh force-pushed the bft-504-deploy-cons-reg branch from 988caa6 to 418ea7e Compare August 22, 2024 15:34
@aakoshh aakoshh requested a review from Deniallugo August 22, 2024 16:12
@aakoshh aakoshh force-pushed the bft-504-deploy-cons-reg branch from f4b7c12 to 5f82aea Compare August 22, 2024 16:17
@aakoshh aakoshh requested a review from RomanBrodetski August 22, 2024 16:22
contracts Outdated Show resolved Hide resolved
zk_toolbox/crates/config/src/wallets.rs Outdated Show resolved Hide resolved
Deniallugo
Deniallugo previously approved these changes Aug 27, 2024
@aakoshh aakoshh force-pushed the bft-504-deploy-cons-reg branch from 7d9cd7e to 24d73bd Compare September 2, 2024 17:30
@aakoshh aakoshh requested a review from Deniallugo September 2, 2024 17:37
@brunoffranca brunoffranca added this pull request to the merge queue Sep 4, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 4, 2024
@pompon0 pompon0 added this pull request to the merge queue Sep 4, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 4, 2024
@pompon0 pompon0 added this pull request to the merge queue Sep 4, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 4, 2024
@pompon0 pompon0 added this pull request to the merge queue Sep 4, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 4, 2024
@pompon0 pompon0 added this pull request to the merge queue Sep 4, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 4, 2024
@pompon0 pompon0 enabled auto-merge September 5, 2024 05:28
@pompon0 pompon0 added this pull request to the merge queue Sep 5, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 5, 2024
@pompon0 pompon0 added this pull request to the merge queue Sep 5, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 5, 2024
@pompon0 pompon0 added this pull request to the merge queue Sep 5, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 5, 2024
@pompon0 pompon0 added this pull request to the merge queue Sep 5, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 5, 2024
@pompon0 pompon0 added this pull request to the merge queue Sep 5, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 5, 2024
@pompon0 pompon0 added this pull request to the merge queue Sep 5, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Sep 5, 2024
@pompon0 pompon0 added this pull request to the merge queue Sep 5, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 5, 2024
@pompon0 pompon0 enabled auto-merge September 5, 2024 14:17
@pompon0 pompon0 added this pull request to the merge queue Sep 6, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 6, 2024
@pompon0 pompon0 added this pull request to the merge queue Sep 6, 2024
Merged via the queue into main with commit cab13b8 Sep 6, 2024
52 of 53 checks passed
@pompon0 pompon0 deleted the bft-504-deploy-cons-reg branch September 6, 2024 09:08
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.

4 participants