Skip to content
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
4 changes: 0 additions & 4 deletions core/Cargo.lock

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

1 change: 0 additions & 1 deletion core/lib/config/src/configs/fri_prover_gateway.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use serde::Deserialize;
pub struct FriProverGatewayConfig {
pub api_url: String,
pub api_poll_duration_secs: u16,
pub ws_port: u16,

/// Configurations for prometheus
pub prometheus_listener_port: u16,
Expand Down
10 changes: 0 additions & 10 deletions core/lib/config/src/configs/proof_data_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ impl TeeConfig {
#[derive(Debug, Deserialize, Clone, PartialEq)]
pub struct ProofDataHandlerConfig {
pub http_port: u16,
pub api_url: String,
pub batch_readiness_check_interval_in_secs: u16,
pub proof_generation_timeout_in_secs: u16,
pub retry_connection_interval_in_secs: u16,
#[serde(skip)]
// ^ Filled in separately in `Self::from_env()`. We cannot use `serde(flatten)` because it
// doesn't work with `envy`: https://github.com/softprops/envy/issues/26
Expand All @@ -73,11 +70,4 @@ impl ProofDataHandlerConfig {
pub fn proof_generation_timeout(&self) -> Duration {
Duration::from_secs(self.proof_generation_timeout_in_secs as u64)
}
pub fn batch_readiness_check_interval(&self) -> Duration {
Duration::from_secs(self.batch_readiness_check_interval_in_secs as u64)
}

pub fn retry_connection_interval(&self) -> Duration {
Duration::from_secs(self.retry_connection_interval_in_secs as u64)
}
}
4 changes: 0 additions & 4 deletions core/lib/config/src/testonly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,6 @@ impl Distribution<configs::FriProverGatewayConfig> for EncodeDist {
configs::FriProverGatewayConfig {
api_url: self.sample(rng),
api_poll_duration_secs: self.sample(rng),
ws_port: self.sample(rng),
prometheus_listener_port: self.sample(rng),
prometheus_pushgateway_url: self.sample(rng),
prometheus_push_interval_ms: self.sample(rng),
Expand Down Expand Up @@ -567,10 +566,7 @@ impl Distribution<configs::ProofDataHandlerConfig> for EncodeDist {
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> configs::ProofDataHandlerConfig {
configs::ProofDataHandlerConfig {
http_port: self.sample(rng),
api_url: self.sample(rng),
batch_readiness_check_interval_in_secs: self.sample(rng),
proof_generation_timeout_in_secs: self.sample(rng),
retry_connection_interval_in_secs: self.sample(rng),
tee_config: configs::TeeConfig {
tee_support: self.sample(rng),
first_tee_processed_batch: L1BatchNumber(rng.gen()),
Expand Down
2 changes: 0 additions & 2 deletions core/lib/env_config/src/fri_prover_gateway.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ mod tests {
FriProverGatewayConfig {
api_url: "http://private-dns-for-server".to_string(),
api_poll_duration_secs: 100,
ws_port: 123,
prometheus_listener_port: 3316,
prometheus_pushgateway_url: "http://127.0.0.1:9091".to_string(),
prometheus_push_interval_ms: Some(100),
Expand All @@ -31,7 +30,6 @@ mod tests {
let config = r#"
FRI_PROVER_GATEWAY_API_URL="http://private-dns-for-server"
FRI_PROVER_GATEWAY_API_POLL_DURATION_SECS="100"
FRI_PROVER_GATEWAY_WS_PORT="123"
FRI_PROVER_GATEWAY_PROMETHEUS_LISTENER_PORT=3316
FRI_PROVER_GATEWAY_PROMETHEUS_PUSHGATEWAY_URL="http://127.0.0.1:9091"
FRI_PROVER_GATEWAY_PROMETHEUS_PUSH_INTERVAL_MS=100
Expand Down
6 changes: 0 additions & 6 deletions core/lib/env_config/src/proof_data_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ mod tests {
fn expected_config() -> ProofDataHandlerConfig {
ProofDataHandlerConfig {
http_port: 3320,
api_url: "2342".to_string(),
batch_readiness_check_interval_in_secs: 123,
proof_generation_timeout_in_secs: 18000,
retry_connection_interval_in_secs: 123,
tee_config: TeeConfig {
tee_support: true,
first_tee_processed_batch: L1BatchNumber(1337),
Expand All @@ -42,9 +39,6 @@ mod tests {
let config = r#"
PROOF_DATA_HANDLER_PROOF_GENERATION_TIMEOUT_IN_SECS="18000"
PROOF_DATA_HANDLER_HTTP_PORT="3320"
PROOF_DATA_HANDLER_BATCH_READINESS_CHECK_INTERVAL_IN_SECS="123"
PROOF_DATA_HANDLER_RETRY_CONNECTION_INTERVAL_IN_SECS="123"
PROOF_DATA_HANDLER_API_URL="2342"
PROOF_DATA_HANDLER_TEE_SUPPORT="true"
PROOF_DATA_HANDLER_FIRST_TEE_PROCESSED_BATCH="1337"
PROOF_DATA_HANDLER_TEE_PROOF_GENERATION_TIMEOUT_IN_SECS="600"
Expand Down
14 changes: 0 additions & 14 deletions core/lib/protobuf_config/src/proof_data_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@ impl ProtoRepr for proto::ProofDataHandler {
proof_generation_timeout_in_secs: required(&self.proof_generation_timeout_in_secs)
.and_then(|x| Ok((*x).try_into()?))
.context("proof_generation_timeout_in_secs")?,
retry_connection_interval_in_secs: required(&self.retry_connection_interval_in_secs)
.and_then(|x| Ok((*x).try_into()?))
.context("retry_connection_interval_in_secs")?,
api_url: required(&self.api_url).context("api_url")?.clone(),
batch_readiness_check_interval_in_secs: required(
&self.batch_readiness_check_interval_in_secs,
)
.and_then(|x| Ok((*x).try_into()?))
.context("api_poll_duration_in_secs")?,
tee_config: configs::TeeConfig {
tee_support: self
.tee_support
Expand Down Expand Up @@ -51,11 +42,6 @@ impl ProtoRepr for proto::ProofDataHandler {
fn build(this: &Self::Type) -> Self {
Self {
http_port: Some(this.http_port.into()),
api_url: Some(this.api_url.clone()),
batch_readiness_check_interval_in_secs: Some(
this.batch_readiness_check_interval_in_secs.into(),
),
retry_connection_interval_in_secs: Some(this.retry_connection_interval_in_secs.into()),
proof_generation_timeout_in_secs: Some(this.proof_generation_timeout_in_secs.into()),
tee_support: Some(this.tee_config.tee_support),
first_tee_processed_batch: Some(this.tee_config.first_tee_processed_batch.0 as u64),
Expand Down
13 changes: 6 additions & 7 deletions core/lib/protobuf_config/src/proto/config/prover.proto
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,9 @@ message ProverGateway {
optional uint32 prometheus_listener_port = 3; // required; u16
optional string prometheus_pushgateway_url = 4; // required
optional uint64 prometheus_push_interval_ms = 5; // optional; ms
optional uint32 ws_port = 7; // required; u16

reserved 6;
reserved "http_port";

reserved 6, 7;
reserved "http_port", "ws_port";
}


Expand All @@ -78,7 +77,7 @@ message ProofDataHandler {
optional uint64 first_tee_processed_batch = 4; // optional
optional uint32 tee_proof_generation_timeout_in_secs = 5; // optional
optional uint32 tee_batch_permanently_ignored_timeout_in_hours = 6; // optional
optional string api_url = 7; // required; string
optional uint32 batch_readiness_check_interval_in_secs = 8; // required; s
optional uint32 retry_connection_interval_in_secs = 9; // required; s

reserved 7,8,9;
reserved "api_url", "batch_readiness_check_interval_in_secs", "retry_connection_interval_in_secs";
}
4 changes: 0 additions & 4 deletions core/lib/protobuf_config/src/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ impl ProtoRepr for proto::ProverGateway {
api_poll_duration_secs: required(&self.api_poll_duration_secs)
.and_then(|x| Ok((*x).try_into()?))
.context("api_poll_duration_secs")?,
ws_port: required(&self.ws_port)
.and_then(|x| Ok((*x).try_into()?))
.context("http_port")?,
prometheus_listener_port: required(&self.prometheus_listener_port)
.and_then(|x| Ok((*x).try_into()?))
.context("prometheus_listener_port")?,
Expand All @@ -95,7 +92,6 @@ impl ProtoRepr for proto::ProverGateway {
Self {
api_url: Some(this.api_url.clone()),
api_poll_duration_secs: Some(this.api_poll_duration_secs.into()),
ws_port: Some(this.ws_port.into()),
prometheus_listener_port: Some(this.prometheus_listener_port.into()),
prometheus_pushgateway_url: Some(this.prometheus_pushgateway_url.clone()),
prometheus_push_interval_ms: this.prometheus_push_interval_ms,
Expand Down
2 changes: 0 additions & 2 deletions core/lib/prover_interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ zksync_types.workspace = true
circuit_definitions.workspace = true
fflonk.workspace = true
bellman.workspace = true
circuit_sequencer_api.workspace = true
jsonrpsee = { workspace = true, features = ["ws-client", "server", "macros", "client-ws-transport-tls"]}

serde.workspace = true
serde_with = { workspace = true, features = ["base64", "hex"] }
Expand Down
11 changes: 7 additions & 4 deletions core/lib/prover_interface/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@ pub struct ProofGenerationData {
}

#[derive(Debug, Serialize, Deserialize)]
pub struct TeeProofGenerationDataResponse(pub Box<TeeVerifierInput>);
pub enum ProofGenerationDataResponse {
Success(Option<Box<ProofGenerationData>>),
Error(String),
}

#[derive(Debug, Serialize, Deserialize)]
pub struct SubmitProofGenerationDataResponse {}
pub struct TeeProofGenerationDataResponse(pub Box<TeeVerifierInput>);

#[derive(Debug, Serialize, Deserialize)]
pub enum SubmitProofResponse {
Expand Down Expand Up @@ -58,9 +61,9 @@ pub struct TeeProofGenerationDataRequest {

#[derive(Debug, Serialize, Deserialize)]
pub enum SubmitProofRequest {
Proof(L1BatchNumber, Box<L1BatchProofForL1>),
Proof(Box<L1BatchProofForL1>),
// The proof generation was skipped due to sampling
SkippedProofGeneration(L1BatchNumber),
SkippedProofGeneration,
}

#[derive(Debug, Serialize, Deserialize)]
Expand Down
1 change: 0 additions & 1 deletion core/lib/prover_interface/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ pub mod api;
pub mod inputs;
/// Outputs of proof generation provided by the prover subsystem.
pub mod outputs;
pub mod rpc;
21 changes: 0 additions & 21 deletions core/lib/prover_interface/src/rpc.rs

This file was deleted.

18 changes: 7 additions & 11 deletions core/lib/prover_interface/tests/job_serialization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,20 @@ async fn test_final_proof_deserialization() {

#[test]
fn test_proof_request_serialization() {
let proof = SubmitProofRequest::Proof(
L1BatchNumber(1),
Box::new(L1BatchProofForL1::Fflonk(FflonkL1BatchProofForL1 {
let proof = SubmitProofRequest::Proof(Box::new(L1BatchProofForL1::Fflonk(
FflonkL1BatchProofForL1 {
aggregation_result_coords: [[0; 32]; 4],
scheduler_proof: FflonkProof::empty(),
protocol_version: ProtocolSemanticVersion {
minor: ProtocolVersionId::Version25,
patch: 10.into(),
},
})),
);
},
)));
let encoded_obj = serde_json::to_string(&proof).unwrap();
let encoded_json = r#"{
"Proof": [
1,
{
"aggregation_result_coords": [
"Proof": {
"aggregation_result_coords": [
[
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
],
Expand Down Expand Up @@ -161,12 +158,11 @@ fn test_proof_request_serialization() {
},
"protocol_version": "0.25.10"
}
]
}"#;
let decoded_obj: SubmitProofRequest = serde_json::from_str(&encoded_obj).unwrap();
let decoded_json: SubmitProofRequest = serde_json::from_str(encoded_json).unwrap();
match (decoded_obj, decoded_json) {
(SubmitProofRequest::Proof(_, decoded_obj), SubmitProofRequest::Proof(_, decoded_json)) => {
(SubmitProofRequest::Proof(decoded_obj), SubmitProofRequest::Proof(decoded_json)) => {
let obj_coords = match *decoded_obj {
L1BatchProofForL1::Fflonk(obj) => obj.aggregation_result_coords,
L1BatchProofForL1::Plonk(obj) => obj.aggregation_result_coords,
Expand Down
Loading
Loading