Skip to content

Commit 5271485

Browse files
committed
feat: add consistency check workflow
1 parent bcbfbfb commit 5271485

File tree

4 files changed

+34
-3
lines changed

4 files changed

+34
-3
lines changed

.github/workflows/consistency.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,33 @@ jobs:
1313
- runs-on=${{ github.run_id }}
1414
- family=m7a.24xlarge
1515
- disk=large
16+
17+
steps:
18+
- name: Checkout current repo
19+
uses: actions/checkout@v4
20+
21+
- name: Install solc # svm should support arm64 linux
22+
run: (hash svm 2>/dev/null || cargo install --version 0.2.23 svm-rs) && svm install 0.8.19 && solc --version
23+
24+
- name: Clone openvm at tag
25+
run: |
26+
git clone https://github.com/openvm-org/openvm.git
27+
cd openvm
28+
git checkout feat/format-verifier
29+
30+
- name: Run openvm setup
31+
run: |
32+
cd openvm/crates
33+
cargo run --bin cargo-openvm openvm setup
34+
35+
- name: Install Foundry
36+
uses: foundry-rs/foundry-toolchain@v1
37+
38+
- name: Compare output to version folder
39+
run: |
40+
diff -r ~/.openvm/halo2/src/v1.0.1-rc.0 src/v1.0.1-rc.0 --exclude=verifier.bytecode.json
41+
42+
- name: Compare compiled bytecode in repo to verifier.bytecode.json
43+
run: |
44+
forge build --force
45+
diff <(jq -r '.bytecode.object | ltrimstr("0x")' out/OpenVmHalo2Verifier.sol/OpenVmHalo2Verifier.json) <(jq -r '.bytecode | ltrimstr("0x")' ~/.openvm/halo2/src/v1.0.1-rc.0/verifier.bytecode.json)

foundry.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ verbosity = 2
66
solc = "0.8.19"
77
optimizer = true
88
optimizer_runs = 100000
9-
evm_version = "shanghai"
9+
evm_version = "paris"
1010
show_progress = true
1111
fs_permissions = [{ access = "read", path = "./test/v1.0.1/evm.proof"}]
1212

@@ -18,6 +18,7 @@ fs_permissions = [{ access = "read", path = "./test/v1.0.1/evm.proof"}]
1818
runs = 256
1919

2020
[fmt]
21+
sort_imports = true
2122
bracket_spacing = true
2223
int_types = "long"
2324
line_length = 120

src/v1.0.1/OpenVmHalo2Verifier.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ contract OpenVmHalo2Verifier is Halo2Verifier, IOpenVmHalo2Verifier {
2929
uint256 private constant FULL_PROOF_LENGTH = (12 + 2 + PUBLIC_VALUES_LENGTH + 43) * 32;
3030

3131
/// @dev The version of OpenVM that generated this verifier.
32-
string public constant OPENVM_VERSION = "1.0.0";
32+
string public constant OPENVM_VERSION = "1.0.1-rc.0";
3333

3434
/// @notice A wrapper that constructs the proof into the right format for
3535
/// use with the `snark-verifier` verification.

test/v1.0.1/OpenVmHalo2Verifer.t.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity 0.8.19;
33

4+
import { OpenVmHalo2Verifier } from "../../src/v1.0.1/OpenVmHalo2Verifier.sol";
45
import { LibString } from "../helpers/LibString.sol";
56
import { Test, console2, safeconsole as console } from "forge-std/Test.sol";
6-
import { OpenVmHalo2Verifier } from "../../src/v1.0.1/OpenVmHalo2Verifier.sol";
77

88
contract OpenVmHalo2VerifierTest is Test {
99
bytes proofData;

0 commit comments

Comments
 (0)