Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: v3.0.0-rc3 #29

Merged
merged 3 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
610 changes: 154 additions & 456 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ path = "src/bin/artifacts.rs"
anyhow = "1.0.86"
dotenv = "0.15.0"
log = "0.4.21"
sp1-sdk = "3.0.0-rc1"
sp1-sdk = "3.0.0-rc3"
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ FOUNDRY_PROFILE=deploy forge script ./script/deploy/SP1VerifierGateway.s.sol:SP1
To deploy a specific SP1 Verifier version and add it to the gateway, run:

```bash
FOUNDRY_PROFILE=deploy forge script ./script/deploy/v3.0.0-rc1/SP1VerifierPlonk.s.sol:SP1VerifierScript --private-key $PRIVATE_KEY --verify --verifier etherscan --multi --broadcast
FOUNDRY_PROFILE=deploy forge script ./script/deploy/v3.0.0-rc3/SP1VerifierPlonk.s.sol:SP1VerifierScript --private-key $PRIVATE_KEY --verify --verifier etherscan --multi --broadcast
```

Change `v3.0.0-rc1` to the desired version to add.
Change `v3.0.0-rc3` to the desired version to add.

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

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

```bash
FOUNDRY_PROFILE=deploy forge script ./script/deploy/v3.0.0-rc1/SP1VerifierPlonk.s.sol:SP1VerifierScript --private-key $PRIVATE_KEY --verify --verifier etherscan --multi --broadcast --sig "freeze()"
FOUNDRY_PROFILE=deploy forge script ./script/deploy/v3.0.0-rc3/SP1VerifierPlonk.s.sol:SP1VerifierScript --private-key $PRIVATE_KEY --verify --verifier etherscan --multi --broadcast --sig "freeze()"
```

Change `v3.0.0-rc1` to the desired version to freeze.
Change `v3.0.0-rc3` to the desired version to freeze.

## For Developers: Integrate SP1 Contracts

Expand Down
6 changes: 2 additions & 4 deletions UPDATE_CONTRACTS.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@

# Update SP1 Contracts with New SP1 Version

This section outlines the steps required to update the SP1 contracts repository with a new SP1 version. Follow these instructions to ensure the SP1 contracts are correctly updated and aligned with the latest version.


1. Change the version tag in `Cargo.toml` to the target `sp1` version.

```toml
[dependencies]
sp1-sdk = { git = "https://github.com/succinctlabs/sp1", tag = "<SP1_TAG>" }
sp1-sdk = "<SP1_TAG>"
```

2. Update `contracts/src` with the new verifier contracts.
Expand All @@ -23,5 +21,5 @@ cargo run --bin artifacts --release
4. After merging to `main`, create a release tag with the same version as the `sp1` tag used.

