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): Add prover run #2272

Merged
merged 110 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
f3efb31
Add init command boilerplate
matias-gonz Jun 12, 2024
0a694dc
Merge branch 'main' into matias-gonz-zk-toolbox-add-prover-init
matias-gonz Jun 12, 2024
ee26056
Merge branch 'main' into matias-gonz-zk-toolbox-add-prover-init
matias-gonz Jun 13, 2024
d82b8b3
Run key generator
matias-gonz Jun 13, 2024
351c9ee
fix setup data path
matias-gonz Jun 13, 2024
866bdc9
Refactor msgs
matias-gonz Jun 13, 2024
535fd18
fmt
matias-gonz Jun 13, 2024
4458d71
Merge branch 'main' into matias-gonz-zk-toolbox-add-prover-init
matias-gonz Jun 13, 2024
ae75d11
Merge branch 'main' into matias-gonz-zk-toolbox-add-prover-init
matias-gonz Jun 14, 2024
660f1f8
Merge branch 'main' into matias-gonz-zk-toolbox-add-prover-init
matias-gonz Jun 14, 2024
29e4459
Save link to prover in ecosystem config
matias-gonz Jun 14, 2024
8766e45
Add link_to_prover to ZkStack config
matias-gonz Jun 14, 2024
511c318
Remove type annotation
matias-gonz Jun 14, 2024
8ed3f19
Merge branch 'main' into matias-gonz-zk-toolbox-add-prover-init
matias-gonz Jun 14, 2024
6628238
Merge branch 'main' into matias-gonz-zk-toolbox-add-prover-init
matias-gonz Jun 18, 2024
f58ef92
Rename command to generate-sk
matias-gonz Jun 18, 2024
3891d63
Add get_link_to_prover
matias-gonz Jun 18, 2024
595e98f
fmt
matias-gonz Jun 18, 2024
15002a8
Merge branch 'main' into matias-gonz-zk-toolbox-add-prover-init
matias-gonz Jun 18, 2024
8a84d66
Remove link_to_prover from ZkStack config
matias-gonz Jun 18, 2024
4eb1363
Merge branch 'matias-gonz-zk-toolbox-add-prover-init' of github.com:m…
matias-gonz Jun 18, 2024
af51320
Merge branch 'main' into matias-gonz-zk-toolbox-add-prover-init
matias-gonz Jun 18, 2024
50f1a1d
Add ProverCommands::Run
matias-gonz Jun 18, 2024
be724af
Merge branch 'main' of github.com:matter-labs/zksync-era into matias-…
matias-gonz Jun 19, 2024
29940c7
Merge branch 'main' into matias-gonz-zk-toolbox-add-prover-run
matias-gonz Jun 25, 2024
5ab441d
Add ProverRunArgs
matias-gonz Jun 25, 2024
6bb0d45
Add run functions
matias-gonz Jun 25, 2024
c6c6fa8
fmt
matias-gonz Jun 25, 2024
515f3a9
Add run_gateway
matias-gonz Jun 25, 2024
1b283ab
Add run in background
matias-gonz Jun 25, 2024
a5b663b
fix run in background
matias-gonz Jun 25, 2024
627f39a
Use nohup
matias-gonz Jun 25, 2024
6f060da
fix fmt
matias-gonz Jun 25, 2024
e9b4ac3
Add PID message
matias-gonz Jun 25, 2024
bccf534
add sh
matias-gonz Jun 25, 2024
ffe5901
remove \'
matias-gonz Jun 25, 2024
193ff58
remove sh
matias-gonz Jun 25, 2024
aee700e
Remove nohup
matias-gonz Jun 25, 2024
b620f25
remove command variable
matias-gonz Jun 25, 2024
fe6aabe
Run with command
matias-gonz Jun 26, 2024
364664c
Update current dur
matias-gonz Jun 26, 2024
ccf013c
Refactor msgs
matias-gonz Jun 26, 2024
f5dea76
Fix params
matias-gonz Jun 26, 2024
65e6399
Remove run in background
matias-gonz Jun 27, 2024
f18c527
Add run_witness_generator
matias-gonz Jun 27, 2024
47236a6
Fix run_witness_generator
matias-gonz Jun 27, 2024
dca0c41
Add run_witness_vector_generator
matias-gonz Jun 27, 2024
c28ca67
Add run_prover
matias-gonz Jun 27, 2024
f2f577b
Fix prover command
matias-gonz Jun 27, 2024
3a476ce
Merge branch 'main' of github.com:matter-labs/zksync-era into matias-…
matias-gonz Jul 1, 2024
a9d1580
fmt
matias-gonz Jul 1, 2024
017850e
Add WitnessGeneratorArgs
matias-gonz Jul 1, 2024
83da0e1
Add run_compressor
matias-gonz Jul 1, 2024
2112fd4
Fix run_compressor
matias-gonz Jul 1, 2024
89e83e3
Remove unused function
matias-gonz Jul 1, 2024
b0b49d1
Fix download_setup_key
matias-gonz Jul 1, 2024
3be1b70
Update genesis protocol version
matias-gonz Jul 2, 2024
d021255
Fix setup_key_path
matias-gonz Jul 2, 2024
9c40be7
Merge branch 'main' of github.com:matter-labs/zksync-era into matias-…
matias-gonz Jul 2, 2024
962c540
Add static KEYSTORE
matias-gonz Jul 2, 2024
5dd5ee7
Merge branch 'main' into matias-vk-setup-data-generator-file-based-co…
matias-gonz Jul 2, 2024
774f932
Update variable name
matias-gonz Jul 2, 2024
df5907f
lint
matias-gonz Jul 2, 2024
f4b720b
Merge branch 'main' of github.com:matter-labs/zksync-era into matias-…
matias-gonz Jul 2, 2024
03b6ab8
Update vk hashes
matias-gonz Jul 2, 2024
7a1472e
Merge branch 'matias-vk-setup-data-generator-file-based-config' of gi…
matias-gonz Jul 2, 2024
f359b4f
Fix public object store
matias-gonz Jul 2, 2024
d752fe4
Fix object store
matias-gonz Jul 2, 2024
06d37c0
Update prometheus listener port
matias-gonz Jul 2, 2024
15b4c92
Update prometheus ports
matias-gonz Jul 2, 2024
213ebf8
Fix witness vector generator file based config
matias-gonz Jul 2, 2024
245047b
Fix run_compressor
matias-gonz Jul 3, 2024
0316019
Add init_bellman_cuda
matias-gonz Jul 3, 2024
7fc56e1
Add BELLMAN_CUDA_DIR variable
matias-gonz Jul 4, 2024
6a3986a
fmt
matias-gonz Jul 4, 2024
9bf2d5a
Update readme
matias-gonz Jul 4, 2024
d58a4ce
Merge branch 'main' into matias-gonz-zk-toolbox-add-prover-run
matias-gonz Jul 4, 2024
e7f274d
Add nvidia prerequisite
matias-gonz Jul 4, 2024
0cc9ca8
Update strum version
matias-gonz Jul 4, 2024
ce41b12
Update get_default_setup_key_path
matias-gonz Jul 4, 2024
3cbb8d0
Update download_setup_key
matias-gonz Jul 4, 2024
225479b
Fix download_setup_key
matias-gonz Jul 4, 2024
a457c37
Remove unused variable
matias-gonz Jul 4, 2024
1c05899
lint
matias-gonz Jul 4, 2024
b908055
Add prometheus_listener_port to FriWitnessGeneratorConfig
matias-gonz Jul 4, 2024
8357145
Update prometheus_listener_port
matias-gonz Jul 4, 2024
c136429
Add prometheus_listener_port to general config
matias-gonz Jul 4, 2024
86adc0d
Add prometheus_listener_port variable
matias-gonz Jul 4, 2024
585e612
Remove mut
matias-gonz Jul 4, 2024
0542ac0
Fix prometheus_listener_port
matias-gonz Jul 4, 2024
5a4aaa2
Update prometheus listener ports
matias-gonz Jul 4, 2024
a7aec18
Do not fail if prometheus config not provided when not needed
matias-gonz Jul 8, 2024
2d2d09b
Refactor prometheus config req
matias-gonz Jul 8, 2024
6c37439
Merge branch 'main' of github.com:matter-labs/zksync-era into matias-…
matias-gonz Jul 8, 2024
3b4c6b2
Merge branch 'main' into matias-gonz-prometheus-port-witness-generator
matias-gonz Jul 8, 2024
cd83f5a
Remove unused variable
matias-gonz Jul 8, 2024
324db12
Update prometheus listener_port
matias-gonz Jul 8, 2024
0c66acb
Add nvidia-smi prerequisite
matias-gonz Jul 8, 2024
2ad428d
Fix setup key download
matias-gonz Jul 8, 2024
c0f2e22
Merge branch 'matias-gonz-prometheus-port-witness-generator' of githu…
matias-gonz Jul 8, 2024
eeecf5a
Fix prover gateway prometheus port
matias-gonz Jul 8, 2024
d08d76c
Add InitBellmanCuda
matias-gonz Jul 8, 2024
68cab6e
fmt
matias-gonz Jul 8, 2024
54f6343
lint
matias-gonz Jul 8, 2024
156e2b8
Merge branch 'main' into matias-gonz-zk-toolbox-add-prover-run
matias-gonz Jul 8, 2024
edce71a
Make bellman_cuda_dir optional
matias-gonz Jul 8, 2024
22a2f19
lint
matias-gonz Jul 8, 2024
55fe720
Merge branch 'main' into matias-gonz-zk-toolbox-add-prover-run
matias-gonz Jul 9, 2024
3d55d83
Refactor init bellmancuda
matias-gonz Jul 9, 2024
7153685
Refactor init bellmancuda
matias-gonz Jul 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions etc/env/file_based/general.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ witness_generator:
witness_vector_generator:
prover_instance_wait_timeout_in_secs: 200
prover_instance_poll_time_in_milli_secs: 250
prometheus_listener_port: 3314
prometheus_listener_port: 3420
prometheus_pushgateway_url: http://127.0.0.1:9091
prometheus_push_interval_ms: 100
specialized_group_id: 100
Expand All @@ -197,7 +197,7 @@ data_handler:
prover_gateway:
api_url: http://127.0.0.1:3320
api_poll_duration_secs: 1000
prometheus_listener_port: 3314
prometheus_listener_port: 3310
prometheus_pushgateway_url: http://127.0.0.1:9091
prometheus_push_interval_ms: 100
proof_compressor:
Expand Down Expand Up @@ -316,7 +316,7 @@ house_keeper:
fri_gpu_prover_archiver_archive_after_secs: 172800

