Skip to content

Commit c4465d4

Browse files
authored
Merge pull request #38 from ironbeer/support-granite
Support for Granite upgrade
2 parents d8fccb6 + 3d44bb7 commit c4465d4

5 files changed

+162
-17
lines changed

.env.sample.mainnet

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Layer1 settings
22
L1_CHAIN_ID=248
33
L1_ETH_RPC_HTTP=https://rpc.mainnet.oasys.games/
4+
L1_BEACON_API=https://beacon-api.mainnet.oasys.games/
45

56
# Layer2 settings
67
OP_CHAIN_ID=<L2 Chain ID>
@@ -68,3 +69,10 @@ OP_ENGINE_RPC=ws://op-geth:8551
6869
OP_ROLLUP_RPC=http://op-node:8547
6970
OP_ENGINE_REPLICA_RPC=ws://op-geth-replica:8551
7071
OP_ROLLUP_REPLICA_RPC=http://op-node-replica:8547
72+
73+
# Block timestamps for upgrades (empty = no upgrade)
74+
OP_OVERRIDE_CANYON=
75+
OP_OVERRIDE_DELTA=
76+
OP_OVERRIDE_ECOTONE=
77+
OP_OVERRIDE_FJORD=
78+
OP_OVERRIDE_GRANITE=

.env.sample.private

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
#################################################
2+
# WARNING: DO NOT USE THIS ENV FILE FOR MAINNET #
3+
#################################################
4+
5+
# Layer1 settings
6+
L1_CHAIN_ID=12345
7+
L1_ETH_RPC_HTTP=http://host.docker.internal:8080/rpc
8+
L1_BEACON_API=http://host.docker.internal:8080/beacon-api
9+
10+
# Layer2 settings
11+
OP_CHAIN_ID=4200
12+
# address of the `L2OutputOracleProxy` contract on L1
13+
OP_L2OO_ADDR=0x99C0965A4527c785c712fD25142184C346D52163
14+
# address of the `AddressManager` contract on L1
15+
OP_AM_ADDR=0x0000000000000000000000000000000000000000
16+
# address of the `L1CrossDomainMessengerProxy` contract on L1
17+
OP_L1CDM_ADDR=0xB6F91848c6eDA8E6c558bE39161DD9938ac249aa
18+
# address of the `L1StandardBridgeProxy` contract on L1
19+
OP_L1BRIDGE_ADDR=0x50FCa4b3e77E50bfA359B0110fe9900D7C85689a
20+
# address of the `OptimismPortalProxy` contract on L1
21+
OP_PORTAL_ADDR=0x28C0A2d63dA3B02da3DDAa18571F5B7Ee57d2893
22+
23+
# `verse-verifier` settings
24+
VERIFIER_EXTRA_ARGS="
25+
--config.p2p.no_announce=
26+
--config.p2p.connection_filter=
27+
--config.p2p.bootnodes=/dns4/host.docker.internal/tcp/4101/p2p/12D3KooWGXJ4BoXZupp2wzAr7dfyspRLaoYW4qPvVGoacGAUiSh2
28+
--config.p2p.bootnodes=/dns4/host.docker.internal/udp/4101/quic/p2p/12D3KooWGXJ4BoXZupp2wzAr7dfyspRLaoYW4qPvVGoacGAUiSh2
29+
"
30+
31+
# Wallets
32+
## Builder and FinalSystemOwner (Hardhat #0)
33+
## Address: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
34+
## Key : 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
35+
36+
## `op-node` use for p2p sync with replicas
37+
P2P_SEQUENCER_ADDR=0xa914B9cA99677b5B9B4931D25Cd634aA9D10C537
38+
P2P_SEQUENCER_KEY=0xeeee8a7eebe8a995ede500b69e0c9ec0bf5989c1578d41fd1a27c0709f3dd1c6
39+
40+
## `op-proposer` uses for state submission to the `L2OutputOracle` contract on L1
41+
OP_PROPOSER_ADDR=0xa8d4AcF8081A20d2EFb2229169bc52750Cb085D4
42+
OP_PROPOSER_KEY=0xc976cf0e2873300774d216faf1932d45d23256c54293211ea2aa0689d7667d2b
43+
44+
## `op-batcher` uses for batch submission to the `OP_BATCH_INBOX_ADDR` on L1
45+
OP_BATCHER_ADDR=0xEd98afe5ED8424A251DD0b7813f67DB2833531eF
46+
OP_BATCHER_KEY=0xb8971409b424ef3c5bc0ca867b94d81b7fdb2dcbe5625b0906d332359b09c046
47+
48+
## `op-message-relayer` uses for messaging from L2 to L1
49+
MR_PROVER_ADDR=0x99B7D33BA84b9Fab2D331509FFd4906548A681FC
50+
MR_PROVER_KEY=0x6c1d63f432685ac07d19058000c92aa24b393880ebb860222d1bcc870b5a84ab
51+
MR_FINALIZER_ADDR=0x6a9a1914b1080C0C0409565A1536B338fb1E51De
52+
MR_FINALIZER_KEY=0x2033aa4d6ddf71c0c486aa722e9eb10aa760a2cde2f38d505a229ed8ebc659ed
53+
54+
## `verse-verifier` is used for submitting signatures to the L1 verification contract.
55+
VERIFY_SUBMITTER_ADDR=0x10478e792D994af202DBbA22503A8Fb0D33cB945
56+
VERIFY_SUBMITTER_KEY=0x3b0c64671c43eb66afb38fdd6a25616216a4a96820cdb919d175121f4375117e
57+
58+
# Container published ports
59+
## op-geth
60+
OP_ETH_RPC_HTTP_PORT=18545
61+
OP_ETH_RPC_WS_PORT=18546
62+
63+
## op-node
64+
OP_ROLLUP_RPC_PORT=8547
65+
OP_ROLLUP_P2P_PORT=9222
66+
67+
## verse-verifier
68+
VERIFIER_P2P_PORT=4102
69+
70+
## message-relayer
71+
RELAYER_HTTP_PORT=7300
72+
73+
# internal endpointss
74+
OP_ETH_RPC_HTTP=http://op-geth:8545
75+
OP_ETH_RPC_WS=ws://op-geth:8546
76+
OP_ENGINE_RPC=ws://op-geth:8551
77+
OP_ROLLUP_RPC=http://op-node:8547
78+
OP_ENGINE_REPLICA_RPC=ws://op-geth-replica:8551
79+
OP_ROLLUP_REPLICA_RPC=http://op-node-replica:8547
80+
81+
# Block timestamps for upgrades (empty = no upgrade)
82+
OP_OVERRIDE_CANYON=
83+
OP_OVERRIDE_DELTA=
84+
OP_OVERRIDE_ECOTONE=
85+
OP_OVERRIDE_FJORD=
86+
OP_OVERRIDE_GRANITE=

