mirror of
https://github.com/logos-blockchain/lssa-zkvm-testing.git
synced 2026-01-10 01:03:09 +00:00
sp1 naming fixes
This commit is contained in:
parent
46adf34c6f
commit
6291e54247
39
sp1/README.md
Normal file
39
sp1/README.md
Normal file
@ -0,0 +1,39 @@
|
||||
# Test run instructions
|
||||
|
||||
To run corresponding tests in `Valida` some preparations have to be done.
|
||||
|
||||
We assume, that one is in `valida` folder.
|
||||
|
||||
Firstly, move into [scripts_and_tools](./scripts_and_tools/) directory.
|
||||
|
||||
Next, run
|
||||
|
||||
```sh
|
||||
./valida_setup.sh
|
||||
```
|
||||
|
||||
This will fetch all necessary components to build Rist code in `Valida`.
|
||||
|
||||
Next, to prove execution we need to build one of the tests, let`s use [simple_arithmetic_test](./tests/simple_arithmetic_test/) as an example.
|
||||
|
||||
Run
|
||||
|
||||
```sh
|
||||
./build-rust.sh simple_arithmetic_test
|
||||
```
|
||||
|
||||
If run is succsessfull then you will see `simple_arithmetic_test`, `simple_arithmetic_test.ll`, `simple_arithmetic_test.o` files in the scripts directory.
|
||||
|
||||
Next, we need prove execution, to do so run
|
||||
|
||||
```sh
|
||||
./valida_prove.sh simple_arithmetic_test
|
||||
```
|
||||
|
||||
If proof succsessfull, you will see `simple_arithmetic_test.proof` file in scripts derectory.
|
||||
|
||||
If needed, proof can be verified as follows
|
||||
|
||||
```sh
|
||||
./valida_verify.sh simple_arithmetic_test
|
||||
```
|
||||
@ -40,7 +40,7 @@ enum ProofSystem {
|
||||
/// A fixture that can be used to test the verification of SP1 zkVM proofs inside Solidity.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
struct SP1SimpleArithmeticTestProofFixture {
|
||||
struct SP1MemAllocVecTestProofFixture {
|
||||
a: u32,
|
||||
b: u32,
|
||||
n: u32,
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
|
||||
use alloy_sol_types::SolType;
|
||||
use clap::Parser;
|
||||
use simple_arithmetic_test_lib::PublicValuesStruct;
|
||||
use mem_alloc_vec_test_lib::PublicValuesStruct;
|
||||
use sp1_sdk::{ProverClient, SP1Stdin};
|
||||
|
||||
/// The ELF (executable and linkable format) file for the Succinct RISC-V zkVM.
|
||||
@ -65,7 +65,7 @@ fn main() {
|
||||
println!("a: {}", a);
|
||||
println!("b: {}", b);
|
||||
|
||||
let (expected_a, expected_b) = fibonacci_lib::fibonacci(n);
|
||||
let (expected_a, expected_b) = mem_alloc_vec_test_lib::vec_alloc(n);
|
||||
assert_eq!(a, expected_a);
|
||||
assert_eq!(b, expected_b);
|
||||
println!("Values are correct!");
|
||||
@ -74,7 +74,7 @@ fn main() {
|
||||
println!("Number of cycles: {}", report.total_instruction_count());
|
||||
} else {
|
||||
// Setup the program for proving.
|
||||
let (pk, vk) = client.setup(FIBONACCI_ELF);
|
||||
let (pk, vk) = client.setup(MEM_ALLOC_VEC_TEST_ELF);
|
||||
|
||||
// Generate the proof
|
||||
let proof = client
|
||||
|
||||
@ -65,7 +65,7 @@ fn main() {
|
||||
println!("a: {}", a);
|
||||
println!("b: {}", b);
|
||||
|
||||
let (expected_a, expected_b) = fibonacci_lib::fibonacci(n);
|
||||
let (expected_a, expected_b) = simple_arithmetic_test_lib::hept(n);
|
||||
assert_eq!(a, expected_a);
|
||||
assert_eq!(b, expected_b);
|
||||
println!("Values are correct!");
|
||||
@ -74,7 +74,7 @@ fn main() {
|
||||
println!("Number of cycles: {}", report.total_instruction_count());
|
||||
} else {
|
||||
// Setup the program for proving.
|
||||
let (pk, vk) = client.setup(FIBONACCI_ELF);
|
||||
let (pk, vk) = client.setup(SIMPLE_ARITHMETIC_TEST_ELF);
|
||||
|
||||
// Generate the proof
|
||||
let proof = client
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user