From 52d5a67a1b8d8cd9e2741aca2ece88ee494583bf Mon Sep 17 00:00:00 2001 From: "xingqiang.yuan" Date: Thu, 16 Nov 2023 19:10:14 +0800 Subject: [PATCH] update --- crates/zkwasm/src/loader/mod.rs | 6 +----- crates/zkwasm/src/runtime/wasmi_interpreter.rs | 6 +++--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/crates/zkwasm/src/loader/mod.rs b/crates/zkwasm/src/loader/mod.rs index 0e6b9cc13..dad7d688e 100644 --- a/crates/zkwasm/src/loader/mod.rs +++ b/crates/zkwasm/src/loader/mod.rs @@ -181,7 +181,7 @@ impl ZkWasmLoader { compiled_module.dry_run(&mut env) } - pub fn dry_run_trace_count(&self, arg: ExecutionArg) -> Result> { + pub fn dry_run_trace_count(&self, arg: ExecutionArg) -> Result<(Option, usize)> { let (mut env, _) = HostEnv::new_with_full_foreign_plugins( arg.public_inputs, arg.private_inputs, @@ -356,7 +356,3 @@ mod tests { } } } - -pub fn get_trace_count() -> usize { - return wasmi::tracer::phantom::get_trace_count(); -} \ No newline at end of file diff --git a/crates/zkwasm/src/runtime/wasmi_interpreter.rs b/crates/zkwasm/src/runtime/wasmi_interpreter.rs index bdfc528ad..775cf5011 100644 --- a/crates/zkwasm/src/runtime/wasmi_interpreter.rs +++ b/crates/zkwasm/src/runtime/wasmi_interpreter.rs @@ -36,7 +36,7 @@ impl WasmRuntimeIO { pub trait Execution { fn dry_run(self, externals: &mut E) -> Result>; - fn dry_run_trace_count(self, externals: &mut E) -> Result>; + fn dry_run_trace_count(self, externals: &mut E) -> Result<(Option, usize)>; fn run( self, @@ -56,14 +56,14 @@ impl Execution Ok(result) } - fn dry_run_trace_count(self, externals: &mut E) -> Result> { + fn dry_run_trace_count(self, externals: &mut E) -> Result<(Option, usize)> { let instance = self.instance.run_start(externals).unwrap(); let result = instance.invoke_export_trace_count( &self.entry, &[], externals, self.tracer.clone() )?; - Ok(result) + Ok((result, wasmi::tracer::phantom::get_trace_count())) } fn run(