diff --git a/prover/Cargo.lock b/prover/Cargo.lock index 8fe3b6f36f6..f9be67d6114 100644 --- a/prover/Cargo.lock +++ b/prover/Cargo.lock @@ -8014,10 +8014,10 @@ dependencies = [ "zksync_prover_dal", "zksync_prover_fri_types", "zksync_prover_interface", + "zksync_prover_keystore", "zksync_queued_job_processor", "zksync_types", "zksync_utils", - "zksync_vk_setup_data_generator_server_fri", "zksync_vlog", ] @@ -8114,10 +8114,10 @@ dependencies = [ "zksync_prover_dal", "zksync_prover_fri_types", "zksync_prover_fri_utils", + "zksync_prover_keystore", "zksync_queued_job_processor", "zksync_types", "zksync_utils", - "zksync_vk_setup_data_generator_server_fri", "zksync_vlog", ] @@ -8208,6 +8208,29 @@ dependencies = [ "zksync_vlog", ] +[[package]] +name = "zksync_prover_keystore" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "circuit_definitions", + "hex", + "md5", + "once_cell", + "serde", + "serde_json", + "sha3 0.10.8", + "shivini", + "tracing", + "zkevm_test_harness", + "zksync_config", + "zksync_env_config", + "zksync_prover_fri_types", + "zksync_types", + "zksync_utils", +] + [[package]] name = "zksync_queued_job_processor" version = "0.1.0" @@ -8301,29 +8324,17 @@ name = "zksync_vk_setup_data_generator_server_fri" version = "0.1.0" dependencies = [ "anyhow", - "bincode", "circuit_definitions", "clap 4.5.4", - "hex", "indicatif", - "itertools 0.10.5", - "md5", - "once_cell", "proptest", - "serde", - "serde_derive", - "serde_json", - "sha3 0.10.8", - "shivini", "toml_edit 0.14.4", "tracing", "tracing-subscriber", "zkevm_test_harness", - "zksync_config", - "zksync_env_config", "zksync_prover_fri_types", + "zksync_prover_keystore", "zksync_types", - "zksync_utils", "zksync_vlog", ] @@ -8416,11 +8427,11 @@ dependencies = [ "zksync_prover_fri_types", "zksync_prover_fri_utils", "zksync_prover_interface", + "zksync_prover_keystore", "zksync_queued_job_processor", "zksync_system_constants", "zksync_types", "zksync_utils", - "zksync_vk_setup_data_generator_server_fri", "zksync_vlog", ] @@ -8443,10 +8454,10 @@ dependencies = [ "zksync_prover_dal", "zksync_prover_fri_types", "zksync_prover_fri_utils", + "zksync_prover_keystore", "zksync_queued_job_processor", "zksync_types", "zksync_utils", - "zksync_vk_setup_data_generator_server_fri", "zksync_vlog", ] diff --git a/prover/Cargo.toml b/prover/Cargo.toml index 9d37c2fb5cb..8d87b727f90 100644 --- a/prover/Cargo.toml +++ b/prover/Cargo.toml @@ -87,6 +87,7 @@ zksync_periodic_job = { path = "../core/lib/periodic_job" } zksync_prover_dal = { path = "crates/lib/prover_dal" } zksync_prover_fri_types = { path = "crates/lib/prover_fri_types" } zksync_prover_fri_utils = { path = "crates/lib/prover_fri_utils" } +zksync_prover_keystore = { path = "crates/lib/keystore" } zksync_vk_setup_data_generator_server_fri = { path = "crates/bin/vk_setup_data_generator_server_fri" } # for `perf` profiling diff --git a/prover/crates/bin/proof_fri_compressor/Cargo.toml b/prover/crates/bin/proof_fri_compressor/Cargo.toml index 6f2d8b6fcc2..936f0cb5100 100644 --- a/prover/crates/bin/proof_fri_compressor/Cargo.toml +++ b/prover/crates/bin/proof_fri_compressor/Cargo.toml @@ -21,7 +21,7 @@ zksync_utils.workspace = true zksync_core_leftovers.workspace = true zksync_prover_fri_types.workspace = true zksync_queued_job_processor.workspace = true -zksync_vk_setup_data_generator_server_fri.workspace = true +zksync_prover_keystore.workspace = true zksync_vlog.workspace = true circuit_sequencer_api.workspace = true diff --git a/prover/crates/bin/proof_fri_compressor/src/compressor.rs b/prover/crates/bin/proof_fri_compressor/src/compressor.rs index 067114ca5a6..c7747b2e45b 100644 --- a/prover/crates/bin/proof_fri_compressor/src/compressor.rs +++ b/prover/crates/bin/proof_fri_compressor/src/compressor.rs @@ -23,9 +23,9 @@ use zksync_prover_fri_types::{ get_current_pod_name, AuxOutputWitnessWrapper, FriProofWrapper, }; use zksync_prover_interface::outputs::L1BatchProofForL1; +use zksync_prover_keystore::keystore::Keystore; use zksync_queued_job_processor::JobProcessor; use zksync_types::{protocol_version::ProtocolSemanticVersion, L1BatchNumber}; -use zksync_vk_setup_data_server_fri::keystore::Keystore; use crate::metrics::METRICS; diff --git a/prover/crates/bin/prover_fri/Cargo.toml b/prover/crates/bin/prover_fri/Cargo.toml index ea7d7778315..ae7853427e9 100644 --- a/prover/crates/bin/prover_fri/Cargo.toml +++ b/prover/crates/bin/prover_fri/Cargo.toml @@ -22,7 +22,7 @@ zksync_prover_fri_utils.workspace = true zksync_core_leftovers.workspace = true zksync_prover_fri_types.workspace = true zksync_utils.workspace = true -zksync_vk_setup_data_generator_server_fri.workspace = true +zksync_prover_keystore.workspace = true shivini = { workspace = true, optional = true, features = [ "circuit_definitions", "zksync", @@ -45,4 +45,4 @@ clap = { workspace = true, features = ["derive"] } [features] default = [] -gpu = ["shivini", "zksync_vk_setup_data_generator_server_fri/gpu"] +gpu = ["shivini", "zksync_prover_keystore/gpu"] diff --git a/prover/crates/bin/prover_fri/src/gpu_prover_job_processor.rs b/prover/crates/bin/prover_fri/src/gpu_prover_job_processor.rs index dc8594cbdc1..63981fa6c7d 100644 --- a/prover/crates/bin/prover_fri/src/gpu_prover_job_processor.rs +++ b/prover/crates/bin/prover_fri/src/gpu_prover_job_processor.rs @@ -29,12 +29,12 @@ pub mod gpu_prover { CircuitWrapper, FriProofWrapper, ProverServiceDataKey, WitnessVectorArtifacts, }; use zksync_prover_fri_utils::region_fetcher::Zone; + use zksync_prover_keystore::{keystore::Keystore, GoldilocksGpuProverSetupData}; use zksync_queued_job_processor::{async_trait, JobProcessor}; use zksync_types::{ basic_fri_types::CircuitIdRoundTuple, protocol_version::ProtocolSemanticVersion, prover_dal::SocketAddress, }; - use zksync_vk_setup_data_server_fri::{keystore::Keystore, GoldilocksGpuProverSetupData}; use crate::{ metrics::METRICS, diff --git a/prover/crates/bin/prover_fri/src/prover_job_processor.rs b/prover/crates/bin/prover_fri/src/prover_job_processor.rs index 2df1b626497..4de11a68b53 100644 --- a/prover/crates/bin/prover_fri/src/prover_job_processor.rs +++ b/prover/crates/bin/prover_fri/src/prover_job_processor.rs @@ -20,11 +20,11 @@ use zksync_prover_fri_types::{ CircuitWrapper, FriProofWrapper, ProverJob, ProverServiceDataKey, }; use zksync_prover_fri_utils::fetch_next_circuit; +use zksync_prover_keystore::{keystore::Keystore, GoldilocksProverSetupData}; use zksync_queued_job_processor::{async_trait, JobProcessor}; use zksync_types::{ basic_fri_types::CircuitIdRoundTuple, protocol_version::ProtocolSemanticVersion, }; -use zksync_vk_setup_data_server_fri::{keystore::Keystore, GoldilocksProverSetupData}; use crate::{ metrics::{CircuitLabels, Layer, METRICS}, diff --git a/prover/crates/bin/prover_fri/tests/basic_test.rs b/prover/crates/bin/prover_fri/tests/basic_test.rs index b6d6226e696..6dc3f5642ef 100644 --- a/prover/crates/bin/prover_fri/tests/basic_test.rs +++ b/prover/crates/bin/prover_fri/tests/basic_test.rs @@ -9,10 +9,10 @@ use zksync_prover_fri::prover_job_processor::Prover; use zksync_prover_fri_types::{ keys::FriCircuitKey, CircuitWrapper, ProverJob, ProverServiceDataKey, }; -use zksync_types::{basic_fri_types::AggregationRound, L1BatchNumber}; -use zksync_vk_setup_data_server_fri::{ +use zksync_prover_keystore::{ keystore::Keystore, setup_data_generator::generate_setup_data_common, }; +use zksync_types::{basic_fri_types::AggregationRound, L1BatchNumber}; fn compare_serialized(expected: &T, actual: &T) { let serialized_expected = bincode::serialize(expected).unwrap(); diff --git a/prover/crates/bin/vk_setup_data_generator_server_fri/Cargo.toml b/prover/crates/bin/vk_setup_data_generator_server_fri/Cargo.toml index 57fca6c8979..7c17e845450 100644 --- a/prover/crates/bin/vk_setup_data_generator_server_fri/Cargo.toml +++ b/prover/crates/bin/vk_setup_data_generator_server_fri/Cargo.toml @@ -14,36 +14,20 @@ categories.workspace = true name = "key_generator" path = "src/main.rs" -[lib] -name = "zksync_vk_setup_data_server_fri" -path = "src/lib.rs" - [dependencies] zksync_vlog.workspace = true zksync_types.workspace = true -zksync_utils.workspace = true zksync_prover_fri_types.workspace = true +zksync_prover_keystore.workspace = true zkevm_test_harness.workspace = true circuit_definitions = { workspace = true, features = ["log_tracing"] } -shivini = { workspace = true, optional = true } -zksync_config.workspace = true -zksync_env_config.workspace = true anyhow.workspace = true clap = { workspace = true, features = ["derive"] } tracing.workspace = true tracing-subscriber = { workspace = true, features = ["env-filter"] } -serde_json.workspace = true -serde = { workspace = true, features = ["derive"] } -serde_derive.workspace = true -itertools.workspace = true -bincode.workspace = true -once_cell.workspace = true toml_edit.workspace = true -md5.workspace = true -sha3.workspace = true -hex.workspace = true indicatif.workspace = true [dev-dependencies] @@ -51,4 +35,4 @@ proptest.workspace = true [features] default = [] -gpu = ["shivini"] +gpu = ["zksync_prover_keystore/gpu"] diff --git a/prover/crates/bin/vk_setup_data_generator_server_fri/src/commitment_generator.rs b/prover/crates/bin/vk_setup_data_generator_server_fri/src/commitment_generator.rs index fe4d5b2482a..8c2a1759009 100644 --- a/prover/crates/bin/vk_setup_data_generator_server_fri/src/commitment_generator.rs +++ b/prover/crates/bin/vk_setup_data_generator_server_fri/src/commitment_generator.rs @@ -1,8 +1,8 @@ use anyhow::Context; -use zksync_vk_setup_data_server_fri::{ - commitment_utils::generate_commitments, - keystore::Keystore, - vk_commitment_helper::{get_toml_formatted_value, read_contract_toml, write_contract_toml}, +use zksync_prover_keystore::{commitment_utils::generate_commitments, keystore::Keystore}; + +use crate::vk_commitment_helper::{ + get_toml_formatted_value, read_contract_toml, write_contract_toml, }; pub fn read_and_update_contract_toml(keystore: &Keystore, dryrun: bool) -> anyhow::Result<()> { diff --git a/prover/crates/bin/vk_setup_data_generator_server_fri/src/main.rs b/prover/crates/bin/vk_setup_data_generator_server_fri/src/main.rs index da86f931b1c..313678bc5da 100644 --- a/prover/crates/bin/vk_setup_data_generator_server_fri/src/main.rs +++ b/prover/crates/bin/vk_setup_data_generator_server_fri/src/main.rs @@ -23,13 +23,14 @@ use zksync_prover_fri_types::{ circuit_definitions::circuit_definitions::recursion_layer::ZkSyncRecursionLayerStorageType, ProverServiceDataKey, }; -use zksync_vk_setup_data_server_fri::{ +use zksync_prover_keystore::{ commitment_utils::generate_commitments, keystore::Keystore, setup_data_generator::{CPUSetupDataGenerator, GPUSetupDataGenerator, SetupDataGenerator}, }; mod commitment_generator; +mod vk_commitment_helper; #[cfg(test)] mod tests; diff --git a/prover/crates/bin/vk_setup_data_generator_server_fri/src/tests.rs b/prover/crates/bin/vk_setup_data_generator_server_fri/src/tests.rs index 39b5f7a44fb..d704f4e8fb6 100644 --- a/prover/crates/bin/vk_setup_data_generator_server_fri/src/tests.rs +++ b/prover/crates/bin/vk_setup_data_generator_server_fri/src/tests.rs @@ -6,8 +6,8 @@ use zksync_prover_fri_types::{ }, ProverServiceDataKey, }; +use zksync_prover_keystore::keystore::Keystore; use zksync_types::basic_fri_types::AggregationRound; -use zksync_vk_setup_data_server_fri::keystore::Keystore; fn all_possible_prover_service_data_key() -> impl Strategy { let mut keys = Vec::with_capacity(30); diff --git a/prover/crates/bin/vk_setup_data_generator_server_fri/src/vk_commitment_helper.rs b/prover/crates/bin/vk_setup_data_generator_server_fri/src/vk_commitment_helper.rs index bf568e06157..02cbe6e0c4d 100644 --- a/prover/crates/bin/vk_setup_data_generator_server_fri/src/vk_commitment_helper.rs +++ b/prover/crates/bin/vk_setup_data_generator_server_fri/src/vk_commitment_helper.rs @@ -2,8 +2,7 @@ use std::{fs, path::PathBuf}; use anyhow::Context as _; use toml_edit::{Document, Item, Value}; - -use crate::utils::core_workspace_dir_or_current_dir; +use zksync_prover_keystore::utils::core_workspace_dir_or_current_dir; pub fn get_toml_formatted_value(string_value: String) -> Item { let mut value = Value::from(string_value); diff --git a/prover/crates/bin/witness_generator/Cargo.toml b/prover/crates/bin/witness_generator/Cargo.toml index e86656d15bb..bb6a44e7eb3 100644 --- a/prover/crates/bin/witness_generator/Cargo.toml +++ b/prover/crates/bin/witness_generator/Cargo.toml @@ -22,7 +22,7 @@ zksync_multivm.workspace = true zksync_object_store.workspace = true zksync_types.workspace = true zksync_utils.workspace = true -zksync_vk_setup_data_generator_server_fri.workspace = true +zksync_prover_keystore.workspace = true zksync_prover_fri_types.workspace = true zksync_prover_fri_utils.workspace = true zksync_core_leftovers.workspace = true diff --git a/prover/crates/bin/witness_generator/src/leaf_aggregation.rs b/prover/crates/bin/witness_generator/src/leaf_aggregation.rs index 2f449418797..6600b301249 100644 --- a/prover/crates/bin/witness_generator/src/leaf_aggregation.rs +++ b/prover/crates/bin/witness_generator/src/leaf_aggregation.rs @@ -27,12 +27,12 @@ use zksync_prover_fri_types::{ FriProofWrapper, }; use zksync_prover_fri_utils::get_recursive_layer_circuit_id_for_base_layer; +use zksync_prover_keystore::keystore::Keystore; use zksync_queued_job_processor::JobProcessor; use zksync_types::{ basic_fri_types::AggregationRound, protocol_version::ProtocolSemanticVersion, prover_dal::LeafAggregationJobMetadata, L1BatchNumber, }; -use zksync_vk_setup_data_server_fri::keystore::Keystore; use crate::{ metrics::WITNESS_GENERATOR_METRICS, diff --git a/prover/crates/bin/witness_generator/src/main.rs b/prover/crates/bin/witness_generator/src/main.rs index 50c95516860..0e304b46cf7 100644 --- a/prover/crates/bin/witness_generator/src/main.rs +++ b/prover/crates/bin/witness_generator/src/main.rs @@ -14,10 +14,10 @@ use zksync_env_config::object_store::ProverObjectStoreConfig; use zksync_object_store::ObjectStoreFactory; use zksync_prover_dal::{ConnectionPool, Prover, ProverDal}; use zksync_prover_fri_types::PROVER_PROTOCOL_SEMANTIC_VERSION; +use zksync_prover_keystore::commitment_utils::get_cached_commitments; use zksync_queued_job_processor::JobProcessor; use zksync_types::basic_fri_types::AggregationRound; use zksync_utils::wait_for_tasks::ManagedTasks; -use zksync_vk_setup_data_server_fri::commitment_utils::get_cached_commitments; use zksync_vlog::prometheus::PrometheusExporterConfig; use zksync_witness_generator::{ basic_circuits::BasicWitnessGenerator, leaf_aggregation::LeafAggregationWitnessGenerator, @@ -171,7 +171,10 @@ async fn main() -> anyhow::Result<()> { let witness_generator_task = match round { AggregationRound::BasicCircuits => { + let start = Instant::now(); let vk_commitments = get_cached_commitments(Some(setup_data_path.clone())); + let end = start.elapsed(); + tracing::info!("Calculating commitment took: {:?}", end); assert_eq!( vk_commitments, vk_commitments_in_db, diff --git a/prover/crates/bin/witness_generator/src/node_aggregation.rs b/prover/crates/bin/witness_generator/src/node_aggregation.rs index b6fc6b8f7c6..87835d79e13 100644 --- a/prover/crates/bin/witness_generator/src/node_aggregation.rs +++ b/prover/crates/bin/witness_generator/src/node_aggregation.rs @@ -23,12 +23,12 @@ use zksync_prover_fri_types::{ keys::AggregationsKey, FriProofWrapper, }; +use zksync_prover_keystore::{keystore::Keystore, utils::get_leaf_vk_params}; use zksync_queued_job_processor::JobProcessor; use zksync_types::{ basic_fri_types::AggregationRound, protocol_version::ProtocolSemanticVersion, prover_dal::NodeAggregationJobMetadata, L1BatchNumber, }; -use zksync_vk_setup_data_server_fri::{keystore::Keystore, utils::get_leaf_vk_params}; use crate::{ metrics::WITNESS_GENERATOR_METRICS, diff --git a/prover/crates/bin/witness_generator/src/recursion_tip.rs b/prover/crates/bin/witness_generator/src/recursion_tip.rs index e05a0cc38cf..c04959b9895 100644 --- a/prover/crates/bin/witness_generator/src/recursion_tip.rs +++ b/prover/crates/bin/witness_generator/src/recursion_tip.rs @@ -43,11 +43,11 @@ use zksync_prover_fri_types::{ keys::{ClosedFormInputKey, FriCircuitKey}, CircuitWrapper, }; +use zksync_prover_keystore::{keystore::Keystore, utils::get_leaf_vk_params}; use zksync_queued_job_processor::JobProcessor; use zksync_types::{ basic_fri_types::AggregationRound, protocol_version::ProtocolSemanticVersion, L1BatchNumber, }; -use zksync_vk_setup_data_server_fri::{keystore::Keystore, utils::get_leaf_vk_params}; use crate::{ metrics::WITNESS_GENERATOR_METRICS, diff --git a/prover/crates/bin/witness_generator/src/scheduler.rs b/prover/crates/bin/witness_generator/src/scheduler.rs index c389e037ffa..6e3461150fe 100644 --- a/prover/crates/bin/witness_generator/src/scheduler.rs +++ b/prover/crates/bin/witness_generator/src/scheduler.rs @@ -25,11 +25,11 @@ use zksync_prover_fri_types::{ keys::FriCircuitKey, CircuitWrapper, FriProofWrapper, }; +use zksync_prover_keystore::{keystore::Keystore, utils::get_leaf_vk_params}; use zksync_queued_job_processor::JobProcessor; use zksync_types::{ basic_fri_types::AggregationRound, protocol_version::ProtocolSemanticVersion, L1BatchNumber, }; -use zksync_vk_setup_data_server_fri::{keystore::Keystore, utils::get_leaf_vk_params}; use crate::{metrics::WITNESS_GENERATOR_METRICS, utils::SchedulerPartialInputWrapper}; diff --git a/prover/crates/bin/witness_vector_generator/Cargo.toml b/prover/crates/bin/witness_vector_generator/Cargo.toml index 278ab2791d0..e8386c8090a 100644 --- a/prover/crates/bin/witness_vector_generator/Cargo.toml +++ b/prover/crates/bin/witness_vector_generator/Cargo.toml @@ -22,7 +22,7 @@ zksync_prover_fri_types.workspace = true zksync_core_leftovers.workspace = true zksync_queued_job_processor.workspace = true zksync_vlog.workspace = true -zksync_vk_setup_data_generator_server_fri.workspace = true +zksync_prover_keystore.workspace = true anyhow.workspace = true tracing.workspace = true diff --git a/prover/crates/bin/witness_vector_generator/src/generator.rs b/prover/crates/bin/witness_vector_generator/src/generator.rs index 800931f5d7c..f482637c177 100644 --- a/prover/crates/bin/witness_vector_generator/src/generator.rs +++ b/prover/crates/bin/witness_vector_generator/src/generator.rs @@ -17,12 +17,12 @@ use zksync_prover_fri_types::{ use zksync_prover_fri_utils::{ fetch_next_circuit, get_numeric_circuit_id, region_fetcher::Zone, socket_utils::send_assembly, }; +use zksync_prover_keystore::keystore::Keystore; use zksync_queued_job_processor::JobProcessor; use zksync_types::{ basic_fri_types::CircuitIdRoundTuple, protocol_version::ProtocolSemanticVersion, prover_dal::GpuProverInstanceStatus, }; -use zksync_vk_setup_data_server_fri::keystore::Keystore; use crate::metrics::METRICS; diff --git a/prover/crates/bin/witness_vector_generator/tests/basic_test.rs b/prover/crates/bin/witness_vector_generator/tests/basic_test.rs index c6dfec5009f..dd1ef840419 100644 --- a/prover/crates/bin/witness_vector_generator/tests/basic_test.rs +++ b/prover/crates/bin/witness_vector_generator/tests/basic_test.rs @@ -1,8 +1,8 @@ use std::fs; use zksync_prover_fri_types::{CircuitWrapper, ProverJob, ProverServiceDataKey}; +use zksync_prover_keystore::keystore::Keystore; use zksync_types::{basic_fri_types::AggregationRound, L1BatchNumber}; -use zksync_vk_setup_data_server_fri::keystore::Keystore; use zksync_witness_vector_generator::generator::WitnessVectorGenerator; #[test] diff --git a/prover/crates/lib/keystore/Cargo.toml b/prover/crates/lib/keystore/Cargo.toml new file mode 100644 index 00000000000..41e9f0244f6 --- /dev/null +++ b/prover/crates/lib/keystore/Cargo.toml @@ -0,0 +1,35 @@ +[package] +name = "zksync_prover_keystore" +version.workspace = true +edition.workspace = true +authors.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true +keywords.workspace = true +categories.workspace = true + + +[dependencies] +zksync_types.workspace = true +zksync_utils.workspace = true +zksync_prover_fri_types.workspace = true +zkevm_test_harness.workspace = true +circuit_definitions = { workspace = true, features = ["log_tracing"] } +shivini = { workspace = true, optional = true } +zksync_config.workspace = true +zksync_env_config.workspace = true + +anyhow.workspace = true +tracing.workspace = true +serde_json.workspace = true +serde = { workspace = true, features = ["derive"] } +bincode.workspace = true +once_cell.workspace = true +md5.workspace = true +sha3.workspace = true +hex.workspace = true + +[features] +default = [] +gpu = ["shivini"] diff --git a/prover/crates/bin/vk_setup_data_generator_server_fri/src/commitment_utils.rs b/prover/crates/lib/keystore/src/commitment_utils.rs similarity index 100% rename from prover/crates/bin/vk_setup_data_generator_server_fri/src/commitment_utils.rs rename to prover/crates/lib/keystore/src/commitment_utils.rs diff --git a/prover/crates/bin/vk_setup_data_generator_server_fri/src/keystore.rs b/prover/crates/lib/keystore/src/keystore.rs similarity index 99% rename from prover/crates/bin/vk_setup_data_generator_server_fri/src/keystore.rs rename to prover/crates/lib/keystore/src/keystore.rs index c683ed3d296..7ba5a3aaa70 100644 --- a/prover/crates/bin/vk_setup_data_generator_server_fri/src/keystore.rs +++ b/prover/crates/lib/keystore/src/keystore.rs @@ -475,6 +475,7 @@ impl Keystore { pub fn load_commitments(&self) -> anyhow::Result { Self::load_json_from_file(self.get_base_path().join("commitments.json")) } + pub fn save_commitments(&self, commitments: &VkCommitments) -> anyhow::Result<()> { Self::save_json_pretty(self.get_base_path().join("commitments.json"), &commitments) } diff --git a/prover/crates/bin/vk_setup_data_generator_server_fri/src/lib.rs b/prover/crates/lib/keystore/src/lib.rs similarity index 99% rename from prover/crates/bin/vk_setup_data_generator_server_fri/src/lib.rs rename to prover/crates/lib/keystore/src/lib.rs index 4b66df56f18..7e60e3fa29c 100644 --- a/prover/crates/bin/vk_setup_data_generator_server_fri/src/lib.rs +++ b/prover/crates/lib/keystore/src/lib.rs @@ -26,7 +26,6 @@ pub mod commitment_utils; pub mod keystore; pub mod setup_data_generator; pub mod utils; -pub mod vk_commitment_helper; #[derive(Debug, Serialize, Deserialize)] #[serde( diff --git a/prover/crates/bin/vk_setup_data_generator_server_fri/src/setup_data_generator.rs b/prover/crates/lib/keystore/src/setup_data_generator.rs similarity index 100% rename from prover/crates/bin/vk_setup_data_generator_server_fri/src/setup_data_generator.rs rename to prover/crates/lib/keystore/src/setup_data_generator.rs diff --git a/prover/crates/bin/vk_setup_data_generator_server_fri/src/utils.rs b/prover/crates/lib/keystore/src/utils.rs similarity index 100% rename from prover/crates/bin/vk_setup_data_generator_server_fri/src/utils.rs rename to prover/crates/lib/keystore/src/utils.rs