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: migrate OPSuccinctL2OutputOracle to OptimismPortalV2 #277

Merged
merged 36 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
20bd110
forge install: solady
leruaa Dec 13, 2024
1f28ebe
feat: impl IDisputeGame for OPSuccinctL2OutputOracle
leruaa Dec 13, 2024
ca1eaa9
feat: update deployment
leruaa Dec 13, 2024
8418b7c
add a thin, clonable wrapper on OPSuccinctL2OutputOracle
leruaa Jan 3, 2025
cbcf629
add a test for OPSuccinctDisputeGame initialize()
leruaa Jan 6, 2025
e386e4e
use a more recent tx to make `testOPSuccinctDisputeGame` test pass
leruaa Jan 7, 2025
4bd230a
revert useless OPSuccinctL2OutputOracle IDisputeGame impl
leruaa Jan 7, 2025
f1dc0e8
add OPSuccinctDisputeGame bindings
leruaa Jan 7, 2025
0cb9d04
add OPSuccinctDisputeGameFactory
leruaa Jan 7, 2025
c8e529e
allow to propose output roots using DisputeGameFactory
leruaa Jan 7, 2025
3c9601a
init deployment scripts
leruaa Jan 9, 2025
f238d22
fix server in mock mode
leruaa Jan 9, 2025
b6fd11f
use DGF if the address is provided
leruaa Jan 9, 2025
34b3ef1
Merge branch 'main' into aurelien/dispute-game
leruaa Jan 10, 2025
8f6ba7c
fmt
leruaa Jan 10, 2025
3158d35
add deploy-dispute-game-factory to justfile
leruaa Jan 10, 2025
a90dd34
fix: don't disable logs on the server (#320)
leruaa Jan 10, 2025
4a317f9
feat: rc10 bump + fix mock mode (#323)
ratankaliani Jan 13, 2025
0a8b80e
add test for OPSuccinctL2OutputOracleFactory
leruaa Jan 13, 2025
67b93ed
update book
leruaa Jan 13, 2025
a3e4484
small fixes
leruaa Jan 13, 2025
eb54fad
impl ISemver
leruaa Jan 13, 2025
a684b65
set permissionless proposing in the deployment
leruaa Jan 13, 2025
344c464
OPSuccinctDisputeGameFactory: allow to change impl
leruaa Jan 13, 2025
8827da9
proposer small fixes
leruaa Jan 13, 2025
6e89ac2
don't pin op-deployer version for Kurtosis
leruaa Jan 13, 2025
9ce9ec8
forge fmt
leruaa Jan 14, 2025
abbc052
update book
leruaa Jan 14, 2025
9725fe5
small fixes
leruaa Jan 14, 2025
b9e9072
nits
leruaa Jan 15, 2025
5652806
add a to do for GameTypes.OP_SUCCINCT
leruaa Jan 15, 2025
903d0b0
feat(utils/client): add secp256r1 cycle tracking (#324)
fakedev9999 Jan 14, 2025
bfc7438
chore(proposer): add jq and nc to docker image (#322)
emilianobonassi Jan 14, 2025
23a53d7
feat(programs): Use allocator (#319)
ratankaliani Jan 15, 2025
64de2f0
docs: add troubleshooting.md (#325)
fakedev9999 Jan 15, 2025
6693663
chore: add ci for elf check (#326)
fakedev9999 Jan 15, 2025
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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "contracts/lib/sp1-contracts"]
path = contracts/lib/sp1-contracts
url = https://github.com/succinctlabs/sp1-contracts
[submodule "contracts/lib/solady"]
path = contracts/lib/solady
url = https://github.com/vectorized/solady
68 changes: 34 additions & 34 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ op-alloy-rpc-types-engine = { version = "0.6.8", default-features = false }
op-alloy-network = { version = "0.6.8", default-features = false }

# sp1
sp1-lib = { version = "4.0.0-rc.9", features = ["verify"] }
sp1-sdk = { version = "4.0.0-rc.9" }
sp1-zkvm = { version = "4.0.0-rc.9", features = ["verify"] }
sp1-build = { version = "4.0.0-rc.9" }
sp1-lib = { version = "4.0.0-rc.10", features = ["verify"] }
sp1-sdk = { version = "4.0.0-rc.10" }
sp1-zkvm = { version = "4.0.0-rc.10", features = ["verify"] }
sp1-build = { version = "4.0.0-rc.10" }

[profile.release-client-lto]
inherits = "release"
Expand Down
45 changes: 44 additions & 1 deletion book/quick-start/full.md
leruaa marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ In the root directory, create a file called `.env` and set the following environ

There are additional optional parameters that you can set in the `.env` file. See the [Advanced Parameters](../contracts/configuration.md#optional-advanced-parameters) section for more information.

### 2) Deploy the `OPSuccinctL2OutputOracle` contract.
### 2) Deploy the `OPSuccinctL2OutputOracle` contract

This contract is a modification of the `L2OutputOracle` contract which verifies a proof along with the proposed state root.

Expand Down Expand Up @@ -70,6 +70,44 @@ Estimated amount required: 0.00431887950806754 ETH

In these deployment logs, `0xde4656D4FbeaC0c0863Ab428727e3414Fa251A4C` is the address of the proxy for the `OPSuccinctL2OutputOracle` contract. This deployed proxy contract is used to track the verified state roots of the OP Stack chain on L1.

#### 3.1) *Optional:* Deploy the `OPSuccinctDisputeGameFactory` contract

Optionally, deploy the `OPSuccinctDisputeGameFactory` contract.

```shell
just deploy-dispute-game-factory
```

If successful, you should see the following output:

```
[⠊] Compiling...
[⠊] Compiling 1 files with Solc 0.8.15
[⠒] Solc 0.8.15 finished in 1.93s
Compiler run successful!
Script ran successfully.

== Return ==
0: address 0x6A04B767f15055aebFFd21157D12aB12e8B764Ed

## Setting up 1 EVM.

==========================

Chain 3151908

Estimated gas price: 1.000000014 gwei

Estimated total gas used for script: 1614671

Estimated amount required: 0.001614671022605394 ETH

==========================
```

In these deployment logs, `0x6A04B767f15055aebFFd21157D12aB12e8B764Ed` is the address of the proxy for the `OPSuccinctDisputeGameFactory` contract.


### 3) `op-succinct` service environment variables

To start the `op-succinct` service, add the following parameters to the `.env` file in the root directory:
Expand All @@ -80,6 +118,10 @@ To start the `op-succinct` service, add the following parameters to the `.env` f
| `NETWORK_PRIVATE_KEY` | The private key for the account that will be submitting proofs to the L1. |
| `NETWORK_RPC_URL` | The RPC endpoint for the Succinct Prover Network. The default endpoint (`https://rpc.succinct.xyz`) is not suitable for use in OP Succinct. Reach out to the Succinct team to get access with OP Succinct. |

If you want the proposer to use the `OPSuccinctDisputeGameFactory` contract, you must add an additional parameter `DGF_ADDRESS` to the `.env` file
with the `OPSuccinctDisputeGameFactory` contract address.


Now, you should have the following in your `.env` file:

| Parameter | Description |
Expand All @@ -91,6 +133,7 @@ Now, you should have the following in your `.env` file:
| `PRIVATE_KEY` | Private key for the account that will be deploying the contract and relaying proofs on-chain. |
| `ETHERSCAN_API_KEY` | Etherscan API key for verifying the deployed contracts. |
| `L2OO_ADDRESS` | The address of the `OPSuccinctL2OutputOracle` contract from the previous step. |
| `DGF_ADDRESS` | *Optional* The address of the `OPSuccinctDisputeGameFactory` contract from the previous step. |
| `NETWORK_PRIVATE_KEY` | The private key for the account that will be submitting proofs to the L1. |
| `NETWORK_RPC_URL` | Reach out to the Succinct team to get access [here](https://docs.google.com/forms/d/e/1FAIpQLSd2Yil8TrU54cIuohH1WvDvbxTusyqh5rsDmMAtGC85-Arshg/viewform?ref=https://succinctlabs.github.io/op-succinct/). The default endpoint (`https://rpc.succinct.xyz`) is not suitable for use in OP Succinct. |

Expand Down
43 changes: 42 additions & 1 deletion book/quick-start/mock.md
leruaa marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ If you have multiple environments, you can pass the environment file to the `dep
just deploy-mock-verifier <env_file>
```

### 3) Deploy the `OPSuccinctL2OutputOracle` contract.
### 3) Deploy the `OPSuccinctL2OutputOracle` contract

This contract is a modification of the `L2OutputOracle` contract which verifies a proof along with the proposed state root.

Expand Down Expand Up @@ -116,6 +116,43 @@ Estimated amount required: 0.00431887950806754 ETH

In these deployment logs, `0xde4656D4FbeaC0c0863Ab428727e3414Fa251A4C` is the address of the proxy for the `OPSuccinctL2OutputOracle` contract. This deployed proxy contract is used to track the verified state roots of the OP Stack chain on L1.

#### 3.1) *Optional:* Deploy the `OPSuccinctDisputeGameFactory` contract

Optionally, deploy the `OPSuccinctDisputeGameFactory` contract.

```shell
just deploy-dispute-game-factory
```

If successful, you should see the following output:

```
[⠊] Compiling...
[⠊] Compiling 1 files with Solc 0.8.15
[⠒] Solc 0.8.15 finished in 1.93s
Compiler run successful!
Script ran successfully.

== Return ==
0: address 0x6B3342821680031732Bc7d4E88A6528478aF9E38

## Setting up 1 EVM.

==========================

Chain 3151908

Estimated gas price: 1.000000014 gwei

Estimated total gas used for script: 1614671

Estimated amount required: 0.001614671022605394 ETH

==========================
```

In these deployment logs, `0x6B3342821680031732Bc7d4E88A6528478aF9E38` is the address of the proxy for the `OPSuccinctDisputeGameFactory` contract.

### 4) Set `op-succinct` service environment variables

To start the mock `op-succinct` service, add the following parameters to the `.env` file in the root directory:
Expand All @@ -125,6 +162,9 @@ To start the mock `op-succinct` service, add the following parameters to the `.e
| `L2OO_ADDRESS` | The address of the `OPSuccinctL2OutputOracle` contract from the previous step. |
| `OP_SUCCINCT_MOCK` | Set to `true` for mock mode. |

If you want the proposer to use the `OPSuccinctDisputeGameFactory` contract, you must add an additional parameter `DGF_ADDRESS` to the `.env` file
with the `OPSuccinctDisputeGameFactory` contract address.

leruaa marked this conversation as resolved.
Show resolved Hide resolved
Now, you should have the following in your `.env` file:

| Parameter | Description |
Expand All @@ -136,6 +176,7 @@ Now, you should have the following in your `.env` file:
| `PRIVATE_KEY` | Private key for the account that will be deploying the contract and relaying proofs on-chain. |
| `ETHERSCAN_API_KEY` | Etherscan API key for verifying the deployed contracts. |
| `L2OO_ADDRESS` | The address of the `OPSuccinctL2OutputOracle` contract from the previous step. |
| `DGF_ADDRESS` | *Optional* The address of the `OPSuccinctDisputeGameFactory` contract from the previous step. |
leruaa marked this conversation as resolved.
Show resolved Hide resolved
| `OP_SUCCINCT_MOCK` | Set to `true` for mock mode. |

### 5) Start the `op-succinct` service in mock mode.
Expand Down
7 changes: 6 additions & 1 deletion contracts/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ remappings = [
"@openzeppelin/=lib/openzeppelin-contracts/",
"@optimism/=lib/optimism/packages/contracts-bedrock/",
"@forge-std/=lib/forge-std/src/",
"@solady/=lib/solady/src",
# Note: Use zobront/sp1-contracts as the current version for SP1 contracts is not compatible with the hard
# version for 0.8.15 on some Optimism contracts.
"@sp1-contracts/=lib/sp1-contracts/contracts/",
Expand All @@ -15,9 +16,13 @@ remappings = [
"src/libraries/=lib/optimism/packages/contracts-bedrock/src/libraries/",
"src/L1/=lib/optimism/packages/contracts-bedrock/src/L1/",
"src/L2/=lib/optimism/packages/contracts-bedrock/src/L2/",
"src/dispute/=lib/optimism/packages/contracts-bedrock/src/dispute/"
]

# Enable read-write access to opsuccinctl2ooconfig.json
fs_permissions = [{ access = "read-write", path = "./opsuccinctl2ooconfig.json" }]
fs_permissions = [
{ access = "read-write", path = "./opsuccinctl2ooconfig.json" },
{ access = "read-write", path = "./opsuccinctl2ooconfig-test.json" }
]

# See more config options https://github.com/foundry-rs/foundry/tree/master/config
1 change: 1 addition & 0 deletions contracts/lib/solady
Submodule solady added at 513f58
Loading
Loading