modularize example state machine code for generic usage#89
modularize example state machine code for generic usage#89chung-thai-nguyen wants to merge 2 commits into
Conversation
d8541fa to
b91deb5
Compare
chiro-hiro
left a comment
There was a problem hiding this comment.
Thanks for the refactor — extracting StandardStateMachine/StandardInstruction into default_state_machine.rs is a good structural improvement and the $crate macro fix is a real correctness win.
A few things to address before merging:
-
Dead RNG call (
randomize.gen_range(u64::MAX / 2..u64::MAX)with the result discarded) appears in both the test indefault_state_machine.rsand in256bits-machine.rs. Remove the line or assign it if you intend to use it. -
Typo in example output:
"Intruction: {:?}"→"Instruction: {:?}"in256bits-machine.rs. -
memory-consistencyexample removed with no replacement: renamingexamples/memory-consistency.rsto a library source file removes a runnable example. If this was intentional, please add a note to the README and check any CI jobs that rancargo run --example memory-consistency. -
assert_eq!(sections.len(), 3)is always true at compile time. Not a bug, but it adds no test value.
[x] Move existing VM-related structs into a separate file for quick usage at
zkmemory/src/default_state_machine.rs