You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(l2): separete ProverServer and ProofSender (#2478)
**Motivation**
<!-- Why does this pull request exist? What are its goals? -->
Currently the ProverServer component have the responsibility for both
act as a server for the ProverClient (i.e., send blocks to prove and
receive proofs) and send proofs to the L1 contract to verify blocks.
This tasks can be parallel and decoupled one from the other.
**Description**
<!-- A clear and concise general description of the changes this PR
introduces -->
A new struct `L1ProofSender` is created that periodically checks if
there're new proofs to send to the L1, removing that job from the
`ProverServer`. Also, components were renamed for better clarity.
Note that the config names were not changed as there's a WIP PR (#2501)
doing a full refactor of it
<!-- Link to issues: Resolves#111, Resolves#222 -->
---------
Co-authored-by: Javier Rodríguez Chatruc <49622509+jrchatruc@users.noreply.github.com>
Co-authored-by: Javier Chatruc <jrchatruc@gmail.com>
Co-authored-by: Ivan Litteri <67517699+ilitteri@users.noreply.github.com>
Copy file name to clipboardExpand all lines: crates/l2/docs/prover.md
+20-22Lines changed: 20 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,26 +20,26 @@
20
20
21
21
## What
22
22
23
-
The prover consists of two main components: handling incoming proving data from the `L2 proposer`, specifically the `prover_server` component, and the `zkVM`. The `prover_client` is responsible for this first part, while the `zkVM` serves as a RISC-V emulator executing code specified in `crates/l2/prover/zkvm/interface/guest/src`.
23
+
The prover consists of two main components: handling incoming proving data from the `L2 proposer`, specifically from the `ProofCoordinator` component, and the `zkVM`. The `Prover` is responsible for this first part, while the `zkVM` serves as a RISC-V emulator executing code specified in `crates/l2/prover/zkvm/interface/guest/src`.
24
24
Before the `zkVM` code (or guest), there is a directory called `interface`, which indicates that we access the `zkVM` through the "interface" crate.
25
25
26
-
In summary, the `prover_client` manages the inputs from the `prover_server` and then "calls" the `zkVM` to perform the proving process and generate the `groth16` ZK proof.
26
+
In summary, the `Prover` manages the inputs from the `ProofCoordinator` and then "calls" the `zkVM` to perform the proving process and generate the `groth16` ZK proof.
27
27
28
28
## Workflow
29
29
30
-
The `Prover Server` monitors requests for new jobs from the `Prover Client`, which are sent when the prover is available. Upon receiving a new job, the Prover generates the proof, after which the `Prover Client` sends the proof back to the `Prover Server`.
30
+
The `ProofCoordinator` monitors requests for new jobs from the `Prover`, which are sent when the prover is available. Upon receiving a new job, the Prover generates the proof, after which the `Prover` sends the proof back to the `ProofCoordinator`.
To run the blockchain (`proposer`) and prover in conjunction, start the `prover_client`, use the following command:
79
+
To run the blockchain (`proposer`) and prover in conjunction, start the `Prover`, use the following command:
80
80
81
81
```sh
82
82
make init-prover T="prover_type (pico,risc0,sp1) G=true"
@@ -137,12 +137,12 @@ Then run any of the targets:
137
137
138
138
#### Run the whole system with a GPU Prover
139
139
140
-
Two servers are required: one for the `prover` and another for the `proposer`. If you run both components on the same machine, the `prover` may consume all available resources, leading to potential stuttering or performance issues for the `proposer`/`node`.
140
+
Two servers are required: one for the `Prover` and another for the `sequencer`. If you run both components on the same machine, the `Prover` may consume all available resources, leading to potential stuttering or performance issues for the `sequencer`/`node`.
141
141
142
-
- The number 1 simbolizes a machine with GPU for the `prover_client`.
142
+
- The number 1 simbolizes a machine with GPU for the `Prover`.
143
143
- The number 2 simbolizes a machine for the `sequencer`/L2 node itself.
144
144
145
-
1.`prover_client`/`zkvm`→ prover with gpu, make sure to have all the required dependencies described at the beginning of [Gpu Mode](#gpu-mode) section.
145
+
1.`Prover`/`zkvm`→ prover with gpu, make sure to have all the required dependencies described at the beginning of [Gpu Mode](#gpu-mode) section.
146
146
1.`cd ethrex/crates/l2`
147
147
2.`cp configs/prover_client_config_example.toml configs/prover_client_config.toml` and change the `prover_server_endpoint` with machine's `2` ip and make sure the port matches the one defined in machine 2.
148
148
@@ -153,10 +153,10 @@ The important variables are:
153
153
prover_server_endpoint=<ip-address>:3900
154
154
```
155
155
156
-
-`Finally`, to start the `prover_client`/`zkvm`, run:
156
+
-`Finally`, to start the `Prover`/`zkvm`, run:
157
157
-`make init-prover T=(sp1,risc0,pico) G=true`
158
158
159
-
2.`prover_server`/`proposer`→ this server just needs rust installed.
159
+
2.`ProofCoordinator`/`sequencer`→ this server just needs rust installed.
160
160
1.`cd ethrex/crates/l2`
161
161
2.`cp configs/sequencer_config_example.toml configs/sequencer_config.toml` and change the addresses and the following fields:
Configuration is done through environment variables. The easiest way to configure the ProverClient is by creating a `prover_client_config.toml` file and setting the variables there. Then, at start, it will read the file and set the variables.
187
+
Configuration is done through environment variables. The easiest way to configure the `Prover` is by creating a `prover_client_config.toml` file and setting the variables there. Then, at start, it will read the file and set the variables.
188
188
189
-
The following environment variables are available to configure the Proposer consider looking at the provided [prover_client_config_example.toml](../configs/prover_client_config_example.toml):
190
-
191
-
The following environment variables are used by the ProverClient:
189
+
The following environment variables are available to configure the `Prover`, consider looking at the provided [prover_client_config_example.toml](../configs/prover_client_config_example.toml):
192
190
193
191
-`CONFIGS_PATH`: The path where the `PROVER_CLIENT_CONFIG_FILE` is located at.
194
-
-`PROVER_CLIENT_CONFIG_FILE`: The `.toml` that contains the config for the `prover_client`.
192
+
-`PROVER_CLIENT_CONFIG_FILE`: The `.toml` that contains the config for the `Prover`.
195
193
-`PROVER_ENV_FILE`: The name of the `.env` that has the parsed `.toml` configuration.
196
194
-`PROVER_CLIENT_PROVER_SERVER_ENDPOINT`: Prover Server's Endpoint used to connect the Client to the Server.
0 commit comments