## Miscellaneous
The SP1 Solidity contract artifacts are included in each release of `sp1`. You can see how these are included in the `sp1` repository [here](https://github.com/succinctlabs/sp1/blob/21455d318ae383b317c92e10709bbfc313d8f1df/recursion/gnark-ffi/src/plonk_bn254.rs#L57-L96).

The SP1 Solidity contract artifacts are included in each release of `sp1`. You can see how these are included in the `sp1` repository [here](https://github.com/succinctlabs/sp1/blob/21455d318ae383b317c92e10709bbfc313d8f1df/recursion/gnark-ffi/src/plonk_bn254.rs#L57-L96).
4 changes: 3 additions & 1 deletion contracts/deployments/11155111.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@
"V1_2_0_SP1_VERIFIER_PLONK": "0xc7Ed5531Fd663809Fc2C618f221933Cb3334e54B",
"V2_0_0_SP1_VERIFIER_GROTH16": "0x202dd4a519b2cAaCc9455BB670FE7950c0e40026",
"V2_0_0_SP1_VERIFIER_PLONK": "0xaeE21CeadF7A03b3034DAE4f190bFE5F861b6ebf",
"V3_0_0_RC1_SP1_VERIFIER_GROTH16": "0x8dB92f28D7C30154d38E55DbA1054b5A7Fc5A829"
"V3_0_0_RC1_SP1_VERIFIER_GROTH16": "0x8dB92f28D7C30154d38E55DbA1054b5A7Fc5A829",
"V3_0_0_RC3_SP1_VERIFIER_GROTH16": "0x890E1c4ff98453f1201e5cB65F6C588FD28748b0",
"V3_0_0_RC3_SP1_VERIFIER_PLONK": "0x31aeD863BecC509B9e16403c52C07560A0d4ecBf"
}
4 changes: 3 additions & 1 deletion contracts/deployments/11155420.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
"V2_0_0_SP1_VERIFIER_GROTH16": "0x202dd4a519b2cAaCc9455BB670FE7950c0e40026",
"V2_0_0_SP1_VERIFIER_PLONK": "0xaeE21CeadF7A03b3034DAE4f190bFE5F861b6ebf",
"V3_0_0_RC1_SP1_VERIFIER_GROTH16": "0x8dB92f28D7C30154d38E55DbA1054b5A7Fc5A829",
"V3_0_0_RC1_SP1_VERIFIER_PLONK": "0xCf5bB55AaE25b5A66CEfbe85d81b7b144472102A"
"V3_0_0_RC1_SP1_VERIFIER_PLONK": "0xCf5bB55AaE25b5A66CEfbe85d81b7b144472102A",
"V3_0_0_RC3_SP1_VERIFIER_GROTH16": "0x890E1c4ff98453f1201e5cB65F6C588FD28748b0",
"V3_0_0_RC3_SP1_VERIFIER_PLONK": "0x31aeD863BecC509B9e16403c52C07560A0d4ecBf"
}
4 changes: 3 additions & 1 deletion contracts/deployments/17000.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@
"V2_0_0_SP1_VERIFIER_GROTH16": "0x202dd4a519b2cAaCc9455BB670FE7950c0e40026",
"V2_0_0_SP1_VERIFIER_PLONK": "0xaeE21CeadF7A03b3034DAE4f190bFE5F861b6ebf",
"V3_0_0_RC1_SP1_VERIFIER_GROTH16": "0x8dB92f28D7C30154d38E55DbA1054b5A7Fc5A829",
"V3_0_0_RC1_SP1_VERIFIER_PLONK": "0xCf5bB55AaE25b5A66CEfbe85d81b7b144472102A"
"V3_0_0_RC1_SP1_VERIFIER_PLONK": "0xCf5bB55AaE25b5A66CEfbe85d81b7b144472102A",
"V3_0_0_RC3_SP1_VERIFIER_GROTH16": "0x890E1c4ff98453f1201e5cB65F6C588FD28748b0",
"V3_0_0_RC3_SP1_VERIFIER_PLONK": "0x31aeD863BecC509B9e16403c52C07560A0d4ecBf"
}
4 changes: 3 additions & 1 deletion contracts/deployments/421614.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@
"V2_0_0_SP1_VERIFIER_GROTH16": "0x202dd4a519b2cAaCc9455BB670FE7950c0e40026",
"V2_0_0_SP1_VERIFIER_PLONK": "0xaeE21CeadF7A03b3034DAE4f190bFE5F861b6ebf",
"V3_0_0_RC1_SP1_VERIFIER_GROTH16": "0x8dB92f28D7C30154d38E55DbA1054b5A7Fc5A829",
"V3_0_0_RC1_SP1_VERIFIER_PLONK": "0xCf5bB55AaE25b5A66CEfbe85d81b7b144472102A"
"V3_0_0_RC1_SP1_VERIFIER_PLONK": "0xCf5bB55AaE25b5A66CEfbe85d81b7b144472102A",
"V3_0_0_RC3_SP1_VERIFIER_GROTH16": "0x890E1c4ff98453f1201e5cB65F6C588FD28748b0",
"V3_0_0_RC3_SP1_VERIFIER_PLONK": "0x31aeD863BecC509B9e16403c52C07560A0d4ecBf"
}
4 changes: 3 additions & 1 deletion contracts/deployments/534351.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@
"V2_0_0_SP1_VERIFIER_GROTH16": "0x202dd4a519b2cAaCc9455BB670FE7950c0e40026",
"V2_0_0_SP1_VERIFIER_PLONK": "0xaeE21CeadF7A03b3034DAE4f190bFE5F861b6ebf",
"V3_0_0_RC1_SP1_VERIFIER_GROTH16": "0x8dB92f28D7C30154d38E55DbA1054b5A7Fc5A829",
"V3_0_0_RC1_SP1_VERIFIER_PLONK": "0xCf5bB55AaE25b5A66CEfbe85d81b7b144472102A"
"V3_0_0_RC1_SP1_VERIFIER_PLONK": "0xCf5bB55AaE25b5A66CEfbe85d81b7b144472102A",
"V3_0_0_RC3_SP1_VERIFIER_GROTH16": "0x890E1c4ff98453f1201e5cB65F6C588FD28748b0",
"V3_0_0_RC3_SP1_VERIFIER_PLONK": "0x31aeD863BecC509B9e16403c52C07560A0d4ecBf"
}
4 changes: 3 additions & 1 deletion contracts/deployments/84532.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@
"V2_0_0_SP1_VERIFIER_GROTH16": "0x202dd4a519b2cAaCc9455BB670FE7950c0e40026",
"V2_0_0_SP1_VERIFIER_PLONK": "0xaeE21CeadF7A03b3034DAE4f190bFE5F861b6ebf",
"V3_0_0_RC1_SP1_VERIFIER_GROTH16": "0x8dB92f28D7C30154d38E55DbA1054b5A7Fc5A829",
"V3_0_0_RC1_SP1_VERIFIER_PLONK": "0xCf5bB55AaE25b5A66CEfbe85d81b7b144472102A"
"V3_0_0_RC1_SP1_VERIFIER_PLONK": "0xCf5bB55AaE25b5A66CEfbe85d81b7b144472102A",
"V3_0_0_RC3_SP1_VERIFIER_GROTH16": "0x890E1c4ff98453f1201e5cB65F6C588FD28748b0",
"V3_0_0_RC3_SP1_VERIFIER_PLONK": "0x31aeD863BecC509B9e16403c52C07560A0d4ecBf"
}
38 changes: 38 additions & 0 deletions contracts/script/deploy/v3.0.0-rc3/SP1VerifierGroth16.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {BaseScript} from "../../utils/Base.s.sol";
import {SP1Verifier} from "../../../src/v3.0.0-rc3/SP1VerifierGroth16.sol";
import {SP1VerifierGateway} from "../../../src/SP1VerifierGateway.sol";
import {ISP1VerifierWithHash} from "../../../src/ISP1Verifier.sol";

