testinprod-io / op-erigon

Optimism implementation on the efficiency frontier
https://op-erigon.testinprod.io
GNU Lesser General Public License v3.0
87 stars 15 forks source link

Op-Erigon on Mantle Mainnet - failed to determine L2BlockRef of height 61171946 #192

Closed andreclaro closed 3 months ago

andreclaro commented 5 months ago

Description

Trying to test op-erigon on mantle mainnet network, but getting the following errors on op-node:

lvl=eror msg="Error initializing the rollup node" err="failed to determine L2BlockRef of height 61171946, could not get payload: not found"
lvl=eror msg="Unable to create the rollup node"   error="failed to determine L2BlockRef of height 61171946, could not get payload: not found"

Logs

op-node logs:

Jun 20 14:51:19 m-mantle-02 op-node[80229]: t=2024-06-20T14:51:19+0000 lvl=info msg="Initializing Rollup Node"
Jun 20 14:51:19 m-mantle-02 op-node[80229]: t=2024-06-20T14:51:19+0000 lvl=info msg="Rollup Config"            l2_chain_id=5000 l2_network="unknown L2" l1_chain_id=1 l1_network=mainnet l2_start_time=1,710,468,791 l2_block_hash=0xf70a2270b05820a2b335e70ab9ce91e42e15f50d82db73d9c63085711b312fc8 l2_block_number=61,171,946 l1_block_hash=0x614050145039f11a778f1bd3c85ce2c1f3989492dbc544911fab9a7247e81ca4 l1_block_number=19,437,305 regolith_time="@ genesis"
Jun 20 14:51:19 m-mantle-02 op-node[80229]: t=2024-06-20T14:51:19+0000 lvl=info msg="loaded new runtime config values!" p2p_seq_address=0xAAC979CBeE00C75C35DE9a2635d8B75940F466dc
Jun 20 14:51:19 m-mantle-02 op-node[80229]: t=2024-06-20T14:51:19+0000 lvl=info msg="Connected to L1 Beacon API, ready for EIP-4844 blobs retrieval." version=Lighthouse/v5.2.0-f1d88ba/x86_64-linux
Jun 20 14:51:19 m-mantle-02 op-node[80229]: t=2024-06-20T14:51:19+0000 lvl=eror msg="Error initializing the rollup node" err="failed to determine L2BlockRef of height 61171946, could not get payload: not found"
Jun 20 14:51:19 m-mantle-02 op-node[80229]: t=2024-06-20T14:51:19+0000 lvl=eror msg="Unable to create the rollup node"   error="failed to determine L2BlockRef of height 61171946, could not get payload: not found"
Jun 20 14:51:19 m-mantle-02 op-node[80229]: t=2024-06-20T14:51:19+0000 lvl=crit msg="Application failed"                 message="failed to determine L2BlockRef of height 61171946, could not get payload: not found"

op-erigon logs:

