From 448ad585aa4d25188489f93c6a878444e2f5b570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Fran=C3=A7a?= Date: Thu, 28 Nov 2024 19:40:15 +0000 Subject: [PATCH 1/2] update docs --- .../guides/advanced/16_decentralization.md | 151 +++++++++++++----- 1 file changed, 110 insertions(+), 41 deletions(-) diff --git a/docs/src/guides/advanced/16_decentralization.md b/docs/src/guides/advanced/16_decentralization.md index a5f889a813d0..ab92f3c5f43a 100644 --- a/docs/src/guides/advanced/16_decentralization.md +++ b/docs/src/guides/advanced/16_decentralization.md @@ -8,13 +8,60 @@ and enabled as follows: Run the following to generate consensus secrets: ``` -docker run --entrypoint /usr/bin/zksync_external_node "matterlabs/external-node:2.0-v25.0.0" generate-secrets > consensus_secrets.yaml -chmod 600 consensus_secrets.yaml +docker run --entrypoint /usr/bin/zksync_external_node "matterlabs/external-node:2.0-v25.0.0" generate-secrets +``` + +That will output something like this (but with different keys obviously): + +``` +#validator:public:bls12_381:84fe19a96b6443ca7ce...98dec0870f6d8aa95c8164102f0d62e4c47e3566c4e5c32354d +validator_key: validator:secret:bls12_381:1de85683e6decbfcf6c12aa42a5c8bfa98d7ae796dee068ae73dc784a58f5213 +# attester:public:secp256k1:02e262af8c97536b9e479c6d60f213920e759faf4086d8352e98bc25d06b4142e3 +attester_key: attester:secret:secp256k1:1111eb31c2389613f3ceb4288eadda35780e98df4cabb2b7663882262f72e422 +# node:public:ed25519:acb7e350cf53e3b4c2042e2c8044734384cee51f58a0fa052fd7e0c9c3f4b20d +node_key: node:secret:ed25519:0effb1d7c335d23606f656ca1ba87566144d5af2984bd7486379d4f83a204ba2 +``` + +You then have two different paths depending if your main node is using file-based or env-based configuration. + +## Configuring consensus + +### File-based configuration + +If you are using the recommended file-based configuration then you'll need to add the following information to your `general.yaml` config file (see [Ecosystem Configuration](../launch.md#ecosystem-configuration)): + +```yaml +consensus: + server_addr: '0.0.0.0:3054' + public_addr: + # Address under which the node is accessible to the other nodes. + # It can be a public domain, like `example.com:3054`, in case the main node is accessible from the internet, + # or it can be a kubernetes cluster domain, like `server-v2-core..svc.cluster.local:3054` in + # case the main node should be only accessible within the cluster. + debug_page_addr: '0.0.0.0:5000' + max_payload_size: 3200000 + gossip_dynamic_inbound_limit: 10 + genesis_spec: + chain_id: ??? # chain id + protocol_version: 1 # consensus protocol version + validators: + - key: validator:public:??? # public key of the main node (copy this PUBLIC key from the secrets you generated) + weight: 1 + leader: validator:public:??? # same as above - main node will be the only validator and the only leader. +``` + +And the secrets you generated to your `secrets.yaml` config file: + +```yaml +consensus: + validator_key: validator:secret:??? + attester_key: attester:secret:??? + node_key: node:secret:??? ``` -## Preparing the consensus config +### Env-based configuration -Create `consensus_config.yaml` file with the following content (remember to replace the placeholders): +If you are using the env-based configuration you'll need to create a `consensus_config.yaml` file with the following content: ```yaml server_addr: '0.0.0.0:3054' @@ -27,52 +74,70 @@ debug_page_addr: '0.0.0.0:5000' max_payload_size: 3200000 gossip_dynamic_inbound_limit: 10 genesis_spec: - chain_id: # chain id + chain_id: ??? # chain id protocol_version: 1 # consensus protocol version validators: - - key: validator:public:??? # public key of the main node (copy this PUBLIC key from consensus_secrets.yaml) + - key: validator:public:??? # public key of the main node (copy this PUBLIC key from the secrets you generated) weight: 1 leader: validator:public:??? # same as above - main node will be the only validator and the only leader. ``` -## Providing the configuration to the `zksync_server` +And a `consensus_secrets.yaml` file with the with the secrets you generated previously: -To enable consensus component for the main node you need to append -`--components=,consensus` to the `zksync_server` command line arguments. -In addition to that, you need to provide the configuration (from the files `consensus_config.yaml` and -`consensus_secrets.yaml` that we have just prepared) to the `zksync_server` binary. There are 2 ways (hopefully not for -long) to achieve that: +```yaml +validator_key: validator:secret:??? +attester_key: attester:secret:??? +node_key: node:secret:??? +``` + +Don't forget to set secure permissions to it: + +``` +chmod 600 consensus_secrets.yaml +``` -- In file-based configuration system, the consensus config is embedded in the - [general config](https://github.com/matter-labs/zksync-era/blob/1edcabe0c6a02d5b6700c29c0d9f6220ec6fb03c/core/lib/config/src/configs/general.rs#L58), - and the consensus secrets are embedded in the - [secrets config](https://github.com/matter-labs/zksync-era/blob/main/core/bin/zksync_server/src/main.rs). Paste the - content of the generated `consensus_secrets.yaml` file to the `secrets` config, and prepared config to the `general` - config. +Then you'll need to pass the paths to these files as env vars `CONSENSUS_CONFIG_PATH` and `CONSENSUS_SECRETS_PATH`. -- In env-var-based configuration system, the consensus config and consensus secrets files are passed as standalone - files. The paths to these files need to be passed as env vars `CONSENSUS_CONFIG_PATH` and `CONSENSUS_SECRETS_PATH`. +## Running the `zksync_server` + +Finally, to enable the consensus component for the main node you just need to append +`--components=,consensus` to the `zksync_server` command line arguments. ## Gitops repo config -If you are using the matterlabs gitops repo to configure the main node, it is even more complicated because the -`consensus_config.yaml` file is rendered from a helm chart. See the -[example](https://github.com/matter-labs/gitops-kubernetes/blob/main/apps/environments/mainnet2/server-v2/server-v2-core.yaml), -to see where you have to paste the content of the `consensus_config.yaml` file. +If you are using the matterlabs gitops repo to configure the main node, you'll need to add this information to your kubernetes config for the core server, `server-v2-core.yaml` file (see [example](https://github.com/matter-labs/gitops-kubernetes/blob/177dcd575c6ab446e70b9a9ced8024766095b516/apps/environments/era-stage-proofs/server-v2/server-v2-core.yaml#L23-L35)): + +```yaml +spec: + values: + args: + - --components=state_keeper,consensus + service: + main: + ports: + consensus: + enabled: true + port: 3054 +``` +Then again you have two paths depending if the deployment is using file-based or env-based configuration. Although by default you should be using file-based configuration. + +### File-based configuration -You need to embed the `consensus_secrets.yaml` file into a kubernetes config: +Just like before you'll add the consensus config information to the `general.yaml` config file (see [example](https://github.com/matter-labs/gitops-kubernetes/blob/177dcd575c6ab446e70b9a9ced8024766095b516/apps/environments/era-stage-proofs/server-v2-config/general.yaml#L353-L368)). + +And the secrets you generated to your whatever secrets managing system you are using (see an example [here](https://github.com/matter-labs/gitops-kubernetes/blob/177dcd575c6ab446e70b9a9ced8024766095b516/apps/clusters/era-stage-proofs/stage2/secrets/server-v2-secrets.yaml) using SOPS). ```yaml -apiVersion: v1 -kind: Secret -metadata: - name: consensus-secrets -type: Opaque -stringData: - .consensus_secrets.yaml: +consensus: + validator_key: validator:secret:??? + attester_key: attester:secret:??? + node_key: node:secret:??? ``` +### Env-based configuration -You need to add the following sections to your kubernetes config for the core server: +It is even more complicated because the `consensus_config.yaml` file is rendered from a helm chart. See the [example](https://github.com/matter-labs/gitops-kubernetes/blob/177dcd575c6ab446e70b9a9ced8024766095b516/apps/environments/mainnet2/server-v2/server-v2-core.yaml#L37-L92), to see where you have to paste the content of the `consensus_config.yaml` file. + +You also need to add the following sections to your `server-v2-core.yaml` file: ```yaml spec: @@ -83,14 +148,6 @@ spec: enabled: true type: secret mountPath: '/etc/consensus_secrets/' - args: - - --components=state_keeper,consensus - service: - main: - ports: - consensus: - enabled: true - port: 3054 configMap: consensus: enabled: true @@ -102,3 +159,15 @@ spec: - name: CONSENSUS_SECRETS_PATH value: /etc/consensus_secrets/.consensus_secrets.yaml ``` + +You need to embed the `consensus_secrets.yaml` file into a kubernetes config (see how to do it [here](https://github.com/matter-labs/gitops-kubernetes/blob/177dcd575c6ab446e70b9a9ced8024766095b516/apps/environments/mainnet2/zksync-v2-secret/kustomization.yaml#L3-L4) and [here](https://github.com/matter-labs/gitops-kubernetes/blob/177dcd575c6ab446e70b9a9ced8024766095b516/apps/environments/mainnet2/zksync-v2-secret/consensus_secrets.yaml)): + +```yaml +apiVersion: v1 +kind: Secret +metadata: + name: consensus-secrets +type: Opaque +stringData: + .consensus_secrets.yaml: +``` From e953e8ad27ce290f5920d5456e0afaa068df1f45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Fran=C3=A7a?= Date: Thu, 28 Nov 2024 22:52:05 +0000 Subject: [PATCH 2/2] fmt --- core/bin/snapshots_creator/README.md | 9 ++--- core/lib/merkle_tree/README.md | 6 +-- core/tests/recovery-test/src/index.ts | 5 ++- core/tests/ts-integration/src/l1-provider.ts | 5 ++- .../ts-integration/src/retry-provider.ts | 5 ++- core/tests/ts-integration/src/utils.ts | 6 ++- .../ts-integration/tests/api/web3.test.ts | 5 ++- .../tests/ts-integration/tests/system.test.ts | 8 ++-- core/tests/upgrade-test/tests/utils.ts | 28 +++++++++----- docs/src/guides/advanced/13_zk_intuition.md | 16 ++++---- .../guides/advanced/16_decentralization.md | 37 +++++++++++++------ package.json | 4 +- prover/crates/bin/prover_cli/README.md | 4 +- yarn.lock | 36 ++++-------------- 14 files changed, 97 insertions(+), 77 deletions(-) diff --git a/core/bin/snapshots_creator/README.md b/core/bin/snapshots_creator/README.md index 26ebbb6d652a..31d9cc09210f 100644 --- a/core/bin/snapshots_creator/README.md +++ b/core/bin/snapshots_creator/README.md @@ -43,9 +43,8 @@ repository root. The storage location can be configured using the object store c filesystem, or Google Cloud Storage (GCS). Beware that for end-to-end testing of snapshot recovery, changes applied to the main node configuration must be reflected in the external node configuration. -Creating a snapshot is a part of the [snapshot recovery integration test]. You can run the test using -`yarn recovery-test snapshot-recovery-test`. It requires the main node to be launched with a command like -`zk server --components api,tree,eth,state_keeper,commitment_generator`. +Creating a snapshot is a part of the [snapshot recovery integration test]. You can run the test using `yarn recovery-test snapshot-recovery-test`. +It requires the main node to be launched with a command like `zk server --components api,tree,eth,state_keeper,commitment_generator`. ## Snapshots format @@ -59,8 +58,8 @@ Each snapshot consists of three types of data (see [`snapshots.rs`] for exact de enumeration index; both are used to restore the contents of the `initial_writes` table. Chunking storage logs is motivated by their parallel generation; each chunk corresponds to a distinct non-overlapping range of hashed storage keys. (This should be considered an implementation detail for the purposes of snapshot recovery; recovery must not - rely on any particular key distribution among chunks.) Stored as gzipped Protobuf messages in an [object store]; each - chunk is a separate object. + rely on any particular key distribution among chunks.) Stored as gzipped Protobuf messages in an [object store]; each chunk + is a separate object. - **Factory dependencies:** All bytecodes deployed on L2 at the time the snapshot is made. Stored as a single gzipped Protobuf message in an object store. diff --git a/core/lib/merkle_tree/README.md b/core/lib/merkle_tree/README.md index b3c8a31c9980..ed31ac4cbf80 100644 --- a/core/lib/merkle_tree/README.md +++ b/core/lib/merkle_tree/README.md @@ -1,8 +1,8 @@ # Merkle Tree -Binary Merkle tree implementation based on amortized radix-16 Merkle tree (AR16MT) described in the [Jellyfish Merkle -tree] white paper. Unlike Jellyfish Merkle tree, our construction uses vanilla binary tree hashing algorithm to make it -easier for the circuit creation. The depth of the tree is 256, and Blake2 is used as the hashing function. +Binary Merkle tree implementation based on amortized radix-16 Merkle tree (AR16MT) described in the [Jellyfish +Merkle tree] white paper. Unlike Jellyfish Merkle tree, our construction uses vanilla binary tree hashing algorithm to +make it easier for the circuit creation. The depth of the tree is 256, and Blake2 is used as the hashing function. ## Snapshot tests diff --git a/core/tests/recovery-test/src/index.ts b/core/tests/recovery-test/src/index.ts index 8567be6d6d30..d4eaa476b838 100644 --- a/core/tests/recovery-test/src/index.ts +++ b/core/tests/recovery-test/src/index.ts @@ -193,7 +193,10 @@ export class NodeProcess { return new NodeProcess(childProcess, logs); } - private constructor(private childProcess: ChildProcess, readonly logs: FileHandle) {} + private constructor( + private childProcess: ChildProcess, + readonly logs: FileHandle + ) {} exitCode() { return this.childProcess.exitCode; diff --git a/core/tests/ts-integration/src/l1-provider.ts b/core/tests/ts-integration/src/l1-provider.ts index 39b0397cd069..de41349951c4 100644 --- a/core/tests/ts-integration/src/l1-provider.ts +++ b/core/tests/ts-integration/src/l1-provider.ts @@ -28,7 +28,10 @@ class L1TransactionResponse extends ethers.TransactionResponse implements Augmen private isWaitingReported: boolean = false; private isReceiptReported: boolean = false; - constructor(base: ethers.TransactionResponse, public readonly reporter: Reporter) { + constructor( + base: ethers.TransactionResponse, + public readonly reporter: Reporter + ) { super(base, base.provider); } diff --git a/core/tests/ts-integration/src/retry-provider.ts b/core/tests/ts-integration/src/retry-provider.ts index 51d88357c6c3..4c89e0407b9e 100644 --- a/core/tests/ts-integration/src/retry-provider.ts +++ b/core/tests/ts-integration/src/retry-provider.ts @@ -81,7 +81,10 @@ class L2TransactionResponse extends zksync.types.TransactionResponse implements private isWaitingReported: boolean = false; private isReceiptReported: boolean = false; - constructor(base: zksync.types.TransactionResponse, public readonly reporter: Reporter) { + constructor( + base: zksync.types.TransactionResponse, + public readonly reporter: Reporter + ) { super(base, base.provider); } diff --git a/core/tests/ts-integration/src/utils.ts b/core/tests/ts-integration/src/utils.ts index f8378c8dff01..7088c9d4ee51 100644 --- a/core/tests/ts-integration/src/utils.ts +++ b/core/tests/ts-integration/src/utils.ts @@ -57,7 +57,11 @@ export enum NodeType { } export class Node { - constructor(public proc: ChildProcessWithoutNullStreams, public l2NodeUrl: string, private readonly type: TYPE) {} + constructor( + public proc: ChildProcessWithoutNullStreams, + public l2NodeUrl: string, + private readonly type: TYPE + ) {} public async terminate() { try { diff --git a/core/tests/ts-integration/tests/api/web3.test.ts b/core/tests/ts-integration/tests/api/web3.test.ts index ceed9654df91..16e712bb9255 100644 --- a/core/tests/ts-integration/tests/api/web3.test.ts +++ b/core/tests/ts-integration/tests/api/web3.test.ts @@ -1232,7 +1232,10 @@ export class MockMetamask { readonly isMetaMask: boolean = true; readonly chainId: string; - constructor(readonly wallet: zksync.Wallet, readonly networkVersion: bigint) { + constructor( + readonly wallet: zksync.Wallet, + readonly networkVersion: bigint + ) { this.chainId = ethers.toBeHex(networkVersion); } diff --git a/core/tests/ts-integration/tests/system.test.ts b/core/tests/ts-integration/tests/system.test.ts index 7ce2f69acd6a..38b21c5839ae 100644 --- a/core/tests/ts-integration/tests/system.test.ts +++ b/core/tests/ts-integration/tests/system.test.ts @@ -371,9 +371,11 @@ describe('System behavior checks', () => { function bootloaderUtilsContract() { const BOOTLOADER_UTILS_ADDRESS = '0x000000000000000000000000000000000000800c'; const BOOTLOADER_UTILS = new ethers.Interface( - require(`${ - testMaster.environment().pathToHome - }/contracts/system-contracts/zkout/BootloaderUtilities.sol/BootloaderUtilities.json`).abi + require( + `${ + testMaster.environment().pathToHome + }/contracts/system-contracts/zkout/BootloaderUtilities.sol/BootloaderUtilities.json` + ).abi ); return new ethers.Contract(BOOTLOADER_UTILS_ADDRESS, BOOTLOADER_UTILS, alice); diff --git a/core/tests/upgrade-test/tests/utils.ts b/core/tests/upgrade-test/tests/utils.ts index 2972f8411f5f..c8aae9d4ab0b 100644 --- a/core/tests/upgrade-test/tests/utils.ts +++ b/core/tests/upgrade-test/tests/utils.ts @@ -93,11 +93,13 @@ export function initContracts(pathToHome: string, zkStack: boolean): Contracts { complexUpgraderAbi: new ethers.Interface( require(`${CONTRACTS_FOLDER}/system-contracts/zkout/ComplexUpgrader.sol/ComplexUpgrader.json`).abi ), - counterBytecode: - require(`${pathToHome}/core/tests/ts-integration/artifacts-zk/contracts/counter/counter.sol/Counter.json`) - .deployedBytecode, + counterBytecode: require( + `${pathToHome}/core/tests/ts-integration/artifacts-zk/contracts/counter/counter.sol/Counter.json` + ).deployedBytecode, stateTransitonManager: new ethers.Interface( - require(`${CONTRACTS_FOLDER}/l1-contracts/out/StateTransitionManager.sol/StateTransitionManager.json`).abi + require( + `${CONTRACTS_FOLDER}/l1-contracts/out/StateTransitionManager.sol/StateTransitionManager.json` + ).abi ) }; } else { @@ -116,16 +118,22 @@ export function initContracts(pathToHome: string, zkStack: boolean): Contracts { require(`${L1_CONTRACTS_FOLDER}/governance/ChainAdmin.sol/ChainAdmin.json`).abi ), l2ForceDeployUpgraderAbi: new ethers.Interface( - require(`${pathToHome}/contracts/l2-contracts/artifacts-zk/contracts/ForceDeployUpgrader.sol/ForceDeployUpgrader.json`).abi + require( + `${pathToHome}/contracts/l2-contracts/artifacts-zk/contracts/ForceDeployUpgrader.sol/ForceDeployUpgrader.json` + ).abi ), complexUpgraderAbi: new ethers.Interface( - require(`${pathToHome}/contracts/system-contracts/artifacts-zk/contracts-preprocessed/ComplexUpgrader.sol/ComplexUpgrader.json`).abi + require( + `${pathToHome}/contracts/system-contracts/artifacts-zk/contracts-preprocessed/ComplexUpgrader.sol/ComplexUpgrader.json` + ).abi ), - counterBytecode: - require(`${pathToHome}/core/tests/ts-integration/artifacts-zk/contracts/counter/counter.sol/Counter.json`) - .deployedBytecode, + counterBytecode: require( + `${pathToHome}/core/tests/ts-integration/artifacts-zk/contracts/counter/counter.sol/Counter.json` + ).deployedBytecode, stateTransitonManager: new ethers.Interface( - require(`${L1_CONTRACTS_FOLDER}/state-transition/StateTransitionManager.sol/StateTransitionManager.json`).abi + require( + `${L1_CONTRACTS_FOLDER}/state-transition/StateTransitionManager.sol/StateTransitionManager.json` + ).abi ) }; } diff --git a/docs/src/guides/advanced/13_zk_intuition.md b/docs/src/guides/advanced/13_zk_intuition.md index 6e0224a3237f..cee4dcfd1797 100644 --- a/docs/src/guides/advanced/13_zk_intuition.md +++ b/docs/src/guides/advanced/13_zk_intuition.md @@ -85,8 +85,8 @@ located in a module [zksync core witness]. However, for the new proof system, th new location called [separate witness binary]. Inside this new location, after the necessary data is fetched from storage, the witness generator calls another piece of -code from [zkevm_test_harness witness] named `run_with_fixed_params`. This code is responsible for creating the -witnesses themselves (which can get really HUGE). +code from [zkevm_test_harness witness] named `run_with_fixed_params`. This code is responsible for creating the witnesses +themselves (which can get really HUGE). ## Generating the Proof @@ -96,9 +96,9 @@ The main goal of this step is to take an operation (for example, a calculation c into smaller pieces. Then, we represent this information as a special mathematical expression called a polynomial. To construct these polynomials, we use something called a `ConstraintSystem`. The specific type that we use is called -zkSNARK, and our custom version of it is named bellman. You can find our code for this in the [bellman repo]. -Additionally, we have an optimized version that's designed to run faster on certain types of hardware (using CUDA -technology), which you can find in the [bellman cuda repo]. +zkSNARK, and our custom version of it is named bellman. You can find our code for this in the [bellman repo]. Additionally, +we have an optimized version that's designed to run faster on certain types of hardware (using CUDA technology), which you +can find in the [bellman cuda repo]. An [example ecrecover circuit] might give you a clearer picture of what this looks like in practice. @@ -107,9 +107,9 @@ heavy calculations, we use GPUs to speed things up. ### Where is the Code -The main code that utilizes the GPUs to create proofs is located in a repository named [heavy_ops_service repo]. This -code combines elements from the [bellman cuda repo] that we mentioned earlier, along with a huge amount of data -generated by the witness, to produce the final proofs. +The main code that utilizes the GPUs to create proofs is located in a repository named [heavy_ops_service repo]. This code +combines elements from the [bellman cuda repo] that we mentioned earlier, along with a huge amount of data generated by the +witness, to produce the final proofs. ## What Does "Verify Proof on L1" Mean diff --git a/docs/src/guides/advanced/16_decentralization.md b/docs/src/guides/advanced/16_decentralization.md index ab92f3c5f43a..7e1ff9b71cb5 100644 --- a/docs/src/guides/advanced/16_decentralization.md +++ b/docs/src/guides/advanced/16_decentralization.md @@ -28,7 +28,8 @@ You then have two different paths depending if your main node is using file-base ### File-based configuration -If you are using the recommended file-based configuration then you'll need to add the following information to your `general.yaml` config file (see [Ecosystem Configuration](../launch.md#ecosystem-configuration)): +If you are using the recommended file-based configuration then you'll need to add the following information to your +`general.yaml` config file (see [Ecosystem Configuration](../launch.md#ecosystem-configuration)): ```yaml consensus: @@ -61,7 +62,8 @@ consensus: ### Env-based configuration -If you are using the env-based configuration you'll need to create a `consensus_config.yaml` file with the following content: +If you are using the env-based configuration you'll need to create a `consensus_config.yaml` file with the following +content: ```yaml server_addr: '0.0.0.0:3054' @@ -105,7 +107,9 @@ Finally, to enable the consensus component for the main node you just need to ap ## Gitops repo config -If you are using the matterlabs gitops repo to configure the main node, you'll need to add this information to your kubernetes config for the core server, `server-v2-core.yaml` file (see [example](https://github.com/matter-labs/gitops-kubernetes/blob/177dcd575c6ab446e70b9a9ced8024766095b516/apps/environments/era-stage-proofs/server-v2/server-v2-core.yaml#L23-L35)): +If you are using the matterlabs gitops repo to configure the main node, you'll need to add this information to your +kubernetes config for the core server, `server-v2-core.yaml` file (see +[example](https://github.com/matter-labs/gitops-kubernetes/blob/177dcd575c6ab446e70b9a9ced8024766095b516/apps/environments/era-stage-proofs/server-v2/server-v2-core.yaml#L23-L35)): ```yaml spec: @@ -115,17 +119,22 @@ spec: service: main: ports: - consensus: - enabled: true - port: 3054 + consensus: + enabled: true + port: 3054 ``` -Then again you have two paths depending if the deployment is using file-based or env-based configuration. Although by default you should be using file-based configuration. + +Then again you have two paths depending if the deployment is using file-based or env-based configuration. Although by +default you should be using file-based configuration. ### File-based configuration -Just like before you'll add the consensus config information to the `general.yaml` config file (see [example](https://github.com/matter-labs/gitops-kubernetes/blob/177dcd575c6ab446e70b9a9ced8024766095b516/apps/environments/era-stage-proofs/server-v2-config/general.yaml#L353-L368)). +Just like before you'll add the consensus config information to the `general.yaml` config file (see +[example](https://github.com/matter-labs/gitops-kubernetes/blob/177dcd575c6ab446e70b9a9ced8024766095b516/apps/environments/era-stage-proofs/server-v2-config/general.yaml#L353-L368)). -And the secrets you generated to your whatever secrets managing system you are using (see an example [here](https://github.com/matter-labs/gitops-kubernetes/blob/177dcd575c6ab446e70b9a9ced8024766095b516/apps/clusters/era-stage-proofs/stage2/secrets/server-v2-secrets.yaml) using SOPS). +And the secrets you generated to your whatever secrets managing system you are using (see an example +[here](https://github.com/matter-labs/gitops-kubernetes/blob/177dcd575c6ab446e70b9a9ced8024766095b516/apps/clusters/era-stage-proofs/stage2/secrets/server-v2-secrets.yaml) +using SOPS). ```yaml consensus: @@ -133,9 +142,12 @@ consensus: attester_key: attester:secret:??? node_key: node:secret:??? ``` + ### Env-based configuration -It is even more complicated because the `consensus_config.yaml` file is rendered from a helm chart. See the [example](https://github.com/matter-labs/gitops-kubernetes/blob/177dcd575c6ab446e70b9a9ced8024766095b516/apps/environments/mainnet2/server-v2/server-v2-core.yaml#L37-L92), to see where you have to paste the content of the `consensus_config.yaml` file. +It is even more complicated because the `consensus_config.yaml` file is rendered from a helm chart. See the +[example](https://github.com/matter-labs/gitops-kubernetes/blob/177dcd575c6ab446e70b9a9ced8024766095b516/apps/environments/mainnet2/server-v2/server-v2-core.yaml#L37-L92), +to see where you have to paste the content of the `consensus_config.yaml` file. You also need to add the following sections to your `server-v2-core.yaml` file: @@ -160,7 +172,10 @@ spec: value: /etc/consensus_secrets/.consensus_secrets.yaml ``` -You need to embed the `consensus_secrets.yaml` file into a kubernetes config (see how to do it [here](https://github.com/matter-labs/gitops-kubernetes/blob/177dcd575c6ab446e70b9a9ced8024766095b516/apps/environments/mainnet2/zksync-v2-secret/kustomization.yaml#L3-L4) and [here](https://github.com/matter-labs/gitops-kubernetes/blob/177dcd575c6ab446e70b9a9ced8024766095b516/apps/environments/mainnet2/zksync-v2-secret/consensus_secrets.yaml)): +You need to embed the `consensus_secrets.yaml` file into a kubernetes config (see how to do it +[here](https://github.com/matter-labs/gitops-kubernetes/blob/177dcd575c6ab446e70b9a9ced8024766095b516/apps/environments/mainnet2/zksync-v2-secret/kustomization.yaml#L3-L4) +and +[here](https://github.com/matter-labs/gitops-kubernetes/blob/177dcd575c6ab446e70b9a9ced8024766095b516/apps/environments/mainnet2/zksync-v2-secret/consensus_secrets.yaml)): ```yaml apiVersion: v1 diff --git a/package.json b/package.json index 9e3428e614cc..b293bedd8f69 100644 --- a/package.json +++ b/package.json @@ -39,12 +39,12 @@ "@typescript-eslint/eslint-plugin": "^6.7.4", "@typescript-eslint/parser": "^4.10.0", "babel-eslint": "^10.1.0", - "eslint-config-alloy": "^3.8.2", "eslint": "^7.16.0", + "eslint-config-alloy": "^3.8.2", "markdownlint-cli": "^0.24.0", "npm-run-all": "^4.1.5", + "prettier": "^3.3.3", "prettier-plugin-solidity": "=1.0.0-dev.22", - "prettier": "^2.3.2", "solhint": "^3.3.2", "sql-formatter": "^13.1.0" } diff --git a/prover/crates/bin/prover_cli/README.md b/prover/crates/bin/prover_cli/README.md index e0dd1697bf6d..af629dedc972 100644 --- a/prover/crates/bin/prover_cli/README.md +++ b/prover/crates/bin/prover_cli/README.md @@ -257,12 +257,12 @@ TODO | | | `-rt, --recursion-tip` | 🏗️ | | | | `-s, --scheduler` | 🏗️ | | | | `-c, --compressor` | 🏗️ | -| | | `-f, --failed` | 🏗 | +| | | `-f, --failed` | 🏗 | | `delete` | | `-n ` | ✅️️ | | | | `-a, --all` | ️️✅️️️️️️ | | `requeue` | | `—b, --batch ` | ✅️ | | | | `-a, --all` | ✅️️ | -| `config` | | `--db-url ` | 🏗 | +| `config` | | `--db-url ` | 🏗 | | `debug-proof` | | `--file ` | ✅️ | | `file-info` | | `--file-path ` | ✅️ | | `stats` | | `--period ` | ✅️ | diff --git a/yarn.lock b/yarn.lock index 15fb8bb7d967..5df8cb570e0f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9131,6 +9131,11 @@ prettier@^3.0.3: resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.2.5.tgz#e52bc3090586e824964a8813b09aba6233b28368" integrity sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A== +prettier@^3.3.3: + version "3.3.3" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.3.3.tgz#30c54fe0be0d8d12e6ae61dbb10109ea00d53105" + integrity sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew== + pretty-format@^29.0.0, pretty-format@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.7.0.tgz#ca42c758310f365bfa71a0bda0a807160b776812" @@ -10191,7 +10196,7 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" -"string-width-cjs@npm:string-width@^4.2.0": +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -10208,15 +10213,6 @@ string-width@^2.1.0, string-width@^2.1.1: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" -string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" @@ -10283,7 +10279,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -10304,13 +10300,6 @@ strip-ansi@^5.1.0: dependencies: ansi-regex "^4.1.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" @@ -11161,16 +11150,7 @@ workerpool@6.2.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==