feat: Add E2E zkVM proof tests with RISC Zero integration#11
Merged
Conversation
- Add methods crate for building zkVM guest ELF and exporting IMAGE_ID - Add zkvm-guest wrapper crate for risc0-build compatibility - Add e2e-tests crate with feature-gated proof generation tests - Add agent code hash binding (build.rs generates AGENT_CODE_HASH) - Add spec/e2e-tests.md specification document - Update README with E2E testing and on-chain verification sections Test cases: - test_e2e_success_with_echo: Happy path with proof generation - test_e2e_agent_code_hash_mismatch: Security validation - test_e2e_empty_output: Empty output commitment verification - test_e2e_determinism: Deterministic execution verification On-chain data extraction: - seal (256 bytes Groth16 proof) - journal (KernelJournalV1 bytes) - imageId (bytes32 guest identity)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
methodscrate for building zkVM guest ELF and exportingZKVM_GUEST_ELF/ZKVM_GUEST_IDzkvm-guestwrapper crate for risc0-build compatibilitye2e-testscrate with feature-gated proof generation testsbuild.rsgeneratesAGENT_CODE_HASHat compile time)spec/e2e-tests.mdspecification documentTest Cases
test_e2e_success_with_echotest_e2e_agent_code_hash_mismatchtest_e2e_empty_outputtest_e2e_determinismOn-Chain Verification Data
Extracts data needed for Solidity verifier:
seal(256 bytes Groth16 proof)journal(KernelJournalV1 bytes)imageId(bytes32 guest identity)Test Plan
cargo test -p e2e-testspasses (unit tests, no RISC Zero required)cargo test -p host-testspasses (92 tests, no regressions)cargo test -p e2e-tests --features risc0-e2e test_e2e_success_with_echogenerates valid proofcargo test -p e2e-tests --features risc0-e2e test_e2e_agent_code_hash_mismatchcorrectly failscargo test -p e2e-tests --features risc0-e2e test_e2e_empty_outputgenerates valid proof