Skip to content

Commit ef134b7

Browse files
authored
feat: v1.2.0-rc1 + groth16 (testnet-only) (#23)
1 parent 2fcbf92 commit ef134b7

File tree

17 files changed

+2567
-46
lines changed

17 files changed

+2567
-46
lines changed

Cargo.lock

Lines changed: 337 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ path = "src/bin/artifacts.rs"
1111
anyhow = "1.0.86"
1212
dotenv = "0.15.0"
1313
log = "0.4.21"
14-
sp1-sdk = "1.1.0"
14+
sp1-sdk = "1.2.0-rc1"

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ FOUNDRY_PROFILE=deploy forge script ./script/deploy/SP1VerifierGateway.s.sol:SP1
5757
To deploy a specific SP1 Verifier version and add it to the gateway, run:
5858

5959
```bash
60-
FOUNDRY_PROFILE=deploy forge script ./script/deploy/v1.1.0/SP1Verifier.s.sol:SP1VerifierScript --private-key $PRIVATE_KEY --verify --verifier etherscan --multi --broadcast
60+
FOUNDRY_PROFILE=deploy forge script ./script/deploy/v1.2.0-rc/SP1VerifierGroth16.s.sol:SP1VerifierScript --private-key $PRIVATE_KEY --verify --verifier etherscan --multi --broadcast
6161
```
6262

63-
Change `v1.1.0` to the desired version to add.
63+
Change `v1.2.0-rc` to the desired version to add.
6464

6565
To re-verify already existing deployments, remove the `--broadcast` flag.
6666

@@ -71,10 +71,10 @@ To re-verify already existing deployments, remove the `--broadcast` flag.
7171
To freeze a verifier on the gateway, run:
7272

7373
```bash
74-
FOUNDRY_PROFILE=deploy forge script ./script/deploy/v1.1.0/SP1Verifier.s.sol:SP1VerifierScript --private-key $PRIVATE_KEY --verify --verifier etherscan --multi --broadcast --sig "freeze()"
74+
FOUNDRY_PROFILE=deploy forge script ./script/deploy/v1.2.0-rc/SP1VerifierGroth16.s.sol:SP1VerifierScript --private-key $PRIVATE_KEY --verify --verifier etherscan --multi --broadcast --sig "freeze()"
7575
```
7676

77-
Change `v1.1.0` to the desired version to freeze.
77+
Change `v1.2.0-rc` to the desired version to freeze.
7878

7979
## For Developers: Integrate SP1 Contracts
8080

contracts/deployments/11155111.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
33
"V1_0_1_SP1_VERIFIER": "0x36B353776AF6EF3A2bD707049e783F52c4209017",
44
"V1_0_7_TESTNET_SP1_VERIFIER": "0x331b350dDA287d0A65ce43103984CD44cb4Da9f0",
55
"V1_0_8_TESTNET_SP1_VERIFIER": "0xfE2bb0Ad7F2c44Bd1289234Af08aD6FDEC0d54a2",
6-
"V1_1_0_SP1_VERIFIER": "0xc350F063C13a3Ca21331610fe159E697a5c9c2FB"
6+
"V1_1_0_SP1_VERIFIER": "0xc350F063C13a3Ca21331610fe159E697a5c9c2FB",
7+
"V1_2_0_RC1_SP1_VERIFIER_GROTH16": "0xD2903BB3f4C9d9Ab96097a1fd8Ee195fAc060DE3",
8+
"V1_2_0_RC1_SP1_VERIFIER_PLONK": "0x5072B31595B579dDFE3e88Ddb953ef7618FcB58E"
79
}

