From 959f0c2a7a071c913d91b5613c131c7ba42ff97e Mon Sep 17 00:00:00 2001 From: Victor Graf Date: Wed, 7 Aug 2024 11:35:49 -0700 Subject: [PATCH] WEB3-66: Add version string to RiscZeroGroth16Verifier.sol (#187) In order to make it easier to determine which version a given verifier contract is, this PR adds a semantic version string. Note that this does mean an additional step in the release process. I couldn't think of a way to make this automatic. --- RELEASE.md | 7 ++++++- contracts/src/groth16/RiscZeroGroth16Verifier.sol | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/RELEASE.md b/RELEASE.md index 20f5c2f9..ec3e0ae4 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -11,6 +11,8 @@ * Bump the version of all crates in the workspace to `x.y.z`. Workspace crate versions are specified in `./Cargo.toml`. + * Update the version string in contracts that contain it: + * `contracts/src/groth16/RiscZeroGroth16Verifier.sol` * Remove the note at the top of `README.md` about being on the `main` branch. * Update `risc0` crate dependencies. In all workspaces: > You can find the workspaces with `grep -R '\[workspace\]' --include Cargo.toml -l .` @@ -19,7 +21,10 @@ * Run `cargo update`. * Remove `Cargo.lock` from `.gitignore` and commit all lock files. - * The other PR should bump the version on the `main` branch to the next, unreleased, minor version `x.y+1.0-alpha.1`. + * The other PR should: + * Bump the version on the `main` branch to the next, unreleased, minor version `x.y+1.0-alpha.1`. + * Update the version string in contracts that contain it: + * `contracts/src/groth16/RiscZeroGroth16Verifier.sol` 3. Tag the release as `vX.Y.Z`, and add release on GitHub. diff --git a/contracts/src/groth16/RiscZeroGroth16Verifier.sol b/contracts/src/groth16/RiscZeroGroth16Verifier.sol index c4a1b498..e341c02f 100644 --- a/contracts/src/groth16/RiscZeroGroth16Verifier.sol +++ b/contracts/src/groth16/RiscZeroGroth16Verifier.sol @@ -53,6 +53,9 @@ contract RiscZeroGroth16Verifier is IRiscZeroVerifier, Groth16Verifier { using OutputLib for Output; using SafeCast for uint256; + /// Semantic version of the the RISC Zero system of which this contract is part. + string constant VERSION = "1.1.0-alpha.1"; + /// @notice Control root hash binding the set of circuits in the RISC Zero system. /// @dev This value controls what set of recursion programs (e.g. lift, join, resolve), and /// therefore what version of the zkVM circuit, will be accepted by this contract. Each