.env.sample.testnet

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Layer1 settings
22
L1_CHAIN_ID=9372
33
L1_ETH_RPC_HTTP=https://rpc.testnet.oasys.games/
4+
L1_BEACON_API=https://beacon-api.testnet.oasys.games/
45

56
# Layer2 settings
67
OP_CHAIN_ID=<L2 Chain ID>
@@ -66,3 +67,10 @@ OP_ENGINE_RPC=ws://op-geth:8551
6667
OP_ROLLUP_RPC=http://op-node:8547
6768
OP_ENGINE_REPLICA_RPC=ws://op-geth-replica:8551
6869
OP_ROLLUP_REPLICA_RPC=http://op-node-replica:8547
70+
71+
# Block timestamps for upgrades (empty = no upgrade)
72+
OP_OVERRIDE_CANYON=
73+
OP_OVERRIDE_DELTA=
74+
OP_OVERRIDE_ECOTONE=
75+
OP_OVERRIDE_FJORD=
76+
OP_OVERRIDE_GRANITE=

README.md

+44-8
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,21 @@ This repository offers Docker configurations for effortlessly running the Opstac
77

88
Please follow the steps below to get your Verse up and running. If you encounter any issues while building, please refer to the [QA](#frequently-asked-questions) section.
99

10+
## About Versions
11+
This repository follows semantic versioning with the major version fixed at `v1`(meaning Verse V1). Minor version updates correspond to OPStack protocol upgrades(hardforks). Patch version updates are releases focused on bug fixes and parameter changes. It is strongly recommended to pin to a specific version after git cloning, as tracking the main branch would result in automatic application of upgrades.
12+
```shell
13+
git checkout <version tag>
14+
```
15+
16+
Version tags to OPStack upgrades mapping:
17+
| Tag | Upgrade |
18+
| --- | --- |
19+
| v1.0.0 ~ | Bedrock (Includes [Regolith](https://specs.optimism.io/protocol/regolith/overview.html)) |
20+
| v1.1.0 ~ | [Canyon](https://specs.optimism.io/protocol/canyon/overview.html) |
21+
| v1.2.0 ~ | [Granite](https://specs.optimism.io/protocol/granite/overview.html) (Includes [Delta](https://specs.optimism.io/protocol/delta/overview.html), [Ecotone](https://specs.optimism.io/protocol/ecotone/overview.html), [Fjord](https://specs.optimism.io/protocol/fjord/overview.html)) |
22+
1023
## Steps to Launch Verse
11-
Before beginning, ensure that the L1 contract sets have already been deployed, and you possess the necessary configuration files (`addresses.json`, `deploy-config.json`). If not, please refer to the contract sets deployment section in our [technical documentation](https://docs.oasys.games/docs/verse-developer/how-to-build-verse/manual).
24+
Before beginning, ensure that the L1 contract sets have already been deployed, and you possess the necessary configuration files (`addresses.json`, `deploy-config.json`). If not, please refer to the contract sets deployment section in our [technical documentation](https://docs.oasys.games/docs/category/build-verse).
1225

1326
### 1. Prepare Assets and Environment
1427
#### Place Configuration Files
@@ -33,8 +46,13 @@ cp .env.sample.mainnet .env
3346

3447
# Sample for testnet
3548
cp .env.sample.testnet .env
49+
50+
# Sample for private
51+
cp .env.sample.private .env
3652
```
3753

54+
> *Related project for building a private L2: [oasys-private-l1](https://github.com/oasysgames/oasys-private-l1)*
55+
3856
To configure the environment file with addresses sourced from `addresses.json`, use the following commands to extract the required addresses:
3957
```shell
4058
# Retrieve OP_L2OO_ADDR from addresses.json
@@ -101,18 +119,36 @@ chown 65534:65534 ./data/{op-geth,op-node,message-relayer,message-relayer/{state
101119
#### Generate Chain Configurations
102120
Verify successful generation of configuration files. The produced files (`genesis.json` and `rollup.json`) will be placed in the assets directory:
103121
```shell
104-
docker-compose run --rm --no-deps --user=root op-node genesis l2 \
105-
--l1-rpc "$(grep L1_ETH_RPC_HTTP .env | cut -d= -f2)" \
106-
--deploy-config /assets/deploy-config.json \
107-
--l1-deployments /assets/addresses.json \
108-
--outfile.l2 /assets/genesis.json \
109-
--outfile.rollup /assets/rollup.json
122+
docker run --rm -ti -u 65534:65534 -v $PWD/assets:/assets \
123+
ghcr.io/oasysgames/oasys-opstack/op-node:v1.0.0 op-node genesis l2 \
124+
--l1-rpc "$(grep L1_ETH_RPC_HTTP .env | cut -d= -f2)" \
125+
--deploy-config /assets/deploy-config.json \
126+
--l1-deployments /assets/addresses.json \
127+
--outfile.l2 /assets/genesis.json \
128+
--outfile.rollup /assets/rollup.json
129+
```
130+
131+
#### Add upgrade timestamps to .env
132+
Add the block timestamps for L2 upgrades to the `.env` file. These timestamps must be set slightly in the future as `op-node` and `op-geth` must be launched before the specified times. All timestamps can be set to the same value, but due to specification constraints, `0` cannot be used.
133+
```dotenv
134+
# Block timestamps for upgrades (empty = no upgrade)
135+
OP_OVERRIDE_CANYON=
136+
OP_OVERRIDE_DELTA=
137+
OP_OVERRIDE_ECOTONE=
138+
OP_OVERRIDE_FJORD=
139+
OP_OVERRIDE_GRANITE=
110140
```
111141

142+
*Example command to get timestamp 10 minutes ahead*: `expr $(date +%s) + 600`
143+
144+
> [!IMPORTANT]
145+
> **Do not modify timestamps after upgrades have been applied. In particular, never re-change to a future.**
146+
112147
#### Generate the Genesis Block
113148
Ensure the successful generation of the genesis block (number=0):
114149
```shell
115-
docker-compose run --rm --no-deps op-geth init /assets/genesis.json
150+
docker run --rm -ti -u 65534:65534 -v $PWD/assets:/assets -v $PWD/data/op-geth:/data \
151+
ghcr.io/oasysgames/oasys-op-geth:v1.0.0 --datadir /data init /assets/genesis.json
116152
```
117153

118154

docker-compose.yml

+16-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3'
2-
31
x-resident: &resident
42
restart: unless-stopped
53
user: nobody
@@ -12,7 +10,7 @@ x-resident: &resident
1210
services:
1311
op-geth:
1412
<<: *resident
15-
image: ghcr.io/oasysgames/oasys-op-geth:v1.2.0
13+
image: ghcr.io/oasysgames/oasys-op-geth:v1.3.0-18a5e9f31
1614
entrypoint: geth
1715
environment:
1816
GETH_DATADIR: /data
@@ -21,12 +19,12 @@ services:
2119
GETH_HTTP_VHOSTS: '*'
2220
GETH_HTTP_ADDR: 0.0.0.0
2321
GETH_HTTP_PORT: 8545
24-
GETH_HTTP_API: net,eth,web3
22+
GETH_HTTP_API: net,eth,web3,miner
2523
GETH_WS: 'true'
2624
GETH_WS_ORIGINS: '*'
2725
GETH_WS_ADDR: 0.0.0.0
2826
GETH_WS_PORT: 8546
29-
GETH_WS_API: net,eth,web3
27+
GETH_WS_API: net,eth,web3,miner
3028
GETH_SYNCMODE: full
3129
GETH_GCMODE: archive
3230
GETH_CACHE: 4096
@@ -39,7 +37,10 @@ services:
3937
GETH_AUTHRPC_JWTSECRET: /assets/jwt.txt
4038
GETH_TXPOOL_PRICELIMIT: 0
4139
GETH_ROLLUP_SUPERCHAIN_UPGRADES: 'false'
42-
GETH_OVERRIDE_CANYON: null # null = no fork
40+
GETH_OVERRIDE_CANYON: $OP_OVERRIDE_CANYON
41+
GETH_OVERRIDE_ECOTONE: $OP_OVERRIDE_ECOTONE
42+
GETH_OVERRIDE_FJORD: $OP_OVERRIDE_FJORD
43+
GETH_OVERRIDE_GRANITE: $OP_OVERRIDE_GRANITE
4344
volumes:
4445
- ./assets:/assets
4546
- ./data/op-geth:/data
@@ -49,10 +50,11 @@ services:
4950

5051
op-node:
5152
<<: *resident
52-
image: ghcr.io/oasysgames/oasys-opstack/op-node:v1.1.0
53+
image: ghcr.io/oasysgames/oasys-opstack/op-node:v1.2.0-a0f55fa2d
5354
entrypoint: op-node
5455
environment:
5556
OP_NODE_L1_ETH_RPC: $L1_ETH_RPC_HTTP
57+
OP_NODE_L1_BEACON: $L1_BEACON_API
5658
OP_NODE_L1_RPC_KIND: basic
5759
OP_NODE_L1_EPOCH_POLL_INTERVAL: 192s
5860
OP_NODE_L1_HTTP_POLL_INTERVAL: 6s
@@ -74,6 +76,11 @@ services:
7476
OP_NODE_P2P_DISCOVERY_PATH: memory
7577
OP_NODE_P2P_PEERSTORE_PATH: memory
7678
OP_NODE_P2P_NO_DISCOVERY: 'true'
79+
OP_NODE_OVERRIDE_CANYON: $OP_OVERRIDE_CANYON
80+
OP_NODE_OVERRIDE_DELTA: $OP_OVERRIDE_DELTA
81+
OP_NODE_OVERRIDE_ECOTONE: $OP_OVERRIDE_ECOTONE
82+
OP_NODE_OVERRIDE_FJORD: $OP_OVERRIDE_FJORD
83+
OP_NODE_OVERRIDE_GRANITE: $OP_OVERRIDE_GRANITE
7784
volumes:
7885
- ./assets:/assets
7986
- ./data/op-node:/data
@@ -85,7 +92,7 @@ services:
8592

8693
op-batcher:
8794
<<: *resident
88-
image: ghcr.io/oasysgames/oasys-opstack/op-batcher:v1.1.0
95+
image: ghcr.io/oasysgames/oasys-opstack/op-batcher:v1.2.0-a0f55fa2d
8996
entrypoint: op-batcher
9097
environment:
9198
OP_BATCHER_L1_ETH_RPC: $L1_ETH_RPC_HTTP
@@ -103,7 +110,7 @@ services:
103110

104111
op-proposer:
105112
<<: *resident
106-
image: ghcr.io/oasysgames/oasys-opstack/op-proposer:v1.1.0
113+
image: ghcr.io/oasysgames/oasys-opstack/op-proposer:v1.2.0-a0f55fa2d
107114
entrypoint: op-proposer
108115
environment:
109116
OP_PROPOSER_L1_ETH_RPC: $L1_ETH_RPC_HTTP

0 commit comments

Comments
 (0)