Skip to content

Commit

Permalink
prepare hardfork for deseq phase 2
Browse files Browse the repository at this point in the history
  • Loading branch information
ericlee42 committed Apr 8, 2024
1 parent 1c10939 commit bc70493
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 70 deletions.
62 changes: 1 addition & 61 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,60 +68,6 @@ services:
$ docker compose up -d
```

## Check syncing status

You can't use `eth_syncing` to check if the node is fully synchronized.

You can compare the block number of the local l2geth with the block number of our public node to determine whether the local service has been synchronized.

If they are equal, which means that your l2geth has synchronized.

```console
$ curl -sS 'http://localhost:8545' --data-raw '{"id":"1","jsonrpc":"2.0","method":"eth_blockNumber","params":[]}' -H 'Content-Type: application/json' | jq -r '.result' | xargs printf '%d\n'
26510
$ curl -sS 'https://andromeda.metis.io' --data-raw '{"id":"1","jsonrpc":"2.0","method":"eth_blockNumber","params":[]}' -H 'Content-Type: application/json' | jq -r '.result' | xargs printf '%d\n'
9612875
```

## Upgrade from legacy replica node

1. Prepare an ETH L1 node without history prune

Not an archive node, but transaction and event logs should be retained

Why?

Since we use p2p to setup a node, you can't trust your peers.

Many transactions, for example, deposits from L1, you can't verify them from p2p.

so it's a security consideration.

If you use your self maintained go-ethereum client

please don't set very high value for following key, 100 is recommended value.

if you use rpc from a third party, the value can set very high like 100k due to they have optimized for the queries.

```
DATA_TRANSPORT_LAYER__LOGS_PER_POLLING_INTERVAL=100
DATA_TRANSPORT_LAYER__TRANSACTIONS_PER_POLLING_INTERVAL=100
```

2. Delete configurations for legacy replica node

```
$ rm -rf path-to-l2geth/keystore
```

3. Update compose file and env

- Don't delete data of your l2geth, you can still use it!
- Don't change `GCMODE` env you're using
- Must not use the data and configration of l2dtl, current replica node uses l1dtl instead
- You can use the snapshot to spin up your l1dtl service. and we will update the snapshot id in the latest release from time to time.
- The env files have many changes, if you want to own custom configurations, make sure that your understand the result first.

## Quick start from snapshots

We provided public aws ebs snapshot for you if you need them.
Expand All @@ -134,13 +80,7 @@ l2geth

snap-0382a5d7113eed8ff

You can use the snapshots on aws us-east-1 region, and copy them to another region you are using.

We don't provide it on oss like s3, because it's very very slow to create, download and restore.

You can use the snapshots to start an rpc in 20 minutes, but you will take more than 5 hours if you use oss.

Finally, Don't forget to delete the nodekey to enable p2p connections
**Don't forget to delete the nodekey if the node key exists**

```
$ rm -rf path-to-l2geth/geth/nodekey
Expand Down
4 changes: 2 additions & 2 deletions docker-compose-mainnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "metis-mainnet"

services:
l1dtl:
image: metisdao/dtl:v0.0.2
image: metisdao/dtl:v0.1.2
platform: linux/amd64
stop_grace_period: 30s
network_mode: host
Expand All @@ -24,7 +24,7 @@ services:
max-file: "10"

l2geth:
image: metisdao/l2geth:v0.0.4
image: metisdao/l2geth:v0.1.2
platform: linux/amd64
restart: unless-stopped
stop_grace_period: 2m
Expand Down
4 changes: 2 additions & 2 deletions docker-compose-sepolia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "metis-sepolia"

services:
l1dtl:
image: metisdao/dtl:v0.0.2
image: metisdao/dtl:v0.1.2
platform: linux/amd64
container_name: l1dtl
stop_grace_period: 30s
Expand All @@ -26,7 +26,7 @@ services:
max-file: 10

l2geth:
image: metisdao/l2geth:v0.1.1
image: metisdao/l2geth:v0.1.2
platform: linux/amd64
container_name: l2geth
restart: unless-stopped
Expand Down
4 changes: 2 additions & 2 deletions mainnet/l1dtl.env
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ DATA_TRANSPORT_LAYER__DB_PATH=/data/db
DATA_TRANSPORT_LAYER__SERVER_PORT=7878
DATA_TRANSPORT_LAYER__TRANSACTIONS_PER_POLLING_INTERVAL=1000
DATA_TRANSPORT_LAYER__CONFIRMATIONS=12
DATA_TRANSPORT_LAYER__POLLING_INTERVAL=60000
DATA_TRANSPORT_LAYER__POLLING_INTERVAL=10000
DATA_TRANSPORT_LAYER__LOGS_PER_POLLING_INTERVAL=1000
DATA_TRANSPORT_LAYER__DANGEROUSLY_CATCH_ALL_ERRORS=true
DATA_TRANSPORT_LAYER__SERVER_HOSTNAME=0.0.0.0
Expand All @@ -23,7 +23,7 @@ DATA_TRANSPORT_LAYER__MINIO_SECRET_KEY=8uyywb*7y3