contracts/deployments/17000.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
33
"V1_0_1_SP1_VERIFIER": "0x36B353776AF6EF3A2bD707049e783F52c4209017",
44
"V1_0_7_TESTNET_SP1_VERIFIER": "0x331b350dDA287d0A65ce43103984CD44cb4Da9f0",
55
"V1_0_8_TESTNET_SP1_VERIFIER": "0xfE2bb0Ad7F2c44Bd1289234Af08aD6FDEC0d54a2",
6-
"V1_1_0_SP1_VERIFIER": "0xc350F063C13a3Ca21331610fe159E697a5c9c2FB"
6+
"V1_1_0_SP1_VERIFIER": "0xc350F063C13a3Ca21331610fe159E697a5c9c2FB",
7+
"V1_2_0_RC1_SP1_VERIFIER_GROTH16": "0xD2903BB3f4C9d9Ab96097a1fd8Ee195fAc060DE3",
8+
"V1_2_0_RC1_SP1_VERIFIER_PLONK": "0x5072B31595B579dDFE3e88Ddb953ef7618FcB58E"
79
}

contracts/deployments/421614.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
33
"V1_0_1_SP1_VERIFIER": "0x36B353776AF6EF3A2bD707049e783F52c4209017",
44
"V1_0_7_TESTNET_SP1_VERIFIER": "0x331b350dDA287d0A65ce43103984CD44cb4Da9f0",
55
"V1_0_8_TESTNET_SP1_VERIFIER": "0xfE2bb0Ad7F2c44Bd1289234Af08aD6FDEC0d54a2",
6-
"V1_1_0_SP1_VERIFIER": "0xc350F063C13a3Ca21331610fe159E697a5c9c2FB"
6+
"V1_1_0_SP1_VERIFIER": "0xc350F063C13a3Ca21331610fe159E697a5c9c2FB",
7+
"V1_2_0_RC1_SP1_VERIFIER_GROTH16": "0xD2903BB3f4C9d9Ab96097a1fd8Ee195fAc060DE3",
8+
"V1_2_0_RC1_SP1_VERIFIER_PLONK": "0x5072B31595B579dDFE3e88Ddb953ef7618FcB58E"
79
}

contracts/deployments/534351.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
33
"V1_0_1_SP1_VERIFIER": "0x36B353776AF6EF3A2bD707049e783F52c4209017",
44
"V1_0_7_TESTNET_SP1_VERIFIER": "0x331b350dDA287d0A65ce43103984CD44cb4Da9f0",
55
"V1_0_8_TESTNET_SP1_VERIFIER": "0xfE2bb0Ad7F2c44Bd1289234Af08aD6FDEC0d54a2",
6-
"V1_1_0_SP1_VERIFIER": "0xc350F063C13a3Ca21331610fe159E697a5c9c2FB"
6+
"V1_1_0_SP1_VERIFIER": "0xc350F063C13a3Ca21331610fe159E697a5c9c2FB",
7+
"V1_2_0_RC1_SP1_VERIFIER_GROTH16": "0xD2903BB3f4C9d9Ab96097a1fd8Ee195fAc060DE3",
8+
"V1_2_0_RC1_SP1_VERIFIER_PLONK": "0x5072B31595B579dDFE3e88Ddb953ef7618FcB58E"
79
}

