diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5146421..7aedc41 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: cache-on-failure: true - name: Install solc - run: (hash svm 2>/dev/null || cargo install svm-rs) && svm install 0.8.21 && solc --version + run: (hash svm 2>/dev/null || cargo install svm-rs@0.5.4) && svm install 0.8.21 && solc --version - name: Run test run: cargo test --workspace --all-features --all-targets -- --nocapture diff --git a/README.md b/README.md index 7798fad..343d00d 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,17 @@ let (verifier_solidity, vk_solidity) = generator.render_separately().unwrap(); Check [`examples/separately.rs`](./examples/separately.rs) for more details. +> [!NOTE] +> Currently example run only with rust `1.77.0` version due to a `cargo` update ([rust-lang/rust#123285](https://github.com/rust-lang/rust/issues/123285)). +> +> The `rust` toolchain version is specified in [rust-toolchain.toml](./rust-toolchain.toml) file. + +Run example with the following command: + +```bash +cargo run --all-features --example separately +``` + ### Generate verifier and verifying key in a single solidity contract ```rust @@ -32,6 +43,20 @@ let calldata = encode_calldata(vk_address, &proof, &instances); Note that function selector is already included. +## Test + +To run tests, use the following command: + +```bash +cargo test --workspace --all-features --all-targets -- --nocapture +``` + +> [!NOTE] +> Currently tests run only with rust `1.77.0` version due to a `cargo` update ([rust-lang/rust#123285](https://github.com/rust-lang/rust/issues/123285)). +> +> The `rust` toolchain version is specified in [rust-toolchain.toml](./rust-toolchain.toml) file. + + ## Limitations & Caveats - It only allows circuit with **less or equal than 1 instance column** and **no rotated query to this instance column**. diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..c45546b --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "1.77.0" \ No newline at end of file diff --git a/templates/Halo2Verifier.sol b/templates/Halo2Verifier.sol index 3dfcf09..1fc7297 100644 --- a/templates/Halo2Verifier.sol +++ b/templates/Halo2Verifier.sol @@ -78,7 +78,7 @@ contract Halo2Verifier { {%- endmatch %} bytes calldata proof, uint256[] calldata instances - ) public returns (bool) { + ) public view returns (bool) { assembly { // Read EC point (x, y) at (proof_cptr, proof_cptr + 0x20), // and check if the point is on affine plane,