From 1a1d094eba5bd63f784f9817a9163779f08fe3eb Mon Sep 17 00:00:00 2001 From: Tomas Szejnfeld Sirkis Date: Mon, 6 Apr 2026 18:05:57 -0300 Subject: [PATCH 1/2] Refactor checkpoint handling in prover and verifier functions --- emulator/src/decision/challenge.rs | 83 ++++++++------ emulator/src/loader/program_definition.rs | 24 +++-- emulator/src/main.rs | 125 +++++++++++++++------- emulator/tests/challenge.rs | 6 +- 4 files changed, 156 insertions(+), 82 deletions(-) diff --git a/emulator/src/decision/challenge.rs b/emulator/src/decision/challenge.rs index 03d9358..122b5b8 100644 --- a/emulator/src/decision/challenge.rs +++ b/emulator/src/decision/challenge.rs @@ -25,7 +25,8 @@ use super::execution_log::{ExecutionLog, ProverChallengeLog}; pub fn prover_execute( program_definition_file: &str, input: Vec, - checkpoint_path: &str, + checkpoint_input_path: &str, + checkpoint_output_path: &str, force: bool, fail_config: Option, save_non_checkpoint_steps: bool, @@ -40,7 +41,8 @@ pub fn prover_execute( let program_def = ProgramDefinition::from_config(program_definition_file)?; let (result, mut last_step, mut last_hash) = program_def.get_execution_result( input.clone(), - checkpoint_path, + checkpoint_input_path, + checkpoint_output_path, fail_config, save_non_checkpoint_steps, )?; @@ -66,20 +68,21 @@ pub fn prover_execute( ExecutionLog::new(result.clone(), last_step, last_hash.clone()), input, ) - .save(checkpoint_path)?; + .save(checkpoint_output_path)?; Ok((result, last_step, last_hash)) } pub fn prover_get_hashes_for_round( program_definition_file: &str, - checkpoint_path: &str, + input_checkpoint_path: &str, + output_checkpoint_path: &str, round: u8, verifier_decision: u32, fail_config: Option, nary_type: NArySearchType, ) -> Result, EmulatorError> { - let mut challenge_log = ProverChallengeLog::load(checkpoint_path)?; + let mut challenge_log = ProverChallengeLog::load(input_checkpoint_path)?; let last_step = challenge_log.execution.last_step; let input = challenge_log.input.clone(); let nary_log = challenge_log.get_nary_log(nary_type); @@ -96,7 +99,8 @@ pub fn prover_get_hashes_for_round( nary_log.base_step = new_base; let hashes = program_def.get_round_hashes( - checkpoint_path, + input_checkpoint_path, + output_checkpoint_path, input, round, nary_log.base_step, @@ -115,14 +119,15 @@ pub fn prover_get_hashes_for_round( .hash_rounds .push(hashes.clone()); } - challenge_log.save(checkpoint_path)?; + challenge_log.save(output_checkpoint_path)?; Ok(hashes) } pub fn verifier_check_execution( program_definition_file: &str, input: Vec, - checkpoint_path: &str, + input_checkpoint_path: &str, + output_checkpoint_path: &str, claim_last_step: u64, claim_last_hash: &str, force_condition: ForceCondition, @@ -132,7 +137,8 @@ pub fn verifier_check_execution( let program_def = ProgramDefinition::from_config(program_definition_file)?; let (result, last_step, last_hash) = program_def.get_execution_result( input.clone(), - checkpoint_path, + input_checkpoint_path, + output_checkpoint_path, fail_config, save_non_checkpoint_steps, )?; @@ -175,20 +181,21 @@ pub fn verifier_check_execution( input, step_to_challenge, ); - challenge_log.save(checkpoint_path)?; + challenge_log.save(output_checkpoint_path)?; Ok(Some(step_to_challenge)) } pub fn verifier_choose_segment( program_definition_file: &str, - checkpoint_path: &str, + input_checkpoint_path: &str, + output_checkpoint_path: &str, round: u8, prover_last_hashes: Vec, fail_config: Option, nary_type: NArySearchType, ) -> Result { - let mut challenge_log = VerifierChallengeLog::load(checkpoint_path)?; + let mut challenge_log = VerifierChallengeLog::load(input_checkpoint_path)?; let input = challenge_log.input.clone(); let conflict_step = match nary_type { @@ -200,7 +207,8 @@ pub fn verifier_choose_segment( let program_def = ProgramDefinition::from_config(program_definition_file)?; let hashes = program_def.get_round_hashes( - checkpoint_path, + input_checkpoint_path, + output_checkpoint_path, input, round, nary_log.base_step, @@ -226,7 +234,7 @@ pub fn verifier_choose_segment( nary_log.verifier_decisions.push(bits); nary_log.prover_hash_rounds.push(prover_last_hashes); nary_log.verifier_hash_rounds.push(hashes); - challenge_log.save(checkpoint_path)?; + challenge_log.save(output_checkpoint_path)?; info!("Verifier selects bits: {bits} base: {base} selection: {new_selected}"); @@ -250,11 +258,12 @@ pub fn verifier_choose_segment( pub fn prover_final_trace( program_definition_file: &str, - checkpoint_path: &str, + input_checkpoint_path: &str, + output_checkpoint_path: &str, final_bits: u32, fail_config: Option, ) -> Result { - let mut challenge_log = ProverChallengeLog::load(checkpoint_path)?; + let mut challenge_log = ProverChallengeLog::load(input_checkpoint_path)?; let input = challenge_log.input.clone(); let nary_log = challenge_log.get_nary_log(NArySearchType::ConflictStep); @@ -266,7 +275,7 @@ pub fn prover_final_trace( nary_log.base_step = final_step; nary_log.verifier_decisions.push(final_bits - 1); - challenge_log.save(checkpoint_path)?; + challenge_log.save(input_checkpoint_path)?; if let ProverHashesAndStepType::HashesAndStep { step_hash, @@ -274,17 +283,17 @@ pub fn prover_final_trace( step, } = prover_get_hashes_and_step( program_definition_file, - checkpoint_path, + input_checkpoint_path, NArySearchType::ConflictStep, None, fail_config.clone(), )? { info!("The prover needs to provide the full trace for the selected step {final_step}"); let final_trace = - program_def.get_trace_step(checkpoint_path, input, final_step, fail_config)?; + program_def.get_trace_step(input_checkpoint_path, output_checkpoint_path, input, final_step, fail_config)?; let nary_log = challenge_log.get_nary_log(NArySearchType::ConflictStep); nary_log.final_trace = final_trace.clone(); - challenge_log.save(checkpoint_path)?; + challenge_log.save(output_checkpoint_path)?; Ok(ProverFinalTraceType::FinalTraceWithHashesAndStep { trace: final_trace, @@ -299,12 +308,12 @@ pub fn prover_final_trace( pub fn prover_get_hashes_and_step( program_definition_file: &str, - checkpoint_path: &str, + input_checkpoint_path: &str, nary_type: NArySearchType, final_bits: Option, fail_config: Option, ) -> Result { - let mut challenge_log = ProverChallengeLog::load(checkpoint_path)?; + let mut challenge_log = ProverChallengeLog::load(input_checkpoint_path)?; let last_step = challenge_log.execution.last_step; let conflict_step = challenge_log.conflict_step_log.base_step - 1; let nary_log = challenge_log.get_nary_log(nary_type); @@ -417,7 +426,8 @@ fn find_chunk_index(chunks: &[Chunk], address: u32) -> Option { pub fn verifier_choose_challenge( program_definition_file: &str, - checkpoint_path: &str, + input_checkpoint_path: &str, + output_checkpoint_path: &str, trace: TraceRWStep, resigned_step_hash: &str, resigned_next_hash: &str, @@ -429,7 +439,7 @@ pub fn verifier_choose_challenge( let mut program = program_def.load_program()?; let nary_def = program_def.nary_def(); - let mut verifier_log = VerifierChallengeLog::load(checkpoint_path)?; + let mut verifier_log = VerifierChallengeLog::load(input_checkpoint_path)?; let conflict_step_log = &mut verifier_log.conflict_step_log; conflict_step_log.final_trace = trace.clone(); @@ -543,7 +553,8 @@ pub fn verifier_choose_challenge( //obtain all the steps needed let my_execution = program_def .execute_helper( - checkpoint_path, + input_checkpoint_path, + output_checkpoint_path, verifier_log.input.clone(), Some(steps), fail_config.clone(), @@ -761,7 +772,7 @@ pub fn verifier_choose_challenge( verifier_log.read_step = step_to_challenge - 1; verifier_log.read_selector = read_selector; - verifier_log.save(checkpoint_path)?; + verifier_log.save(output_checkpoint_path)?; let fail_selection = fail_config.and_then(|fail_config| { fail_config @@ -779,13 +790,14 @@ pub fn verifier_choose_challenge( return Ok(ChallengeType::ReadValueNArySearch { bits }); } } - verifier_log.save(checkpoint_path)?; + verifier_log.save(output_checkpoint_path)?; Ok(ChallengeType::No) } pub fn verifier_choose_challenge_for_read_challenge( program_definition_file: &str, - checkpoint_path: &str, + input_checkpoint_path: &str, + output_checkpoint_path: &str, resigned_step_hash: &str, resigned_next_hash: &str, fail_config: Option, @@ -794,7 +806,7 @@ pub fn verifier_choose_challenge_for_read_challenge( ) -> Result { let program_def = ProgramDefinition::from_config(program_definition_file)?; let nary_def = program_def.nary_def(); - let verifier_log = VerifierChallengeLog::load(checkpoint_path)?; + let verifier_log = VerifierChallengeLog::load(input_checkpoint_path)?; let read_challenge_log = verifier_log.read_challenge_log; let conflict_step_log = verifier_log.conflict_step_log; @@ -875,7 +887,8 @@ pub fn verifier_choose_challenge_for_read_challenge( let my_execution = program_def .execute_helper( - checkpoint_path, + input_checkpoint_path, + output_checkpoint_path, verifier_log.input.clone(), Some(vec![challenge_step + 1]), fail_config, @@ -1045,6 +1058,7 @@ mod tests { pdf, input.clone(), chk_prover_path, + chk_prover_path, true, fail_config_prover.clone(), false, @@ -1057,6 +1071,7 @@ mod tests { pdf, input, chk_verifier_path, + chk_verifier_path, result_1.1, &result_1.2, force_condition, @@ -1073,6 +1088,7 @@ mod tests { let hashes = prover_get_hashes_for_round( pdf, chk_prover_path, + chk_prover_path, round, v_decision, fail_config_prover.clone(), @@ -1084,6 +1100,7 @@ mod tests { v_decision = verifier_choose_segment( pdf, chk_verifier_path, + chk_verifier_path, round, hashes, fail_config_verifier.clone(), @@ -1098,7 +1115,7 @@ mod tests { //PROVER PROVIDES EXECUTE STEP (and reveals full_trace) //Use v_desision + 1 as v_decision defines the last agreed step let (final_trace, step_hash, next_hash, _) = - prover_final_trace(pdf, chk_prover_path, v_decision + 1, fail_config_prover) + prover_final_trace(pdf, chk_prover_path, chk_prover_path, v_decision + 1, fail_config_prover) .unwrap() .as_final_trace_with_hashes_and_step() .unwrap(); @@ -1118,6 +1135,7 @@ mod tests { let challenge = verifier_choose_challenge( pdf, chk_verifier_path, + chk_verifier_path, final_trace, step_hash.as_str(), next_hash.as_str(), @@ -1134,6 +1152,7 @@ mod tests { let hashes = prover_get_hashes_for_round( pdf, chk_prover_path, + chk_prover_path, round, v_decision, fail_config_prover_read_challenge.clone(), @@ -1145,6 +1164,7 @@ mod tests { v_decision = verifier_choose_segment( pdf, chk_verifier_path, + chk_verifier_path, round, hashes, fail_config_verifier_read_challenge.clone(), @@ -1168,6 +1188,7 @@ mod tests { verifier_choose_challenge_for_read_challenge( pdf, chk_verifier_path, + chk_verifier_path, resigned_step_hash.as_str(), resigned_next_hash.as_str(), fail_config_verifier_read_challenge, diff --git a/emulator/src/loader/program_definition.rs b/emulator/src/loader/program_definition.rs index f2ab47a..d6e5bc7 100644 --- a/emulator/src/loader/program_definition.rs +++ b/emulator/src/loader/program_definition.rs @@ -84,16 +84,17 @@ impl ProgramDefinition { pub fn execute_helper( &self, - checkpoint_path: &str, + input_checkpoint_path: &str, + output_checkpoint_path: &str, input_data: Vec, steps: Option>, fail_config: Option, save_non_checkpoint_steps: bool, ) -> Result<(ExecutionResult, FullTrace), EmulatorError> { - let checkpoint_path_str = checkpoint_path.to_string(); + let checkpoint_path_str = output_checkpoint_path.to_string(); let (mut program, checkpoint_path, output_trace) = match &steps { Some(steps) => ( - self.load_program_from_checkpoint(checkpoint_path, steps[0])?, + self.load_program_from_checkpoint(input_checkpoint_path, steps[0])?, None, true, ), @@ -124,12 +125,14 @@ impl ProgramDefinition { pub fn get_execution_result( &self, input_data: Vec, - checkpoint_path: &str, + input_checkpoint_path: &str, + output_checkpoint_path: &str, fail_config: Option, save_non_checkpoint_steps: bool, ) -> Result<(ExecutionResult, u64, String), EmulatorError> { let (result, trace) = self.execute_helper( - checkpoint_path, + input_checkpoint_path, + output_checkpoint_path, input_data, None, fail_config, @@ -152,7 +155,8 @@ impl ProgramDefinition { // After the nary search finishes, the prover can challenge this. pub fn get_round_hashes( &self, - checkpoint_path: &str, + input_checkpoint_path: &str, + output_checkpoint_path: &str, input: Vec, round: u8, base: u64, @@ -172,7 +176,8 @@ impl ProgramDefinition { steps.insert(0, base); //asks base step as it should be always obtainable let (_result, trace) = self.execute_helper( - checkpoint_path, + input_checkpoint_path, + output_checkpoint_path, input, Some(steps), fail_config.clone(), @@ -219,14 +224,15 @@ impl ProgramDefinition { pub fn get_trace_step( &self, - checkpoint_path: &str, + input_checkpoint_path: &str, + output_checkpoint_path: &str, input: Vec, step: u64, fail_config: Option, ) -> Result { let steps = vec![step]; let (_result, trace) = - self.execute_helper(checkpoint_path, input, Some(steps), fail_config, false)?; + self.execute_helper(input_checkpoint_path, output_checkpoint_path, input, Some(steps), fail_config, false)?; // at least the base step should be present if trace.len() == 0 { return Err(EmulatorError::CantObtainTrace); diff --git a/emulator/src/main.rs b/emulator/src/main.rs index 5c37eaf..743c8b4 100644 --- a/emulator/src/main.rs +++ b/emulator/src/main.rs @@ -42,9 +42,13 @@ enum Commands { #[arg(short, long, value_name = "INPUT (hex)")] input: String, - /// Checkpoint path + /// Checkpoint input path #[arg(short, long, value_name = "CHECKPOINT_PROVER_PATH")] - checkpoint_prover_path: String, + checkpoint_input_prover_path: String, + + /// Checkpoint output path + #[arg(short, long, value_name = "CHECKPOINT_PROVER_PATH")] + checkpoint_output_prover_path: String, /// Force #[arg(short, long, default_value = "true")] @@ -72,9 +76,13 @@ enum Commands { #[arg(short, long, value_name = "INPUT (hex)")] input: String, - /// Checkpoint path - #[arg(short, long, value_name = "CHECKPOINT_VERIFIER_PATH")] - checkpoint_verifier_path: String, + /// Checkpoint input path + #[arg(short, long, value_name = "CHECKPOINT_VERIFIER_INPUT_PATH")] + checkpoint_verifier_input_path: String, + + /// Checkpoint output path + #[arg(short, long, value_name = "CHECKPOINT_VERIFIER_OUTPUT_PATH")] + checkpoint_verifier_output_path: String, /// Claim last step #[arg(short, long, value_name = "CLAIM_LAST_STEP")] @@ -106,9 +114,13 @@ enum Commands { #[arg(short, long, value_name = "FILE")] pdf: String, - /// Checkpoint prover path - #[arg(short, long, value_name = "CHECKPOINT_PROVER_PATH")] - checkpoint_prover_path: String, + /// Checkpoint input path + #[arg(short, long, value_name = "CHECKPOINT_PROVER_INPUT_PATH")] + checkpoint_input_prover_path: String, + + /// Checkpoint output path + #[arg(short, long, value_name = "CHECKPOINT_PROVER_OUTPUT_PATH")] + checkpoint_output_prover_path: String, /// Round number #[arg(short, long, value_name = "ROUND_NUMBER")] @@ -136,9 +148,13 @@ enum Commands { #[arg(short, long, value_name = "FILE")] pdf: String, - /// Checkpoint verifier path - #[arg(short, long, value_name = "CHECKPOINT_VERIFIER_PATH")] - checkpoint_verifier_path: String, + /// Checkpoint verifier input path + #[arg(short, long, value_name = "CHECKPOINT_VERIFIER_INPUT_PATH")] + checkpoint_verifier_input_path: String, + + /// Checkpoint verifier output path + #[arg(short, long, value_name = "CHECKPOINT_VERIFIER_OUTPUT_PATH")] + checkpoint_verifier_output_path: String, /// Round number #[arg(short, long, value_name = "ROUND_NUMBER")] @@ -166,9 +182,13 @@ enum Commands { #[arg(short, long, value_name = "FILE")] pdf: String, - /// Checkpoint prover path - #[arg(short, long, value_name = "CHECKPOINT_PROVER_PATH")] - checkpoint_prover_path: String, + /// Checkpoint prover input path + #[arg(short, long, value_name = "CHECKPOINT_PROVER_INPUT_PATH")] + checkpoint_input_prover_path: String, + + /// Checkpoint prover output path + #[arg(short, long, value_name = "CHECKPOINT_PROVER_OUTPUT_PATH")] + checkpoint_output_prover_path: String, /// Verifier decision #[arg(short, long, value_name = "VERIFIER_DECISION")] @@ -209,9 +229,13 @@ enum Commands { #[arg(short, long, value_name = "FILE")] pdf: String, - /// Checkpoint verifier path - #[arg(short, long, value_name = "CHECKPOINT_VERIFIER_PATH")] - checkpoint_verifier_path: String, + /// Checkpoint verifier input path + #[arg(short, long, value_name = "CHECKPOINT_VERIFIER_INPUT_PATH")] + checkpoint_verifier_input_path: String, + + /// Checkpoint verifier output path + #[arg(short, long, value_name = "CHECKPOINT_VERIFIER_OUTPUT_PATH")] + checkpoint_verifier_output_path: String, /// Prover final trace #[arg(short, long, value_name = "PROVER_FINAL_TRACE")] @@ -241,9 +265,13 @@ enum Commands { #[arg(short, long, value_name = "FILE")] pdf: String, - /// Checkpoint verifier path - #[arg(short, long, value_name = "CHECKPOINT_VERIFIER_PATH")] - checkpoint_verifier_path: String, + /// Checkpoint verifier input path + #[arg(short, long, value_name = "CHECKPOINT_VERIFIER_INPUT_PATH")] + checkpoint_verifier_input_path: String, + + /// Checkpoint verifier output path + #[arg(short, long, value_name = "CHECKPOINT_VERIFIER_OUTPUT_PATH")] + checkpoint_verifier_output_path: String, /// Fail Configuration #[arg(short, long, value_name = "FailConfigVerifier")] @@ -333,9 +361,13 @@ enum Commands { #[arg(long)] sections: bool, - /// Checkpoint path + /// Checkpoint input path #[arg(short, long)] - checkpoint_path: Option, + checkpoint_input_path: Option, + + /// Checkpoint output path + #[arg(short, long)] + checkpoint_output_path: Option, /// Fail producing hash for a specific step #[arg(long)] @@ -436,7 +468,8 @@ fn main() -> Result<(), EmulatorError> { stdout, debug, sections, - checkpoint_path, + checkpoint_input_path, + checkpoint_output_path, fail_hash, fail_hash_until, fail_execute: fail_execute_args, @@ -475,7 +508,7 @@ fn main() -> Result<(), EmulatorError> { } None => { let step = step.expect("Step is expected"); - let path = checkpoint_path + let path = checkpoint_input_path .as_ref() .expect("Checkpoint path is expected"); let program = Program::deserialize_from_file(path, step)?; @@ -531,7 +564,7 @@ fn main() -> Result<(), EmulatorError> { input, &input_section.clone().unwrap_or(".input".to_string()), *input_as_little, - &checkpoint_path, + &checkpoint_output_path, *limit, *trace, *verify, @@ -550,7 +583,8 @@ fn main() -> Result<(), EmulatorError> { Some(Commands::ProverExecute { pdf, input, - checkpoint_prover_path, + checkpoint_input_prover_path, + checkpoint_output_prover_path, force, fail_config_prover, command_file, @@ -560,7 +594,8 @@ fn main() -> Result<(), EmulatorError> { let result = prover_execute( pdf, input_bytes.clone(), - checkpoint_prover_path, + checkpoint_input_prover_path, + checkpoint_output_prover_path, *force, fail_config_prover.clone(), *save_non_checkpoint_steps, @@ -586,7 +621,8 @@ fn main() -> Result<(), EmulatorError> { Some(Commands::VerifierCheckExecution { pdf, input, - checkpoint_verifier_path, + checkpoint_verifier_input_path, + checkpoint_verifier_output_path, claim_last_step, claim_last_hash, force, @@ -598,7 +634,8 @@ fn main() -> Result<(), EmulatorError> { let result = verifier_check_execution( pdf, input_bytes.clone(), - checkpoint_verifier_path, + checkpoint_verifier_input_path, + checkpoint_verifier_output_path, *claim_last_step, claim_last_hash, force.clone(), @@ -615,7 +652,8 @@ fn main() -> Result<(), EmulatorError> { } Some(Commands::ProverGetHashesForRound { pdf, - checkpoint_prover_path, + checkpoint_input_prover_path, + checkpoint_output_prover_path, round_number, v_decision, fail_config_prover, @@ -624,7 +662,8 @@ fn main() -> Result<(), EmulatorError> { }) => { let result = prover_get_hashes_for_round( pdf, - checkpoint_prover_path, + checkpoint_input_prover_path, + checkpoint_output_prover_path, *round_number, *v_decision, fail_config_prover.clone(), @@ -643,7 +682,8 @@ fn main() -> Result<(), EmulatorError> { } Some(Commands::VerifierChooseSegment { pdf, - checkpoint_verifier_path, + checkpoint_verifier_input_path, + checkpoint_verifier_output_path, round_number, hashes, fail_config_verifier, @@ -652,7 +692,8 @@ fn main() -> Result<(), EmulatorError> { }) => { let result = verifier_choose_segment( pdf, - checkpoint_verifier_path, + checkpoint_verifier_input_path, + checkpoint_verifier_output_path, *round_number, hashes.clone(), fail_config_verifier.clone(), @@ -671,14 +712,16 @@ fn main() -> Result<(), EmulatorError> { } Some(Commands::ProverFinalTrace { pdf, - checkpoint_prover_path, + checkpoint_input_prover_path, + checkpoint_output_prover_path, v_decision, fail_config_prover, command_file, }) => { let prover_final_trace = prover_final_trace( pdf, - checkpoint_prover_path, + checkpoint_input_prover_path, + checkpoint_output_prover_path, *v_decision, fail_config_prover.clone(), )?; @@ -693,7 +736,8 @@ fn main() -> Result<(), EmulatorError> { } Some(Commands::VerifierChooseChallenge { pdf, - checkpoint_verifier_path, + checkpoint_verifier_input_path, + checkpoint_verifier_output_path, prover_final_trace, resigned_step_hash, resigned_next_hash, @@ -703,7 +747,8 @@ fn main() -> Result<(), EmulatorError> { }) => { let result = verifier_choose_challenge( pdf, - checkpoint_verifier_path, + checkpoint_verifier_input_path, + checkpoint_verifier_output_path, prover_final_trace.clone(), resigned_step_hash, resigned_next_hash, @@ -723,7 +768,8 @@ fn main() -> Result<(), EmulatorError> { } Some(Commands::VerifierChooseChallengeForReadChallenge { pdf, - checkpoint_verifier_path, + checkpoint_verifier_input_path, + checkpoint_verifier_output_path, fail_config_verifier, resigned_step_hash, resigned_next_hash, @@ -732,7 +778,8 @@ fn main() -> Result<(), EmulatorError> { }) => { let result = verifier_choose_challenge_for_read_challenge( pdf, - checkpoint_verifier_path, + checkpoint_verifier_input_path, + checkpoint_verifier_output_path, resigned_step_hash, resigned_next_hash, fail_config_verifier.clone(), diff --git a/emulator/tests/challenge.rs b/emulator/tests/challenge.rs index 3f90ab8..fc68806 100644 --- a/emulator/tests/challenge.rs +++ b/emulator/tests/challenge.rs @@ -21,7 +21,7 @@ fn test_nary_search_trace_aux(input: u8, expect_err: bool, checkpoint_path: &str let defs = program_def.nary_def(); let input = vec![17, 17, 17, input]; let (_bad_result, last_step, _last_hash) = program_def - .get_execution_result(input.clone(), checkpoint_path, None, true) + .get_execution_result(input.clone(), checkpoint_path, checkpoint_path, None, true) .unwrap(); let challenge_selected_step = last_step.min(1500); @@ -34,7 +34,7 @@ fn test_nary_search_trace_aux(input: u8, expect_err: bool, checkpoint_path: &str for round in 1..defs.total_rounds() + 1 { info!("Prover gets the steps required by the n-ary search round: {round}"); let reply_hashes = program_def - .get_round_hashes(checkpoint_path, input.clone(), round, base, None, None) + .get_round_hashes(checkpoint_path, checkpoint_path, input.clone(), round, base, None, None) .unwrap(); //get_hashes(&bad_trace, &steps); info!("Hashes: {:?}", reply_hashes); @@ -59,7 +59,7 @@ fn test_nary_search_trace_aux(input: u8, expect_err: bool, checkpoint_path: &str info!("The prover needs to provide the full trace for the selected step {selected}"); let trace = program_def - .get_trace_step(checkpoint_path, input, selected, None) + .get_trace_step(checkpoint_path, checkpoint_path, input, selected, None) .unwrap(); info!("{:?}", trace.to_csv()); From caaaccf000324721895e821d4ccb82c716fe4de6 Mon Sep 17 00:00:00 2001 From: Tomas Szejnfeld Sirkis Date: Tue, 14 Apr 2026 14:04:22 -0300 Subject: [PATCH 2/2] Rename checkpoint argument paths for clarity in prover commands --- emulator/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emulator/src/main.rs b/emulator/src/main.rs index 743c8b4..2a98982 100644 --- a/emulator/src/main.rs +++ b/emulator/src/main.rs @@ -43,11 +43,11 @@ enum Commands { input: String, /// Checkpoint input path - #[arg(short, long, value_name = "CHECKPOINT_PROVER_PATH")] + #[arg(short, long, value_name = "CHECKPOINT_PROVER_INPUT_PATH")] checkpoint_input_prover_path: String, /// Checkpoint output path - #[arg(short, long, value_name = "CHECKPOINT_PROVER_PATH")] + #[arg(short, long, value_name = "CHECKPOINT_PROVER_OUTPUT_PATH")] checkpoint_output_prover_path: String, /// Force