Skip to content

Commit

Permalink
Requested PR changes for #310 (2)
Browse files Browse the repository at this point in the history
  • Loading branch information
BGluth committed Aug 14, 2024
1 parent 816eb88 commit 3f3a66c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions zero_bin/common/src/prover_state/persistence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ const ZK_EVM_CACHE_DIR_ENV: &str = "ZK_EVM_CACHE_DIR";
/// We version serialized circuits by the kernel hash they were serialized with,
/// but we really only need a few of the starting hex nibbles to reliably
/// differentiate.
const NUM_HASH_NIBS_TO_USE_IN_CIRCUIT_VERSION: usize = 8;
const KERNEL_HASH_PREFIX: usize = 8;

/// When we serialize/deserialize circuits, we rely on the hash of the plonky
/// kernel to determine if the circuit is compatible with our current binary. If
/// the kernel hash of the circuit that we are loading in from disk differs,
/// then using these circuits could potentially lead to incorrect results (but
/// most likely just a crash).
pub static CIRCUIT_VERSION: Lazy<String> =
Lazy::new(|| hex::encode(KERNEL.hash())[..NUM_HASH_NIBS_TO_USE_IN_CIRCUIT_VERSION].to_string());
Lazy::new(|| hex::encode(KERNEL.hash())[..KERNEL_HASH_PREFIX].to_string());

fn get_serializers() -> (
DefaultGateSerializer,
Expand Down
2 changes: 1 addition & 1 deletion zero_bin/leader/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::io;
use std::{env, io};
use std::{fs::File, path::PathBuf};

use anyhow::Result;
Expand Down

0 comments on commit 3f3a66c

Please sign in to comment.