From 3f462aad20013ecedde67d9d077ec8a4134b888f Mon Sep 17 00:00:00 2001 From: Grzegorz Prusak Date: Thu, 3 Oct 2024 14:15:36 +0200 Subject: [PATCH] added documentation for consensus commands --- Cargo.lock | 20 --------- zk_toolbox/Cargo.lock | 28 +++++++----- zk_toolbox/crates/zk_inception/README.md | 57 ++++++++++++++++++++++++ 3 files changed, 73 insertions(+), 32 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0873faae904c..245d4c9223c7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9641,8 +9641,6 @@ dependencies = [ [[package]] name = "zksync_concurrency" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4724d51934e475c846ba9e6ed169e25587385188b928a9ecfbbf616092a1c17" dependencies = [ "anyhow", "once_cell", @@ -9678,8 +9676,6 @@ dependencies = [ [[package]] name = "zksync_consensus_bft" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e7199c07aa14d9c3319839b98ad0496aac6e72327e70ded77ddb66329766db" dependencies = [ "anyhow", "async-trait", @@ -9700,8 +9696,6 @@ dependencies = [ [[package]] name = "zksync_consensus_crypto" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7760e7a140f16f0435fbf2ad9a4b09feaad74568d05b553751d222f4803a42e" dependencies = [ "anyhow", "blst", @@ -9721,8 +9715,6 @@ dependencies = [ [[package]] name = "zksync_consensus_executor" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db07f7329b29737d8fd6860b350c809ae1b56ad53e26a7d0eddf3664ccb9dacb" dependencies = [ "anyhow", "async-trait", @@ -9743,8 +9735,6 @@ dependencies = [ [[package]] name = "zksync_consensus_network" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a89a2d60db1ccd41438d29724a8d0d57fcf9506eb4443ea4b9205fd78c9c8e59" dependencies = [ "anyhow", "async-trait", @@ -9779,8 +9769,6 @@ dependencies = [ [[package]] name = "zksync_consensus_roles" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96f903187836210602beba27655e111e22efb229ef90bd2a95a3d6799b31685c" dependencies = [ "anyhow", "bit-vec", @@ -9801,8 +9789,6 @@ dependencies = [ [[package]] name = "zksync_consensus_storage" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff43cfd03ea205c763e74362dc6ec5a4d74b6b1baef0fb134dde92a8880397f7" dependencies = [ "anyhow", "async-trait", @@ -9821,8 +9807,6 @@ dependencies = [ [[package]] name = "zksync_consensus_utils" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1020308512c01ab80327fb874b5b61c6fd513a6b26c8a5fce3e077600da04e4b" dependencies = [ "anyhow", "rand 0.8.5", @@ -10854,8 +10838,6 @@ dependencies = [ [[package]] name = "zksync_protobuf" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2d9ce9b9697daae6023c8da5cfe8764690a9d9c91ff32b8e1e54a7c8301fb3" dependencies = [ "anyhow", "bit-vec", @@ -10875,8 +10857,6 @@ dependencies = [ [[package]] name = "zksync_protobuf_build" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "903c23a12e160a703f9b68d0dd961daa24156af912ca1bc9efb74969f3acc645" dependencies = [ "anyhow", "heck 0.5.0", diff --git a/zk_toolbox/Cargo.lock b/zk_toolbox/Cargo.lock index 1342f6f58cc6..273c75eb2019 100644 --- a/zk_toolbox/Cargo.lock +++ b/zk_toolbox/Cargo.lock @@ -6780,8 +6780,6 @@ dependencies = [ [[package]] name = "zksync_concurrency" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4724d51934e475c846ba9e6ed169e25587385188b928a9ecfbbf616092a1c17" dependencies = [ "anyhow", "once_cell", @@ -6814,8 +6812,6 @@ dependencies = [ [[package]] name = "zksync_consensus_crypto" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7760e7a140f16f0435fbf2ad9a4b09feaad74568d05b553751d222f4803a42e" dependencies = [ "anyhow", "blst", @@ -6835,8 +6831,6 @@ dependencies = [ [[package]] name = "zksync_consensus_roles" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96f903187836210602beba27655e111e22efb229ef90bd2a95a3d6799b31685c" dependencies = [ "anyhow", "bit-vec", @@ -6857,8 +6851,6 @@ dependencies = [ [[package]] name = "zksync_consensus_utils" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1020308512c01ab80327fb874b5b61c6fd513a6b26c8a5fce3e077600da04e4b" dependencies = [ "anyhow", "rand", @@ -6908,8 +6900,6 @@ dependencies = [ [[package]] name = "zksync_protobuf" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2d9ce9b9697daae6023c8da5cfe8764690a9d9c91ff32b8e1e54a7c8301fb3" dependencies = [ "anyhow", "bit-vec", @@ -6929,8 +6919,6 @@ dependencies = [ [[package]] name = "zksync_protobuf_build" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "903c23a12e160a703f9b68d0dd961daa24156af912ca1bc9efb74969f3acc645" dependencies = [ "anyhow", "heck", @@ -7079,3 +7067,19 @@ dependencies = [ "cc", "pkg-config", ] + +[[patch.unused]] +name = "zksync_consensus_bft" +version = "0.3.0" + +[[patch.unused]] +name = "zksync_consensus_executor" +version = "0.3.0" + +[[patch.unused]] +name = "zksync_consensus_network" +version = "0.3.0" + +[[patch.unused]] +name = "zksync_consensus_storage" +version = "0.3.0" diff --git a/zk_toolbox/crates/zk_inception/README.md b/zk_toolbox/crates/zk_inception/README.md index 904b1421e3a0..f075cf0ba961 100644 --- a/zk_toolbox/crates/zk_inception/README.md +++ b/zk_toolbox/crates/zk_inception/README.md @@ -17,8 +17,12 @@ This document contains the help content for the `zk_inception` command-line prog - [`zk_inception chain initialize-bridges`↴](#zk_inception-chain-initialize-bridges) - [`zk_inception chain deploy-l2-contracts`↴](#zk_inception-chain-deploy-l2-contracts) - [`zk_inception chain upgrader`↴](#zk_inception-chain-upgrader) +- [`zk_inception chain deploy-consensus-registry`↴](#zk_inception-chain-deploy-consensus-registry) +- [`zk_inception chain deploy-multicall3`↴](#zk_inception-chain-deploy-multicall3) - [`zk_inception chain deploy-paymaster`↴](#zk_inception-chain-deploy-paymaster) - [`zk_inception chain update-token-multiplier-setter`↴](#zk_inception-chain-update-token-multiplier-setter) +- [`zk_inception consensus set-attester-committee`↴](#zk_inception-consensus-set-attester-committee) +- [`zk_inception consensus get-attester-committee`↴](#zk_inception-consensus-get-attester-committee) - [`zk_inception prover`↴](#zk_inception-prover) - [`zk_inception prover init`↴](#zk_inception-prover-init) - [`zk_inception prover setup-keys`↴](#zk_inception-prover-setup-keys) @@ -364,6 +368,18 @@ Deploy Default Upgrader e.g.: `zk_inception init -a --private-key=` +## `zk_inception chain deploy-consensus-registry` + +Deploy Consensus Registry smart contract + +**Usage:** `zk_inception chain deploy-consensus-registry` + +## `zk_inception chain deploy-multicall3` + +Deploy Multicall3 smart contract + +**Usage:** `zk_inception chain deploy-multicall3` + ## `zk_inception chain deploy-paymaster` Deploy paymaster smart contract @@ -414,6 +430,47 @@ Update Token Multiplier Setter address on L1 e.g.: `zk_inception init -a --private-key=` +## `zk_inception consensus` + +Consensus related commands + +**Usage:** `zk_inception consensus ` + +###### **Subcommands:** + +- `set-attester-committee` — Set attester committee +- `get-attester-committee` — Get attester committee + +## `zk_inception consensus set-attester-committee` + +Set attester committee in the consensus registry smart contract. +Requires `consensus_registry` and `multicall3` contracts to be deployed. + +**Usage:** `zk_inception consensus set-attester-committee [OPTIONS]` + +###### **Options:** + +- `--from-genesis` — Set attester committee to `consensus.genesis\_spec.attesters` in general.yaml + Mutually exclusive with `--from-file`. +- `--from-file ` — Set attester committee to committee specified in yaml file at `PATH`. + Mutually exclusive with `--from-genesis`. + File format is specified in `zk_inception/src/commands/consensus/proto/mod.proto`. + Example: + ```yaml + attesters: + - key: attester:public:secp256k1:0339d4b0cdd9896d3929631a4e5e9a5b4919f52592bec571d70bb0e50a3a824714 + weight: 1 + - key: attester:public:secp256k1:024897d8c10d7a57d108cfe2a724d7824c657f219ef5d9f7674810a6746c19fa7b + weight: 1 + ``` + +## `zk_inception consensus get-attester-committee` + +Requires `consensus_registry` and `multicall3` contracts to be deployed. +Fetches attester committee from the consensus registry contract and prints it. + +**Usage:** `zk_inception consensus get-attester-committee` + ## `zk_inception prover` Prover related commands