Skip to content

Commit

Permalink
failing on certain blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
ratankaliani committed Jul 19, 2024
1 parent c0e32d9 commit 91c785a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions zkvm-host/bin/cost_estimator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ async fn main() -> Result<()> {
run_native_host(&native_execution_data).await?;
}

println!("Ran native host for block {}", block_num);

// Execute the Kona program.
let report = execute_kona_program(&block_data.into());

Expand Down
5 changes: 4 additions & 1 deletion zkvm-host/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ pub fn load_kv_store(data_dir: &PathBuf) -> HashMap<[u8; 32], Vec<u8>, BytesHash

fn get_file_count(data_dir: &PathBuf) -> usize {
let mut file_count = 0;
for entry in fs::read_dir(data_dir).expect("failed to read data dir") {
for entry in fs::read_dir(data_dir).expect(&format!(
"failed to read data dir {}",
data_dir.to_str().unwrap()
)) {
let entry = entry.unwrap();
if entry.metadata().unwrap().is_file() {
file_count += 1;
Expand Down
7 changes: 6 additions & 1 deletion zkvm-host/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ pub mod fetcher;
pub mod helpers;

use alloy_primitives::B256;
use cargo_metadata::MetadataCommand;
use fetcher::NativeExecutionBlockData;
use sp1_core::runtime::ExecutionReport;
use sp1_sdk::{PlonkBn254Proof, ProverClient, SP1ProofWithPublicValues, SP1Stdin};
Expand Down Expand Up @@ -71,7 +72,11 @@ fn get_kona_program_input(boot_info: &BootInfoWithoutRollupConfig) -> SP1Stdin {
stdin.write(&boot_info);

// Read KV store into raw bytes and pass to stdin.
let kv_store = load_kv_store(&format!("../data/{}", boot_info.l2_claim_block).into());
let metadata = MetadataCommand::new().exec().unwrap();
let workspace_root = metadata.workspace_root;
let data_directory = format!("{}/data/{}", workspace_root, boot_info.l2_claim_block);

let kv_store = load_kv_store(&data_directory.into());

let mut serializer = CompositeSerializer::new(
AlignedSerializer::new(AlignedVec::new()),
Expand Down

0 comments on commit 91c785a

Please sign in to comment.