Skip to content

Commit f7c6e4b

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

File tree

6 files changed

+33
-3
lines changed

6 files changed

+33
-3
lines changed

.github/workflows/consistency.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: OpenVM Repo Consistency Check
22

33
on:
4+
push:
5+
pull_request:
46
workflow_dispatch:
57

68
concurrency:
@@ -13,3 +15,30 @@ jobs:
1315
- runs-on=${{ github.run_id }}
1416
- family=m7a.24xlarge
1517
- disk=large
18+
19+
steps:
20+
- name: Checkout current repo
21+
uses: actions/checkout@v4
22+
23+
- name: Install solc # svm should support arm64 linux
24+
run: (hash svm 2>/dev/null || cargo install --version 0.2.23 svm-rs) && svm install 0.8.19 && solc --version
25+
26+
- name: Clone openvm at tag
27+
run: |
28+
git clone https://github.com/openvm-org/openvm.git
29+
cd openvm
30+
git checkout feat/format-verifier
31+
32+
- name: Run openvm setup
33+
run: |
34+
cd openvm/crates
35+
cargo run --bin cargo-openvm openvm setup
36+
37+
- name: Compare output to version folder
38+
run: |
39+
diff -r ~/.openvm/halo2/src/v1.0.1-rc.0 src/v1.0.1-rc.0 --exclude=verifier.bytecode.json
40+
41+
- name: Compare compiled bytecode in repo to verifier.bytecode.json
42+
run: |
43+
forge build --force
44+
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
File renamed without changes.

src/v1.0.1/OpenVmHalo2Verifier.sol renamed to src/v1.0.1-rc.0/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)