From 43330da1f3c712f1807a746a0898a7fd7521d876 Mon Sep 17 00:00:00 2001 From: Oleksandr Pravdyvyi Date: Wed, 25 Sep 2024 12:51:30 +0300 Subject: [PATCH] zkMIPS instructions added --- README.md | 3 +- zkmips/README.md | 45 ++++++++++++++++++++++++++++++ zkmips/scripts_and_tools/README.md | 13 --------- 3 files changed, 47 insertions(+), 14 deletions(-) create mode 100644 zkmips/README.md delete mode 100644 zkmips/scripts_and_tools/README.md diff --git a/README.md b/README.md index 71a3d55..51069b1 100644 --- a/README.md +++ b/README.md @@ -5,4 +5,5 @@ This repo reflects the tests conducted by Nescience Team on selected zkVMs. To run test, corresponding to zkVM of choise read -[zkWASM](./zkwasm/README.md) +- [zkWASM](./zkwasm/README.md) +- [zkMIPS](./zkmips/README.md) diff --git a/zkmips/README.md b/zkmips/README.md new file mode 100644 index 0000000..651c1d0 --- /dev/null +++ b/zkmips/README.md @@ -0,0 +1,45 @@ +# Test run instructions + +To run corresponding tests in `zkMIPS` some preparations have to be done. + +We assume, that one is in `zkmips` folder. + +Firstly, move into [scripts_and_tools](./scripts_and_tools/) directory. + +Next, run + +```sh +./zkmips_setup.sh +``` + +This will get mips compiler. + +After setup, and getting compiler, go to ~/.cargo/config , and add: + +``` +[target.mips-unknown-linux-musl] +linker = "/mips-linux-muslsf-cross/bin/mips-linux-muslsf-gcc" +rustflags = ["--cfg", 'target_os="zkvm"',"-C", "target-feature=+crt-static", "-C", "link-arg=-g"] +``` + +Additionally, be sure, that you are at the latest nightly toolchain. + +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 +./zkmips_build.sh ../tests/simple_arithmetic_test +``` + +If build is succsessfull you will see `simple_arithmetic_test` binary in `tests/simple_arithmetic_test/target/mips-unknown-linux-musl/release/`. + +Now, to benchmark this test we must do the following + +```sh +./zkmips_bench.sh +``` + +Where `path-to-elf` is abovementioned path to `simple_arithmetic_test` binary relative to [zkmips_tester](./tests/zkmips_tester/) folder of global. + +This will build a tester, and after that, bench proving and do verification of a proof. \ No newline at end of file diff --git a/zkmips/scripts_and_tools/README.md b/zkmips/scripts_and_tools/README.md deleted file mode 100644 index 1abd0aa..0000000 --- a/zkmips/scripts_and_tools/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# ATTENTION - -Some things have to be done manually - -After setup, and getting compiler, go to ~/.cargo/config , and add: - -``` -[target.mips-unknown-linux-musl] -linker = "/mips-linux-muslsf-cross/bin/mips-linux-muslsf-gcc" -rustflags = ["--cfg", 'target_os="zkvm"',"-C", "target-feature=+crt-static", "-C", "link-arg=-g"] -``` - -Additionally, be sure, that you ate at the latest nightly toolchain. \ No newline at end of file