DELPHINUS-ZKWASM
  • ZKWASM-Book
  • ZKWASM for beginners
    • Quick Start
      • Setup & Build the ZKWASM binary
      • Prepare WASM Image
      • Setup ZKWASM circuit
      • Prove WASM execution
      • Aggregate (Batch) proofs
    • Host(Builtin) Functions
      • IO Functions
      • State Related Functions
      • Poseidon Signature
  • Build a Rollup Application
    • Rollup Application Sketch
    • Writing ZKWASM Application
      • Debug Execution Trace Size of Your Code
    • Proof Generation Architectrue
      • Segment Proof Generation
      • Batch ZKWASM proofs
      • Continuation Proof of Segments
    • Build a Rollup Protocol
  • Circuit Design
    • ZKWASM Circuits
      • Guest Circut
      • Host Circuits.
      • Aggregation(Batch) Circuit
  • ZKWASM Cloud Service
    • Typescript SDK for connecting with ZKWASM cloud.
  • MISC Q&A
Powered by GitBook
On this page
  • Motivation
  • Example of code in zkWasm-rust sdk:
  1. Build a Rollup Application
  2. Writing ZKWASM Application

Debug Execution Trace Size of Your Code

PreviousWriting ZKWASM ApplicationNextProof Generation Architectrue

Last updated 1 year ago

Motivation

Execution trace size is critical to the performance of generating zk proof. This doc provides a way to print out the execution trace size of any code when running prove.

Example of code in :

extern "C" {
    pub fn wasm_dbg(v:u64);
    pub fn wasm_trace_size() -> u64;
}
pub fn zkmain() {
  int traceSize = wasm_trace_size();
  // TODO: Insert your code here
  wasm_dbg(wasm_trace_size() - traceSize);
}

By compiling the code into a WASM image, you can follow to run prove on the WASM image. The trace size of your code will show up in cli output.

Alternatively, you can submit your prove task to , and the wasm_dbg info will show up in the Debug Logs section in the task overview page.

zkWasm-rust sdk
here
zkwasmhub