prometheus:
listener_port: 3312
listener_port: 3314
pushgateway_url: http://127.0.0.1:9091
push_interval_ms: 100

Expand Down
6 changes: 3 additions & 3 deletions etc/env/file_based/genesis.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
genesis_root: 0xabdb766b18a479a5c783a4b80e12686bc8ea3cc2d8a3050491b701d72370ebb5
genesis_rollup_leaf_index: 54
genesis_batch_commitment: 0x2d00e5f8d77afcebf58a6b82ae56ba967566fe7dfbcb6760319fb0d215d18ffd
genesis_protocol_semantic_version: '0.24.0'
genesis_protocol_semantic_version: '0.24.1'
# deprecated
genesis_protocol_version: 24
default_aa_hash: 0x01000563374c277a2c1e34659a2a1e87371bb6d852ce142022d497bfb50b9e32
Expand All @@ -10,9 +10,9 @@ l1_chain_id: 9
l2_chain_id: 270
fee_account: '0x0000000000000000000000000000000000000001'
prover:
recursion_scheduler_level_vk_hash: 0x712bb009b5d5dc81c79f827ca0abff87b43506a8efed6028a818911d4b1b521f
recursion_scheduler_level_vk_hash: 0x14f97b81e54b35fe673d8708cc1a19e1ea5b5e348e12d31e39824ed4f42bbca2
recursion_node_level_vk_hash: 0xf520cd5b37e74e19fdb369c8d676a04dce8a19457497ac6686d2bb95d94109c8
recursion_leaf_level_vk_hash: 0xffb19d007c67b9000b40b372e7a7a55a47d11c92588515598d6cad4052c75ebb
recursion_leaf_level_vk_hash: 0xf9664f4324c1400fa5c3822d667f30e873f53f1b8033180cd15fe41c1e2355c6
recursion_circuits_set_vks_hash: '0x0000000000000000000000000000000000000000000000000000000000000000'
dummy_verifier: true
l1_batch_commit_data_generator_mode: Rollup
6 changes: 3 additions & 3 deletions prover/prover_fri/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ There is an option to run compressors with the GPU, which will significantly imp
2. Install and compile `era-bellman-cuda` library

