Skip to content

Commit 3ae8c65

Browse files
authored
Merge pull request #3 from openvm-org/chore/release-v1.1.1
chore: release v1.1
2 parents d181a34 + 051c8a9 commit 3ae8c65

File tree

8 files changed

+44
-56
lines changed

8 files changed

+44
-56
lines changed

.github/workflows/consistency.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,23 @@ name: OpenVM Repo Consistency Check
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: "Version to check"
8+
required: true
9+
10+
release:
11+
types: [published]
12+
13+
env:
14+
VERSION: ${{ github.event.inputs.version || github.event.release.tag_name }}
515

616
concurrency:
7-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
17+
group: ${{ github.workflow }}-${{ github.event.inputs.version || github.event.release.tag_name }}
818
cancel-in-progress: true
919

1020
jobs:
11-
checks:
21+
consistency-check:
1222
runs-on:
1323
- runs-on=${{ github.run_id }}
1424
- family=m7a.24xlarge
@@ -25,7 +35,7 @@ jobs:
2535
run: |
2636
git clone https://github.com/openvm-org/openvm.git
2737
cd openvm
28-
git checkout feat/format-verifier
38+
git checkout ${VERSION}
2939
3040
- name: Run openvm setup
3141
run: |
@@ -37,9 +47,9 @@ jobs:
3747

3848
- name: Compare output to version folder
3949
run: |
40-
diff -r ~/.openvm/halo2/src/v1.0.1-rc.0 src/v1.0.1-rc.0 --exclude=verifier.bytecode.json
50+
diff -r ~/.openvm/halo2/src/${VERSION} src/${VERSION} --exclude=verifier.bytecode.json
4151
4252
- name: Compare compiled bytecode in repo to verifier.bytecode.json
4353
run: |
4454
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)
55+
diff <(jq -r '.bytecode.object | ltrimstr("0x")' out/OpenVmHalo2Verifier.sol/OpenVmHalo2Verifier.json) <(jq -r '.bytecode | ltrimstr("0x")' ~/.openvm/halo2/src/${VERSION}/verifier.bytecode.json)

README.md

Lines changed: 25 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,44 @@
1-
## Foundry
1+
# OpenVM Solidity SDK
22

3-
**Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.**
3+
This repository contains OpenVM verifier contracts generated from official release commits of the [openvm](https://github.com/openvm-org/openvm) repository using the default VM configuration via the cargo-openvm CLI tool. If you're using an advanced or custom VM configuration, you may need to generate and maintain your own verifier contracts separately.
44

5-
Foundry consists of:
5+
The contracts are built on every _minor_ release as OpenVM guarantees verifier backward compatibility across patch releases.
66

7-
- **Forge**: Ethereum testing framework (like Truffle, Hardhat and DappTools).
8-
- **Cast**: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
9-
- **Anvil**: Local Ethereum node, akin to Ganache, Hardhat Network.
10-
- **Chisel**: Fast, utilitarian, and verbose solidity REPL.
7+
## Installation
118

12-
## Documentation
9+
To install `openvm-solidity-sdk` as a dependency in your forge project, run the following:
1310

14-
https://book.getfoundry.sh/
15-
16-
## Usage
17-
18-
### Build
19-
20-
```shell
21-
$ forge build
22-
```
23-
24-
### Test
25-
26-
```shell
27-
$ forge test
11+
```bash
12+
forge install openvm-org/openvm-solidity-sdk
2813
```
2914

30-
### Format
15+
## Usage
3116

32-
```shell
33-
$ forge fmt
34-
```
17+
If you are using a deployed instance of the verifier contract, then you can import the interfaces in your contract directly.
3518

36-
### Gas Snapshots
19+
```solidity
20+
import { IOpenVmHalo2Verifier } from "openvm-solidity-sdk/v1.1.1/interfaces/IOpenVmHalo2Verifier.sol";
3721
38-
```shell
39-
$ forge snapshot
40-
```
22+
contract MyContract {
23+
function myFunction() public view {
24+
// ... snip ...
4125
42-
### Anvil
26+
IOpenVmHalo2Verifier(verifierAddress)
27+
.verify(publicValues, proofData, appExeCommit, appVmCommit);
4328
44-
```shell
45-
$ anvil
29+
// ... snip ...
30+
}
31+
}
4632
```
4733

48-
### Deploy
34+
If you want to deploy your own instance of the verifier contract, you can use `forge create`:
4935

50-
```shell
51-
$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>
36+
```bash
37+
forge create src/v1.1.1/OpenVmHalo2Verifier.sol:OpenVmHalo2Verifier --rpc-url $RPC --private-key $PRIVATE_KEY --broadcast
5238
```
5339

54-
### Cast
40+
If you want to import the verifier contract into your own repository for testing purposes, note that it is locked to Solidity version `0.8.19`. If your project uses a different version, the import may not compile. As a workaround, you can compile the contract separately and use `vm.etch()` to inject the raw bytecode into your tests.
5541

56-
```shell
57-
$ cast <subcommand>
58-
```
59-
60-
### Help
42+
## Audits
6143

62-
```shell
63-
$ forge --help
64-
$ anvil --help
65-
$ cast --help
66-
```
44+
You can find the audit reports for these contracts in the [OpenVM repo](https://github.com/openvm-org/openvm/tree/main/audits).

foundry.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ optimizer = true
88
optimizer_runs = 100000
99
evm_version = "paris"
1010
show_progress = true
11-
fs_permissions = [{ access = "read", path = "./test/v1.0.1/evm.proof"}]
11+
fs_permissions = [{ access = "read", path = "./test/v1.1/evm.proof"}]
1212

1313
[profile.default.optimizer_details]
1414
constantOptimizer = false
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.1-rc.0";
32+
string public constant OPENVM_VERSION = "1.1.1";
3333

3434
/// @notice A wrapper that constructs the proof into the right format for
3535
/// use with the `snark-verifier` verification.
File renamed without changes.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity 0.8.19;
33

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

@@ -26,7 +26,7 @@ contract OpenVmHalo2VerifierTest is Test {
2626
}
2727

2828
function test_ValidProofVerifies() public view {
29-
string memory evmProofJson = vm.readFile("test/v1.0.1/evm.proof");
29+
string memory evmProofJson = vm.readFile("test/v1.1/evm.proof");
3030
bytes32 _appExeCommit = vm.parseJsonBytes32(evmProofJson, ".app_exe_commit");
3131
bytes32 _appVmCommit = vm.parseJsonBytes32(evmProofJson, ".app_vm_commit");
3232
bytes memory _guestPvs = vm.parseJsonBytes(evmProofJson, ".user_public_values");

0 commit comments

Comments
 (0)