Skip to content

Commit afb1eba

Browse files
committed
refactor: ethproofs logs and max wait time
1 parent e0fac34 commit afb1eba

File tree

3 files changed

+14
-16
lines changed

3 files changed

+14
-16
lines changed

zkvm_execution_layer/src/dummy_proof_gen.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ impl DummyProofGenerator {
5454
.into_bytes();
5555

5656
// Use proof_id 0 (Fallback verifier) to mark this as a dummy proof
57-
let fallback_proof_id = ExecutionProofId::new(0)
58-
.expect("proof_id 0 is always valid");
57+
let fallback_proof_id = ExecutionProofId::new(0).expect("proof_id 0 is always valid");
5958
ExecutionProof::new(
6059
fallback_proof_id,
6160
slot,
@@ -152,7 +151,7 @@ impl ProofGenerator for DummyProofGenerator {
152151
info!(
153152
proof_id = %self.proof_id,
154153
block_hash = %payload_hash,
155-
"[Ethproofs] API proof generation failed, using dummy fallback"
154+
"[Ethproofs] API proof generation failed, using fallback"
156155
);
157156
self.create_dummy_proof(slot, payload_hash, block_root)
158157
}
@@ -161,7 +160,7 @@ impl ProofGenerator for DummyProofGenerator {
161160
proof_id = %self.proof_id,
162161
block_hash = %payload_hash,
163162
error = %e,
164-
"[Ethproofs] Failed to fetch proofs, using dummy fallback"
163+
"[Ethproofs] Failed to fetch proofs, using fallback"
165164
);
166165
self.create_dummy_proof(slot, payload_hash, block_root)
167166
}

zkvm_execution_layer/src/dummy_proof_verifier.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::ethproofs_demo::{EthproofsValidator, ProofValidator};
22
use crate::proof_verification::{ProofVerificationResult, ProofVerifier, VerificationError};
33
use std::sync::Arc;
44
use std::time::Duration;
5-
use tracing::info;
5+
use tracing::debug;
66
use types::{ExecutionProof, ExecutionProofId};
77

88
/// TODO(ethproofs): Ethproofs demo implementation of proof verification.
@@ -58,7 +58,7 @@ impl ProofVerifier for DummyVerifier {
5858
std::thread::sleep(self.verification_delay);
5959
}
6060

61-
info!(
61+
debug!(
6262
proof_id = %self.proof_id,
6363
block_hash = %proof.block_hash,
6464
"[Ethproofs] Verifying proof"

zkvm_execution_layer/src/ethproofs_demo.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use once_cell::sync::Lazy;
44
use reqwest::StatusCode;
55
use serde::{Deserialize, Serialize};
66
use std::time::{Duration, Instant};
7-
use tracing::{info, warn};
7+
use tracing::{debug, info, warn};
88
use types::ExecutionProof;
99

1010
/// Trait for validating proofs
@@ -60,7 +60,7 @@ pub async fn fetch_proof_from_ethproofs(
6060
block_hash: types::ExecutionBlockHash,
6161
cluster: String,
6262
) -> Result<Vec<Ethproof>, String> {
63-
const MAX_WAIT_TIME_SECS: u64 = 15;
63+
const MAX_WAIT_TIME_SECS: u64 = 60;
6464
const INITIAL_DELAY_MS: u64 = 100;
6565
const MAX_DELAY_MS: u64 = 5000;
6666

@@ -169,7 +169,7 @@ pub fn validate_proof(proof: &ExecutionProof) -> bool {
169169
info!(
170170
slot = %proof.slot,
171171
block_hash = %proof.block_hash,
172-
"[Ethproofs] Fallback proof accepted without cryptographic verification"
172+
"[Ethproofs] Fallback proof accepted"
173173
);
174174
return true;
175175
}
@@ -190,7 +190,7 @@ pub fn validate_proof(proof: &ExecutionProof) -> bool {
190190
Some(store) => {
191191
match store.get(&prover_uuid) {
192192
Some(vk) => {
193-
info!(
193+
debug!(
194194
slot = %proof.slot,
195195
block_hash = %proof.block_hash,
196196
prover_id = %prover_uuid,
@@ -205,7 +205,6 @@ pub fn validate_proof(proof: &ExecutionProof) -> bool {
205205
info!(
206206
slot = %proof.slot,
207207
block_hash = %proof.block_hash,
208-
prover_id = %prover_uuid,
209208
verifier = verifier_entry.name,
210209
"[Ethproofs] Verification started"
211210
);
@@ -216,7 +215,7 @@ pub fn validate_proof(proof: &ExecutionProof) -> bool {
216215
info!(
217216
slot = %proof.slot,
218217
block_hash = %proof.block_hash,
219-
prover_id = %prover_uuid,
218+
verifier = verifier_entry.name,
220219
verification_result = result,
221220
"[Ethproofs] Verification completed"
222221
);
@@ -226,9 +225,9 @@ pub fn validate_proof(proof: &ExecutionProof) -> bool {
226225
warn!(
227226
slot = %proof.slot,
228227
block_hash = %proof.block_hash,
229-
prover_id = %prover_uuid,
228+
verifier = verifier_entry.name,
230229
error = %e,
231-
"[Ethproofs] Verification failed with error"
230+
"[Ethproofs] Verification failed"
232231
);
233232
false
234233
}
@@ -239,7 +238,7 @@ pub fn validate_proof(proof: &ExecutionProof) -> bool {
239238
slot = %proof.slot,
240239
block_hash = %proof.block_hash,
241240
prover_id = %prover_uuid,
242-
"[Ethproofs] No verifier registered for this prover, cannot verify proof"
241+
"[Ethproofs] No registered verifier"
243242
);
244243
false
245244
}
@@ -250,7 +249,7 @@ pub fn validate_proof(proof: &ExecutionProof) -> bool {
250249
slot = %proof.slot,
251250
block_hash = %proof.block_hash,
252251
prover_id = %prover_uuid,
253-
"[Ethproofs] No verification key found for this prover"
252+
"[Ethproofs] No verification key found"
254253
);
255254
false
256255
}

0 commit comments

Comments
 (0)