RISC-V: Stepper can produce proof
Closes RV-338.
What
This MR enables the PVM stepper to produce a proof and check that the initial state hash of a proof is the hash of the state on which it was produced.
Why
In order to validate proof production.
How
By using the existing mechanism of obtaining a PVM state managed by the proof-generating backend from the node PVM in the stepper. The stepper's produce_proof function can then start proof generation, step, and obtain the proof.
Prerequisites for making this work are organised by commit:
- Tighten wrapped manager bounds for
ProofGen<M>backend - Redefine
Merkleiseimplementations onRef<'_, ProofGen<M>>instead ofProofGen<M> -
Prooftype exposes the initial state hash directly
Manually Testing
make -C src/riscv all
In addition, during this test the proof should be successfully generated and the initial state hash should match. It should only fail once it attempts to check the final state hash of the proof, which is currently dummy.
cargo test -- test_jstz_proofs --ignored
Benchmarking
This MR has no impact on performance.
Tasks for the Author
-
Link all Linear issues related to this MR using magic words (e.g. part of, relates to, closes). -
Eliminate dead code and other spurious artefacts introduced in your changes. -
Document new public functions, methods and types. -
Make sure the documentation for updated functions, methods, and types is correct. -
Add tests for bugs that have been fixed. -
Put in reasonable effort to ensure that CI will pass. make -C src/riscvdune build src/lib_riscvdune build src/rust_deps
-
Benchmark performance and populate the table above if needed. -
Explain changes to regression test captures when applicable. -
Write commit messages to reflect the changes they're about. -
Self-review your changes to ensure they are high-quality. -
Complete all of the above before assigning this MR to reviewers.
Edited by Victor Dumitrescu