contract SP1VerifierScript is BaseScript {
string internal constant KEY = "V3_0_0_RC3_SP1_VERIFIER_GROTH16";

function run() external multichain(KEY) broadcaster {
// Read config
bytes32 CREATE2_SALT = readBytes32("CREATE2_SALT");
address SP1_VERIFIER_GATEWAY = readAddress("SP1_VERIFIER_GATEWAY");

// Deploy contract
address verifier = address(new SP1Verifier{salt: CREATE2_SALT}());

// Add the verifier to the gateway
SP1VerifierGateway gateway = SP1VerifierGateway(SP1_VERIFIER_GATEWAY);
gateway.addRoute(verifier);

// Write address
writeAddress(KEY, verifier);
}

function freeze() external multichain(KEY) broadcaster {
// Read config
address SP1_VERIFIER_GATEWAY = readAddress("SP1_VERIFIER_GATEWAY");
address SP1_VERIFIER = readAddress(KEY);

// Freeze the verifier on the gateway
SP1VerifierGateway gateway = SP1VerifierGateway(SP1_VERIFIER_GATEWAY);
bytes4 selector = bytes4(ISP1VerifierWithHash(SP1_VERIFIER).VERIFIER_HASH());
gateway.freezeRoute(selector);
}
}
38 changes: 38 additions & 0 deletions contracts/script/deploy/v3.0.0-rc3/SP1VerifierPlonk.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {BaseScript} from "../../utils/Base.s.sol";
import {SP1Verifier} from "../../../src/v3.0.0-rc3/SP1VerifierPlonk.sol";
import {SP1VerifierGateway} from "../../../src/SP1VerifierGateway.sol";
import {ISP1VerifierWithHash} from "../../../src/ISP1Verifier.sol";

contract SP1VerifierScript is BaseScript {
string internal constant KEY = "V3_0_0_RC3_SP1_VERIFIER_PLONK";

function run() external multichain(KEY) broadcaster {
// Read config
bytes32 CREATE2_SALT = readBytes32("CREATE2_SALT");
address SP1_VERIFIER_GATEWAY = readAddress("SP1_VERIFIER_GATEWAY");

// Deploy contract
address verifier = address(new SP1Verifier{salt: CREATE2_SALT}());

// Add the verifier to the gateway
SP1VerifierGateway gateway = SP1VerifierGateway(SP1_VERIFIER_GATEWAY);
gateway.addRoute(verifier);

// Write address
writeAddress(KEY, verifier);
}

function freeze() external multichain(KEY) broadcaster {
// Read config
address SP1_VERIFIER_GATEWAY = readAddress("SP1_VERIFIER_GATEWAY");
address SP1_VERIFIER = readAddress(KEY);

// Freeze the verifier on the gateway
SP1VerifierGateway gateway = SP1VerifierGateway(SP1_VERIFIER_GATEWAY);
bytes4 selector = bytes4(ISP1VerifierWithHash(SP1_VERIFIER).VERIFIER_HASH());
gateway.freezeRoute(selector);
}
}
Loading
Loading