cycle-tracker
macro which can be used to annotate functions that run inside the risc0 vm[features]
bench = ["sov-zk-cycle-macros/bench","sov-zk-cycle-utils", "risc0-zkvm","risc0-zkvm-platform"]
* The feature gating is needed because we don't want the cycle tracker scaffolding to be used unless the `bench` feature is enabled
* If the `bench` feature is not enabled, the risc0 host will not be built with the necessary syscalls to support tracking cycles
* The additional imports are necessary because the macro wraps the user function with the necessary code for tracking the number of cycles before and after the function execution
* The rust code that needs to use the `cycle_tracker` macro needs to import it and then annotate the function with it
rust,ignore
//
use sovzkcyclemacros::cycletracker; // //
fn beginslot(
&mut self,
slotdata: &impl SlotData
let mut working_set = state_checkpoint.to_revertable();
self.runtime.begin_slot_hook(slot_data, &mut working_set);
self.checkpoint = Some(working_set.checkpoint());
} ```