contracts/deployments/84532.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
33
"V1_0_1_SP1_VERIFIER": "0x36B353776AF6EF3A2bD707049e783F52c4209017",
44
"V1_0_7_TESTNET_SP1_VERIFIER": "0x331b350dDA287d0A65ce43103984CD44cb4Da9f0",
55
"V1_0_8_TESTNET_SP1_VERIFIER": "0xfE2bb0Ad7F2c44Bd1289234Af08aD6FDEC0d54a2",
6-
"V1_1_0_SP1_VERIFIER": "0xc350F063C13a3Ca21331610fe159E697a5c9c2FB"
6+
"V1_1_0_SP1_VERIFIER": "0xc350F063C13a3Ca21331610fe159E697a5c9c2FB",
7+
"V1_2_0_RC1_SP1_VERIFIER_GROTH16": "0xD2903BB3f4C9d9Ab96097a1fd8Ee195fAc060DE3",
8+
"V1_2_0_RC1_SP1_VERIFIER_PLONK": "0x5072B31595B579dDFE3e88Ddb953ef7618FcB58E"
79
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.20;
3+
4+
import {BaseScript} from "../../utils/Base.s.sol";
5+
import {SP1Verifier} from "../../../src/v1.2.0-rc/SP1VerifierGroth16.sol";
6+
import {SP1VerifierGateway} from "../../../src/SP1VerifierGateway.sol";
7+
import {ISP1VerifierWithHash} from "../../../src/ISP1Verifier.sol";
8+
9+
contract SP1VerifierScript is BaseScript {
10+
string internal constant KEY = "V1_2_0_RC1_SP1_VERIFIER_GROTH16";
11+
12+
function run() external multichain(KEY) broadcaster {
13+
// Read config
14+
bytes32 CREATE2_SALT = readBytes32("CREATE2_SALT");
15+
address SP1_VERIFIER_GATEWAY = readAddress("SP1_VERIFIER_GATEWAY");
16+
17+
// Deploy contract
18+
address verifier = address(new SP1Verifier{salt: CREATE2_SALT}());
19+
20+
// Add the verifier to the gateway
21+
SP1VerifierGateway gateway = SP1VerifierGateway(SP1_VERIFIER_GATEWAY);
22+
gateway.addRoute(verifier);
23+
24+
// Write address
25+
writeAddress(KEY, verifier);
26+
}
27+
28+
function freeze() external multichain(KEY) broadcaster {
29+
// Read config
30+
address SP1_VERIFIER_GATEWAY = readAddress("SP1_VERIFIER_GATEWAY");
31+
address SP1_VERIFIER = readAddress(KEY);
32+
33+
// Freeze the verifier on the gateway
34+
SP1VerifierGateway gateway = SP1VerifierGateway(SP1_VERIFIER_GATEWAY);
35+
bytes4 selector = bytes4(ISP1VerifierWithHash(SP1_VERIFIER).VERIFIER_HASH());
36+
gateway.freezeRoute(selector);
37+
}
38+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.20;
3+
4+
import {BaseScript} from "../../utils/Base.s.sol";
5+
import {SP1Verifier} from "../../../src/v1.2.0-rc/SP1VerifierPlonk.sol";
6+
import {SP1VerifierGateway} from "../../../src/SP1VerifierGateway.sol";
7+
import {ISP1VerifierWithHash} from "../../../src/ISP1Verifier.sol";
8+
9+
contract SP1VerifierScript is BaseScript {
10+
string internal constant KEY = "V1_2_0_RC1_SP1_VERIFIER_PLONK";
11+
12+
function run() external multichain(KEY) broadcaster {
13+
// Read config
14+
bytes32 CREATE2_SALT = readBytes32("CREATE2_SALT");
15+
address SP1_VERIFIER_GATEWAY = readAddress("SP1_VERIFIER_GATEWAY");
16+
17+
// Deploy contract
18+
address verifier = address(new SP1Verifier{salt: CREATE2_SALT}());
19+
20+
// Add the verifier to the gateway
21+
SP1VerifierGateway gateway = SP1VerifierGateway(SP1_VERIFIER_GATEWAY);
22+
gateway.addRoute(verifier);
23+
24+
// Write address
25+
writeAddress(KEY, verifier);
26+
}
27+
28+
function freeze() external multichain(KEY) broadcaster {
29+
// Read config
30+
address SP1_VERIFIER_GATEWAY = readAddress("SP1_VERIFIER_GATEWAY");
31+
address SP1_VERIFIER = readAddress(KEY);
32+
33+
// Freeze the verifier on the gateway
34+
SP1VerifierGateway gateway = SP1VerifierGateway(SP1_VERIFIER_GATEWAY);
35+
bytes4 selector = bytes4(ISP1VerifierWithHash(SP1_VERIFIER).VERIFIER_HASH());
36+
gateway.freezeRoute(selector);
37+
}
38+
}

0 commit comments

Comments
 (0)