INFO[06-20|14:50:51.310] console logging only
INFO[06-20|14:50:51.310] Enabling metrics export to prometheus    path=http://0.0.0.0:6060/debug/metrics/prometheus
INFO[06-20|14:50:51.310] Build info                               git_branch= git_tag= git_commit=
INFO[06-20|14:50:51.311] Maximum peer count                       ETH=100 total=100
INFO[06-20|14:50:51.311] starting HTTP APIs                       port=8545 APIs=web3,debug,eth,net,engine,erigon
INFO[06-20|14:50:51.312] torrent verbosity                        level=WRN
INFO[06-20|14:50:53.415] Set global gas cap                       cap=50000000
INFO[06-20|14:50:53.416] [Downloader] Running with                ipv6-enabled=true ipv4-enabled=true download.rate=1000mb upload.rate=4mb
INFO[06-20|14:50:53.416] Opening Database                         label=chaindata path=/var/lib/mantle/data/execution/chaindata
mdbx_setup_dxb:15946 filesize mismatch (expect 327680b/40p, have 16777216b/2048p)
INFO[06-20|14:50:53.418] [db] open                                label=chaindata sizeLimit=8TB pageSize=8192
INFO[06-20|14:50:53.424] Initialised chain configuration          config="{ChainID: 5000, Homestead: 0, DAO: <nil>, Tangerine Whistle: 0, Spurious Dragon: 0, Byzantium: 0, Constantinople: 0, Petersburg: 0, Istanbul: 0, Muir Glacier: 0, Berlin: 0, London: <nil>, Arrow Glacier: <nil>, Gray Glacier: <nil>, Terminal Total Difficulty: <nil>, Merge Netsplit: <nil>, Shanghai: <nil>, Cancun: <nil>, Prague: <nil>, Osaka: <nil>, Engine: clique, NoPruneContracts: map[]}" genesis=0x0a0eb32c4b024b28da5bf83356f7987c1b0612bbfbc9156186c59c834bfcd013
INFO[06-20|14:50:53.434] Initialising Ethereum protocol           network=5000
INFO[06-20|14:50:53.434] Opening Database                         label=clique path=/var/lib/mantle/data/execution/clique/db/clique
INFO[06-20|14:50:53.450] Starting private RPC server              on=127.0.0.1:9090
INFO[06-20|14:50:53.450] new subscription to logs established
INFO[06-20|14:50:53.450] [txpool] Started
INFO[06-20|14:50:53.455] rpc filters: subscribing to Erigon events
INFO[06-20|14:50:53.455] new subscription to newHeaders established
INFO[06-20|14:50:53.455] New txs subscriber joined
INFO[06-20|14:50:53.456] JsonRpc endpoint opened                  ws=true ws.compression=true grpc=false websocket.url=[::]:8546 http.url=[::]:8545
INFO[06-20|14:50:53.456] Reading JWT secret                       path=/var/lib/mantle/jwt.hex
INFO[06-20|14:50:53.456] HTTP endpoint opened for Engine API      url=127.0.0.1:8551 ws=true ws.compression=true
WARN[06-20|14:50:53.464] NAT ExternalIP resolution has failed, try to pass a different --nat option err="no UPnP or NAT-PMP router discovered"
INFO[06-20|14:50:53.467] Started P2P networking                   version=66 self="enode://4a41e2d379f4d332e2dbdf679753ddc6366ec12af36c4e5bf7a31417c25f2bb41f07520842d7793bcc5bd721626399004af1da44fb83efcda8954b4c60c509bd@127.0.0.1:30303?discport=0" name=erigon/v0.06.3/linux-amd64/go1.21.10
WARN[06-20|14:50:53.468] NAT ExternalIP resolution has failed, try to pass a different --nat option err="no UPnP or NAT-PMP router discovered"
INFO[06-20|14:50:53.470] Started P2P networking                   version=68 self="enode://4a41e2d379f4d332e2dbdf679753ddc6366ec12af36c4e5bf7a31417c25f2bb41f07520842d7793bcc5bd721626399004af1da44fb83efcda8954b4c60c509bd@127.0.0.1:46304?discport=0" name=erigon/v0.06.3/linux-amd64/go1.21.10
WARN[06-20|14:50:53.471] NAT ExternalIP resolution has failed, try to pass a different --nat option err="no UPnP or NAT-PMP router discovered"
INFO[06-20|14:50:53.474] Started P2P networking                   version=67 self="enode://4a41e2d379f4d332e2dbdf679753ddc6366ec12af36c4e5bf7a31417c25f2bb41f07520842d7793bcc5bd721626399004af1da44fb83efcda8954b4c60c509bd@127.0.0.1:46303?discport=0" name=erigon/v0.06.3/linux-amd64/go1.21.10
INFO[06-20|14:50:53.477] [2/15 Headers] Waiting for headers...    from=0
INFO[06-20|14:51:23.477] [2/15 Headers] No block headers to write in this log period number=0 blk/second=0.000 alloc=24.5MB sys=39.2MB invalidHeaders=0 rejectedBadHeaders=0
INFO[06-20|14:51:53.477] [2/15 Headers] No block headers to write in this log period number=0 blk/second=0.000 alloc=28.5MB sys=43.2MB invalidHeaders=0 rejectedBadHeaders=0

CLI

op-node cli:

/usr/local/bin/op-node \
    --l1=http://IP_ADDRESS:8545 \
    --l1.beacon=http://IP_ADDRESS:5052 \
    --l2=http://127.0.0.1:8551 \
    --l2.jwt-secret=/var/lib/mantle/jwt.hex \
    --l2.backup-unsafe-sync-rpc=https://rpc.mantle.xyz \
    --l2.engine-sync=true \
    --l2.skip-sync-start-check=true \
    --rollup.config=/var/lib/mantle/data/rollup.json \
    --rpc.addr=0.0.0.0 \
    --rpc.port=9545 \
    --p2p.priv.path=/var/lib/mantle/data/consensus/priv.key \
    --p2p.listen.tcp=30304 \
    --p2p.listen.udp=30304 \
    --p2p.peerstore.path=/var/lib/mantle/data/consensus/peerstore \
    --p2p.discovery.path=/var/lib/mantle/data/consensus/discovery \
    --p2p.static=/dns4/peer0.mantle.xyz/tcp/9003/p2p/16Uiu2HAmKVKzUAns2gLhZAz1PYcbnhY3WpxNxUZYeTN1x29tNBAW,/dns4/peer1.mantle.xyz/tcp/9003/p2p/16Uiu2HAm1AiZtVp8f5C8LvpSTAXC6GtwqAVKnB3VLawWYSEBmcFN,/dns4/peer2.mantle.xyz/tcp/9003/p2p/16Uiu2HAm2UHVKiPXpovs8VbbUQVPr7feBAqBJdFsH1z5XDiLEvHT \
    --p2p.listen.ip=0.0.0.0 \
    --da.indexer-enable=true \
    --da.indexer-socket=da-indexer-api.mantle.xyz:80 \
    --metrics.enabled=true \
    --metrics.addr=0.0.0.0 \
    --metrics.port=9002

