Skip to content

Commit 09fbad3

Browse files
committed
feat: deploy risc0 groth16 verifier
1 parent 56a9d87 commit 09fbad3

15 files changed

+2047
-2155
lines changed

contracts/deployments/31337.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"CREATE2_SALT": "0x0000000000000000000000000000000000000000000000000000000000000009",
3-
"SP1_VERIFIER_GATEWAY_GROTH16": "0xbC42A182543d5AF01f51040955D149A74C015098",
4-
"V4_0_0_RC3_SP1_VERIFIER_GROTH16": "0x737A46c3A4579A452302130D762eFa66C6f81e28"
5-
}
3+
"SP1_VERIFIER_GATEWAY_GROTH16": "0xB146FbFdFeC2a5182b3Cef9becE03290224256D5",
4+
"V4_0_0_RC3_SP1_VERIFIER_GROTH16": "0x93a993C79738eA5D8836e42C6c422259684639Dc"
5+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// SPDX-License-Identifier: Apache-2.0
2+
pragma solidity ^0.8.20;
3+
4+
import {Script} from "forge-std/Script.sol";
5+
import {console2} from "forge-std/console2.sol";
6+
import {IRiscZeroVerifier} from "@risc0-contracts/IRiscZeroVerifier.sol";
7+
import {ControlID, RiscZeroGroth16Verifier} from "@risc0-contracts/groth16/RiscZeroGroth16Verifier.sol";
8+
9+
contract Risc0VerifierRouterDeployer is Script {
10+
function run() external {
11+
uint256 deployerKey = uint256(vm.envBytes32("DEPLOYER_PRIVATE_KEY"));
12+
13+
vm.startBroadcast(deployerKey);
14+
15+
IRiscZeroVerifier verifier = new RiscZeroGroth16Verifier(ControlID.CONTROL_ROOT, ControlID.BN254_CONTROL_ID);
16+
console2.log("Deployed RiscZeroGroth16Verifier to", address(verifier));
17+
18+
vm.stopBroadcast();
19+
}
20+
}

contracts/script/deploy/config/devnet/proof-aggregator-service.devnet.config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"address": {
3-
"sp1VerifierAddress": "0xbC42A182543d5AF01f51040955D149A74C015098",
4-
"risc0VerifierAddress": "0x00000000000000000000000000000000000000FF",
3+
"sp1VerifierAddress": "0xB146FbFdFeC2a5182b3Cef9becE03290224256D5",
4+
"risc0VerifierAddress": "0x663F3ad617193148711d28f5334eE4Ed07016602",
55
"alignedAggregatorAddress": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
66
"alignedAggregatorAddressPrivateKey": "0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6"
77
},

contracts/script/deploy/config/holesky/proof-aggregator-service.holesky.config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"address": {
33
"sp1VerifierAddress": "0x397A5f7f3dBd538f23DE225B51f532c34448dA9B",
4+
"risc0VerifierAddress": "0xf70aBAb028Eb6F4100A24B203E113D94E87DE93C",
45
"alignedAggregatorAddress": "0x9403dF48130621f87974a5A1d1d11d3aF1222A82"
56
},
67
"permissions": {

contracts/script/deploy/config/mainnet/proof-aggregator-service.holesky.config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"address": {
33
"sp1VerifierAddress": "0x397A5f7f3dBd538f23DE225B51f532c34448dA9B",
4+
"risc0VerifierAddress": "0xf70aBAb028Eb6F4100A24B203E113D94E87DE93C",
45
"alignedAggregatorAddress": "<aligned_aggregator_address>"
56
},
67
"permissions": {

contracts/script/deploy/config/mainnet_staging/proof-aggregator-service.holesky.config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"address": {
33
"sp1VerifierAddress": "0x397A5f7f3dBd538f23DE225B51f532c34448dA9B",
4+
"risc0VerifierAddress": "0xf70aBAb028Eb6F4100A24B203E113D94E87DE93C",
45
"alignedAggregatorAddress": "<aligned_aggregator_address>"
56
},
67
"permissions": {

contracts/script/deploy/config/sepolia/proof-aggregator-service.holesky.config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"address": {
33
"sp1VerifierAddress": "0x397A5f7f3dBd538f23DE225B51f532c34448dA9B",
4+
"risc0VerifierAddress": "0xf70aBAb028Eb6F4100A24B203E113D94E87DE93C",
45
"alignedAggregatorAddress": "<aligned_aggregator_address>"
56
},
67
"permissions": {

contracts/script/output/devnet/alignedlayer_deployment_output.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"chainInfo": {
2121
"chainId": 31337,
22-
"deploymentBlock": 3
22+
"deploymentBlock": 4
2323
},
2424
"permissions": {
2525
"alignedLayerAggregator": "0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65",

contracts/scripts/anvil/deploy_aligned_contracts.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ forge script script/deploy/AlignedProofAggregationServiceDeployer.s.sol \
7272
--rpc-url "http://localhost:8545" \
7373
--private-key "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" \
7474
--broadcast \
75-
--sig "run(string configPath, string outputPath)"
75+
--sig "run(string configPath, string outputPath)" \
76+
--via-ir
7677

7778
# Deploy proof aggregation service contract with Mocked Verifier
7879
forge script script/deploy/AlignedProofAggregationServiceDeployer.s.sol \
@@ -81,7 +82,8 @@ forge script script/deploy/AlignedProofAggregationServiceDeployer.s.sol \
8182
--rpc-url "http://localhost:8545" \
8283
--private-key "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" \
8384
--broadcast \
84-
--sig "run(string configPath, string outputPath)"
85+
--sig "run(string configPath, string outputPath)" \
86+
--via-ir
8587

8688
# Kill the anvil process to save state
8789
pkill anvil
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
# cd to the directory of this script so that this can be run from anywhere
4+
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
5+
# At this point we are in tests/integration
6+
cd "$parent_path"
7+
8+
# Start an empty anvil chain in the background and dump its state to a json file upon exit
9+
anvil --load-state state/eigenlayer-deployed-anvil-state.json --dump-state state/risc0-deployed-anvil-state.json &
10+
11+
# cd to /contracts
12+
cd ../../
13+
14+
sleep 1
15+
16+
export CHAINS='DEVNET'
17+
export RPC_DEVNET='http://localhost:8545'
18+
19+
# Anvil account #2
20+
export DEPLOYER_PRIVATE_KEY='0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a'
21+
22+
forge script script/deploy/Risc0Groth16VerifierDeployer.s.sol:Risc0VerifierRouterDeployer \
23+
--rpc-url $RPC_DEVNET \
24+
--private-key $DEPLOYER_PRIVATE_KEY \
25+
--broadcast
26+
27+
# Kill the anvil process to save state
28+
pkill anvil

0 commit comments

Comments
 (0)