Skip to content

Commit

Permalink
feat(proof-data-handler): add tee_proof_generation_timeout_in_secs param
Browse files Browse the repository at this point in the history
Add `tee_proof_generation_timeout_in_secs` parameter to the
`proof-data-handler` configuration to not share the same
`proof_generation_timeout_in_secs` timeout with the prover.
  • Loading branch information
pbeza committed Oct 18, 2024
1 parent 37f209f commit 21f56a2
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 6 deletions.
5 changes: 5 additions & 0 deletions core/lib/config/src/configs/proof_data_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ use serde::Deserialize;
pub struct ProofDataHandlerConfig {
pub http_port: u16,
pub proof_generation_timeout_in_secs: u16,
pub tee_proof_generation_timeout_in_secs: u16,
pub tee_support: bool,
}

impl ProofDataHandlerConfig {
pub fn proof_generation_timeout(&self) -> Duration {
Duration::from_secs(self.proof_generation_timeout_in_secs as u64)
}

pub fn tee_proof_generation_timeout(&self) -> Duration {
Duration::from_secs(self.tee_proof_generation_timeout_in_secs as u64)
}
}
1 change: 1 addition & 0 deletions core/lib/config/src/testonly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,7 @@ impl Distribution<configs::ProofDataHandlerConfig> for EncodeDist {
configs::ProofDataHandlerConfig {
http_port: self.sample(rng),
proof_generation_timeout_in_secs: self.sample(rng),
tee_proof_generation_timeout_in_secs: self.sample(rng),
tee_support: self.sample(rng),
}
}
Expand Down
2 changes: 2 additions & 0 deletions core/lib/env_config/src/proof_data_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ mod tests {
ProofDataHandlerConfig {
http_port: 3320,
proof_generation_timeout_in_secs: 18000,
tee_proof_generation_timeout_in_secs: 600,
tee_support: true,
}
}
Expand All @@ -27,6 +28,7 @@ mod tests {
fn from_env() {
let config = r#"
PROOF_DATA_HANDLER_PROOF_GENERATION_TIMEOUT_IN_SECS="18000"
PROOF_DATA_HANDLER_TEE_PROOF_GENERATION_TIMEOUT_IN_SECS="600"
PROOF_DATA_HANDLER_HTTP_PORT="3320"
PROOF_DATA_HANDLER_TEE_SUPPORT="true"
"#;
Expand Down
8 changes: 8 additions & 0 deletions core/lib/protobuf_config/src/proof_data_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ impl ProtoRepr for proto::ProofDataHandler {
tee_support: required(&self.tee_support)
.copied()
.context("tee_support")?,
tee_proof_generation_timeout_in_secs: required(
&self.tee_proof_generation_timeout_in_secs,
)
.and_then(|x| Ok((*x).try_into()?))
.context("tee_proof_generation_timeout_in_secs")?,
})
}

Expand All @@ -25,6 +30,9 @@ impl ProtoRepr for proto::ProofDataHandler {
http_port: Some(this.http_port.into()),
proof_generation_timeout_in_secs: Some(this.proof_generation_timeout_in_secs.into()),
tee_support: Some(this.tee_support),
tee_proof_generation_timeout_in_secs: Some(
this.tee_proof_generation_timeout_in_secs.into(),
),
}
}
}
1 change: 1 addition & 0 deletions core/lib/protobuf_config/src/proto/config/prover.proto
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,5 @@ message ProofDataHandler {
optional uint32 http_port = 1; // required; u16
optional uint32 proof_generation_timeout_in_secs = 2; // required; s
optional bool tee_support = 3; // required
optional uint32 tee_proof_generation_timeout_in_secs = 4; // required; s
}
2 changes: 2 additions & 0 deletions core/node/proof_data_handler/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ async fn request_tee_proof_inputs() {
ProofDataHandlerConfig {
http_port: 1337,
proof_generation_timeout_in_secs: 10,
tee_proof_generation_timeout_in_secs: 5,
tee_support: true,
},
L1BatchCommitmentMode::Rollup,
Expand Down Expand Up @@ -80,6 +81,7 @@ async fn submit_tee_proof() {
ProofDataHandlerConfig {
http_port: 1337,
proof_generation_timeout_in_secs: 10,
tee_proof_generation_timeout_in_secs: 5,
tee_support: true,
},
L1BatchCommitmentMode::Rollup,
Expand Down
1 change: 1 addition & 0 deletions etc/env/base/proof_data_handler.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[proof_data_handler]
http_port = 3320
proof_generation_timeout_in_secs = 18000
tee_proof_generation_timeout_in_secs = 600
tee_support = true
9 changes: 3 additions & 6 deletions etc/env/file_based/general.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ api:
estimate_gas_scale_factor: 1.3
estimate_gas_acceptable_overestimation: 5000
max_tx_size: 1000000
api_namespaces: [ en,eth,net,web3,zks,pubsub,debug ]
api_namespaces: [en, eth, net, web3, zks, pubsub, debug]
state_keeper:
transaction_slots: 8192
max_allowed_l2_tx_gas_limit: 15000000000
Expand Down Expand Up @@ -104,7 +104,7 @@ eth:
aggregated_block_execute_deadline: 10
timestamp_criteria_max_allowed_lag: 30
max_eth_tx_data_size: 120000
aggregated_proof_sizes: [ 1 ]
aggregated_proof_sizes: [1]
max_aggregated_tx_gas: 15000000
max_acceptable_priority_fee_in_gwei: 100000000000
pubdata_sending_mode: BLOBS
Expand All @@ -121,7 +121,6 @@ eth:
confirmations_for_eth_event: 0
eth_node_poll_interval: 300


snapshot_creator:
object_store:
file_backed:
Expand All @@ -130,7 +129,6 @@ snapshot_creator:
concurrent_queries_count: 25
storage_logs_chunk_size: 1000000


prover:
prover_object_store:
file_backed:
Expand Down Expand Up @@ -169,6 +167,7 @@ witness_vector_generator:
data_handler:
http_port: 3320
proof_generation_timeout_in_secs: 18000
tee_proof_generation_timeout_in_secs: 600
tee_support: true
prover_gateway:
api_url: http://127.0.0.1:3320
Expand Down Expand Up @@ -289,7 +288,6 @@ prover_job_monitor:
witness_job_queuer_run_interval_ms: 10000
http_port: 3074


base_token_adjuster:
price_polling_interval_ms: 30000
price_cache_update_interval_ms: 2000
Expand All @@ -301,7 +299,6 @@ external_price_api_client:
forced_numerator: 3
forced_denominator: 2


house_keeper:
l1_batch_metrics_reporting_interval_ms: 10000

Expand Down

0 comments on commit 21f56a2

Please sign in to comment.