```console
git clone https://github.com/matter-labs/bellman-cuda.git --branch dev bellman-cuda
cmake -Bbellman-cuda/build -Sbellman-cuda/ -DCMAKE_BUILD_TYPE=Release
git clone https://github.com/matter-labs/era-bellman-cuda
cmake -Bera-bellman-cuda/build -Sera-bellman-cuda/ -DCMAKE_BUILD_TYPE=Release
cmake --build bellman-cuda/build/
```

Expand All @@ -202,7 +202,7 @@ There is an option to run compressors with the GPU, which will significantly imp
6. Run the compressor using:

```console
zk f cargo run ---features "gpu" --release --bin zksync_proof_fri_compressor
zk f cargo run --features "gpu" --release --bin zksync_proof_fri_compressor
```

## Checking the status of the prover
Expand Down
9 changes: 5 additions & 4 deletions prover/witness_generator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ use anyhow::{anyhow, Context as _};
use futures::{channel::mpsc, executor::block_on, SinkExt, StreamExt};
use structopt::StructOpt;
use tokio::sync::watch;
use zksync_config::ObjectStoreConfig;
use zksync_env_config::{object_store::ProverObjectStoreConfig, FromEnv};
use zksync_env_config::object_store::ProverObjectStoreConfig;
use zksync_object_store::ObjectStoreFactory;
use zksync_prover_config::{load_database_secrets, load_general_config};
use zksync_prover_dal::{ConnectionPool, Prover, ProverDal};
Expand Down Expand Up @@ -218,8 +217,10 @@ async fn main() -> anyhow::Result<()> {
false => None,
true => Some(
ObjectStoreFactory::new(
ObjectStoreConfig::from_env()
.context("ObjectStoreConfig::from_env()")?,
prover_config
.public_object_store
.clone()
.expect("public_object_store"),
)
.create_store()
.await?,
Expand Down
13 changes: 12 additions & 1 deletion prover/witness_vector_generator/src/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ pub struct WitnessVectorGenerator {
config: FriWitnessVectorGeneratorConfig,
protocol_version: ProtocolSemanticVersion,
max_attempts: u32,
setup_data_path: Option<String>,
}

impl WitnessVectorGenerator {
#[allow(clippy::too_many_arguments)]
pub fn new(
object_store: Arc<dyn ObjectStore>,
prover_connection_pool: ConnectionPool<Prover>,
Expand All @@ -45,6 +47,7 @@ impl WitnessVectorGenerator {
config: FriWitnessVectorGeneratorConfig,
protocol_version: ProtocolSemanticVersion,
max_attempts: u32,
setup_data_path: Option<String>,
) -> Self {
Self {
object_store,
Expand All @@ -54,6 +57,7 @@ impl WitnessVectorGenerator {
config,
protocol_version,
max_attempts,
setup_data_path,
}
}

Expand Down Expand Up @@ -116,10 +120,17 @@ impl JobProcessor for WitnessVectorGenerator {
job: ProverJob,
_started_at: Instant,
) -> JoinHandle<anyhow::Result<Self::JobArtifacts>> {
let setup_data_path = self.setup_data_path.clone();

tokio::task::spawn_blocking(move || {
let block_number = job.block_number;
let _span = tracing::info_span!("witness_vector_generator", %block_number).entered();
Self::generate_witness_vector(job, &Keystore::default())
let keystore = if let Some(setup_data_path) = setup_data_path {
Keystore::new_with_setup_data_path(setup_data_path)
} else {
Keystore::default()
};
Self::generate_witness_vector(job, &keystore)
})
}

Expand Down
1 change: 1 addition & 0 deletions prover/witness_vector_generator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ async fn main() -> anyhow::Result<()> {
config,
protocol_version,
fri_prover_config.max_attempts,
Some(fri_prover_config.setup_data_path.clone()),
);

let (stop_sender, stop_receiver) = watch::channel(false);
Expand Down
Loading
Loading