DATA_TRANSPORT_LAYER__BATCH_INBOX_ADDRESS=0xff00000000000000000000000000000000001088
DATA_TRANSPORT_LAYER__BATCH_INBOX_SENDER=0x1a9da0aeda630ddf2748a453bf6d92560762d914
DATA_TRANSPORT_LAYER__DESEQBLOCK=0
DATA_TRANSPORT_LAYER__DESEQBLOCK=16500000
DATA_TRANSPORT_LAYER__BATCH_INBOX_START_INDEX=42647
DATA_TRANSPORT_LAYER__BATCH_INBOX_L1_HEIGHT=19438451

Expand Down
4 changes: 2 additions & 2 deletions mainnet/l2geth.env
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ WS_ORIGINS=*

# seqset
SEQSET_VALID_HEIGHT=15214531
DESEQBLOCK=0
DESEQBLOCK=16500000
SEQSET_CONTRACT=0x0fe382b74C3894B65c10E5C12ae60Bbd8FAf5b48
SEQ_BRIDGE_URL=https://andromeda.metis.io
BOOTNODES=enode://61b617d2549296b0b950efcf8c1d87227d454d44362e642dde37d83092a445f2b6a6fd651d611b2893249d1e9d15c8f1d4b067142cff53280a08c9c7565c29e2@3.22.33.68:30303,enode://524e335aaa2a4555fe2d54f07fc34da83d80b0407d86c606b76ce918f96a348cf91947f7c60b0eabd29f68d2669cc0ced1360636daa53d0ccc948e154d0ce21e@3.129.121.37:30303,enode://c4cc213e3c5cb57b1ea6e1aa0b8a28240b03a5fa4b65ff08c53faf448182ae161d68c78fe48040da1e5d9087c6f19b60644605c4c2d78845627f09b90207e56c@3.17.198.212:30303
BOOTNODES=enode://61b617d2549296b0b950efcf8c1d87227d454d44362e642dde37d83092a445f2b6a6fd651d611b2893249d1e9d15c8f1d4b067142cff53280a08c9c7565c29e2@3.22.33.68:30303,enode://524e335aaa2a4555fe2d54f07fc34da83d80b0407d86c606b76ce918f96a348cf91947f7c60b0eabd29f68d2669cc0ced1360636daa53d0ccc948e154d0ce21e@3.129.121.37:30303,enode://c4cc213e3c5cb57b1ea6e1aa0b8a28240b03a5fa4b65ff08c53faf448182ae161d68c78fe48040da1e5d9087c6f19b60644605c4c2d78845627f09b90207e56c@3.17.198.212:30303,enode://690969c716d2e4f55936a2801ab1d513598f8f2afa85be1c9f9c41e8ce1f07ee352dac2925f86fd54449d7bdd9bddc7342d33c0c46c604db19de63e21362f2cd@54.237.23.7:30303,enode://9bbe2b0d7e2cd7c3de7f9674fb95059026667e9b9ce717f927b4f53132dde131fab34995a984ed47328f867e5efea4e5a27dc6a90b6b1f4106f07be215e0ece5@54.174.30.211:30303,enode://2577f7c6ffafcdf311e2f79bcc56671825f00a265e5cd1f0224d8bd4b484ba1870930584f37593abfb910a76b51fa82a8b48c53d2511848680beb00c357cf3e0@52.20.251.43:30303,enode://5a41bbc2a57c90b443244bc2d9c4470ee84b7af21aa27256178e53a1772950c3bf9a2b6c1a761688064aaa8456f6b4e918918cda867ce59d007ff825bbefe61d@3.126.202.64:30303,enode://c0c2826d5bc7baeb2b8fe3aa8726d2572508142aa2476e2d2a667c7452a3dc78b47c1176522a9b4c3203902c3ae487ae4b656c7089334536d9c1468056799939@52.57.227.34:30303,enode://86fffa408fca0afc8c9f5cf3f5831d1bc39c2a49d3690ae5219001ff7bec08cac6932dc7e94c65186f7d46daa738449f2eb361d50cde15212a8e8c84eec62605@18.193.199.155:30303
2 changes: 1 addition & 1 deletion sepolia/l1dtl.env
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ DATA_TRANSPORT_LAYER__SYNC_FROM_L2=false
DATA_TRANSPORT_LAYER__L2_CHAIN_ID=59902
DATA_TRANSPORT_LAYER__DB_PATH=/data/db
DATA_TRANSPORT_LAYER__CONFIRMATIONS=12
DATA_TRANSPORT_LAYER__POLLING_INTERVAL=15000
DATA_TRANSPORT_LAYER__POLLING_INTERVAL=10000
DATA_TRANSPORT_LAYER__TRANSACTIONS_PER_POLLING_INTERVAL=1000
DATA_TRANSPORT_LAYER__LOGS_PER_POLLING_INTERVAL=1000
DATA_TRANSPORT_LAYER__DANGEROUSLY_CATCH_ALL_ERRORS=true
Expand Down

0 comments on commit bc70493

Please sign in to comment.