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: Extract proof_data_handler into separate crate #1677

Merged
merged 6 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 17 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ members = [
"core/bin/genesis_generator",
# Node services
"core/node/node_framework",
"core/node/proof_data_handler",
"core/node/block_reverter",
"core/node/commitment_generator",
"core/node/house_keeper",
Expand Down Expand Up @@ -223,6 +224,7 @@ zksync_crypto_primitives = { path = "core/lib/crypto_primitives" }
zksync_node_framework = { path = "core/node/node_framework" }
zksync_eth_watch = { path = "core/node/eth_watch" }
zksync_shared_metrics = { path = "core/node/shared_metrics" }
zksync_proof_data_handler = { path = "core/node/proof_data_handler" }
zksync_block_reverter = { path = "core/node/block_reverter" }
zksync_commitment_generator = { path = "core/node/commitment_generator" }
zksync_house_keeper = { path = "core/node/house_keeper" }
1 change: 1 addition & 0 deletions core/lib/zksync_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ zksync_health_check.workspace = true
vlog.workspace = true
zksync_eth_watch.workspace = true
zksync_shared_metrics.workspace = true
zksync_proof_data_handler.workspace = true
zksync_commitment_generator.workspace = true
zksync_house_keeper.workspace = true

Expand Down
3 changes: 1 addition & 2 deletions core/lib/zksync_core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ pub mod fee_model;
pub mod genesis;
pub mod l1_gas_price;
pub mod metadata_calculator;
pub mod proof_data_handler;
pub mod proto;
pub mod reorg_detector;
pub mod state_keeper;
Expand Down Expand Up @@ -783,7 +782,7 @@ pub async fn initialize_components(
}

if components.contains(&Component::ProofDataHandler) {
task_futures.push(tokio::spawn(proof_data_handler::run_server(
task_futures.push(tokio::spawn(zksync_proof_data_handler::run_server(
configs
.proof_data_handler_config
.clone()
Expand Down
1 change: 1 addition & 0 deletions core/node/node_framework/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ zksync_utils.workspace = true
zksync_circuit_breaker.workspace = true
zksync_concurrency.workspace = true
zksync_eth_watch.workspace = true
zksync_proof_data_handler.workspace = true
zksync_block_reverter.workspace = true
zksync_commitment_generator.workspace = true
zksync_house_keeper.workspace = true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::sync::Arc;

use zksync_config::configs::ProofDataHandlerConfig;
use zksync_core::proof_data_handler;
use zksync_dal::{ConnectionPool, Core};
use zksync_object_store::ObjectStore;

Expand Down Expand Up @@ -68,7 +67,7 @@ impl Task for ProofDataHandlerTask {
}

async fn run(self: Box<Self>, stop_receiver: StopReceiver) -> anyhow::Result<()> {
proof_data_handler::run_server(
zksync_proof_data_handler::run_server(
self.proof_data_handler_config,
self.blob_store,
self.main_pool,
Expand Down
22 changes: 22 additions & 0 deletions core/node/proof_data_handler/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[package]
name = "zksync_proof_data_handler"
version = "0.1.0"
edition.workspace = true
authors.workspace = true
homepage.workspace = true
repository.workspace = true
license.workspace = true
keywords.workspace = true
categories.workspace = true

[dependencies]
zksync_config.workspace = true
zksync_dal.workspace = true
zksync_object_store.workspace = true
zksync_prover_interface.workspace = true
zksync_types.workspace = true

tracing.workspace = true
anyhow.workspace = true
axum.workspace = true
tokio.workspace = true
3 changes: 3 additions & 0 deletions core/node/proof_data_handler/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# zkSync Era Proof data handler

This crate contains functionality for sending proof-related info from `Server` to `Prover` and back.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use zksync_dal::{ConnectionPool, Core};
use zksync_object_store::ObjectStore;
use zksync_prover_interface::api::{ProofGenerationDataRequest, SubmitProofRequest};

use crate::proof_data_handler::request_processor::RequestProcessor;
use crate::request_processor::RequestProcessor;

mod request_processor;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ use zksync_types::{
basic_fri_types::Eip4844Blobs, commitment::serialize_commitments, web3::signing::keccak256,
L1BatchNumber, H256,
};
use zksync_utils::u256_to_h256;

#[derive(Clone)]
pub(crate) struct RequestProcessor {
Expand Down Expand Up @@ -218,7 +217,7 @@ impl RequestProcessor {
.header
.system_logs
.into_iter()
.find(|elem| elem.0.key == u256_to_h256(2.into()))
.find(|elem| elem.0.key == H256::from_low_u64_be(2))
.expect("No state diff hash key")
.0
.value;
Expand Down
Loading