op-erigon cli:

/usr/local/bin/erigon     --genesis.path="/var/lib/mantle/data/genesis.json"     --networkid 5000     --datadir /var/lib/mantle/data/execution     --snapshots=false     --torrent.port 42069     --torrent.download.rate 1000mb     --port 30303     --http     --http.addr 0.0.0.0     --http.port 8545     --http.vhosts "*"     --http.api=web3,debug,eth,net,engine,erigon     --ws     --ws.port 8546     --authrpc.addr 127.0.0.1     --authrpc.vhosts="*"     --authrpc.port 8551     --authrpc.jwtsecret /var/lib/mantle/jwt.hex     --rollup.sequencerhttp https://rpc.mantle.xyz     --db.size.limit 8TB     --txpool.gossip.disable=true     --nodiscover     --p2p.allowed-ports=46303,46304,46305     --p2p.protocol=66,67,68     --metrics     --metrics.addr 0.0.0.0     --metrics.port=6060     --verbosity 3     --prune.h.older=1300000     --prune.r.older=1300000     --prune.t.older=1300000     --prune.c.older=1300000     --log.dir.disable --rollup.historicalrpc https://rpc-moon.mantle.xyz/.....
andreclaro commented 5 months ago

The height 61171946 is related with the tectonic upgrade (OP Stack Bedrock upgrade):

mininny commented 5 months ago

Hi @andreclaro !

Have you initialized the datadir from the snapshot from mantle? https://docs-v2.mantle.xyz/nodes/verifier-binary#download-latest-snapshot-from-mantle-recommended

Also, could you please try removing these flags from your op-node configuration? op-erigon doesn't support these flags yet.

andreclaro commented 5 months ago

No, I didn't try. Isn't that snapshot for op-geth only?

I tried without the following flags and got the same error...

--l2.engine-sync
--l2.skip-sync-start-check

Anyway, it does makes sense that we need a pre bedrock snapshot to start the node. Does the the snapshots provided by mantle work with op-erigon (https://github.com/mantlenetworkio/networks/blob/main/run-node-mainnetv2.md#download-latest-snapshot-from-mantle) ? 🤔

andreclaro commented 5 months ago

btw, the mantle teams confirmed that op-erigon is not supported on Mantle, and shared a link to the documentation (https://docs-v2.mantle.xyz/.). I'm trying to understand the technical reason...

andreclaro commented 5 months ago

Should it be because they use EigenDA for data availability?

https://docs-v2.mantle.xyz/intro/risk-management/da#mantle-da---powered-by-eigenda-technology

Btw, Op-stack will soon (on v1.8.0) also support alternative DA layers:

andreclaro commented 5 months ago

I do also see that mantle needs clique support (https://docs.clique.tech).

Clique is building a compute coordination layer, streamlining the process by which both smart contracts and general applications access and utilize compute resources. At the core of Clique's offering is a nuanced auction-based system, engineered to optimize the distribution of computational services. 

I do see erigon has support to clique. Did you tried in any op-stack network?

https://github.com/testinprod-io/op-erigon/blob/a3a2e274ba6b619b1eb856795b7535949239e6e7/consensus/clique/clique.go#L179

ImTei commented 5 months ago

@andreclaro Mantle has a pre-bedrock bocks, but op-erigon cannot process pre-bedrock blocks. So we need to make pre-bedrock snapshot for op-erigon by migrating from their snapshot for op-geth. If there isn't a snapshot, op-erigon cannot support mantle.

andreclaro commented 5 months ago

How can we do that (convert bedrock op-geth snapshot to be used by op-erigon)?

mininny commented 5 months ago

@andreclaro I think you can refer to this repo: https://github.com/testinprod-io/optimism-bedrock-db-migration which holds code and documentation about the db migration we did for optimism mainnet.

andreclaro commented 3 months ago

We can close this issue as mantle this mentioned to use only op-geth.