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 Blast Mainnet - failed to get L2 genesis blockhash #195

Closed andreclaro closed 5 months ago

andreclaro commented 5 months ago

Description

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

lvl=eror msg="Error initializing the rollup node" err="failed to init L2: failed to get L2 genesis blockhash: expected L2 genesis hash to match L2 block at genesis block number 0: 0x97b954c32af650ee0fb4fbc367cf99a8a9ee6aa3e7b4ecf2d72942790dce1904 <> 0xb689b35ef29d0bec5816938e0e52683c7257d2e325420ea69b739a2be4754b89"
lvl=crit msg="Application failed"                 message="failed to setup: unable to create the rollup node: failed to init L2: failed to get L2 genesis blockhash: expected L2 genesis hash to match L2 block at genesis block number 0: 0x97b954c32af650ee0fb4fbc367cf99a8a9ee6aa3e7b4ecf2d72942790dce1904 <> 0xb689b35ef29d0bec5816938e0e52683c7257d2e325420ea69b739a2be4754b89"

Logs

op-node logs:

Jun 21 10:10:39 m-blast-02 systemd[1]: Started "Blast consensus rollup client service".
Jun 21 10:10:39 m-blast-02 node[77016]: t=2024-06-21T10:10:39+0000 lvl=info msg="Not opted in to ProtocolVersions signal loading, disabling ProtocolVersions contract now."
Jun 21 10:10:39 m-blast-02 node[77016]: t=2024-06-21T10:10:39+0000 lvl=info msg="Rollup Config" l2_chain_id=81457 l2_network="unknown L2" l1_chain_id=1 l1_network=mainnet l2_start_time=1,708,809,815 l2_block_hash=0xb689b35ef29d0bec5816938e0e52683c7257d2e325420ea69b739a2be4754b89 l2_block_number=0 l1_block_hash=0xfcfb8d586bdae763f1189988789211c69eb893a895e7ba48be3ca6289f0941b7 l1_block_number=19,300,102 regolith_time="@ genesis" canyon_time="@ genesis" delta_time="@ 1716843599 ~ Mon May 27 20:59:59 UTC 2024" ecotone_time="@ 1716843599 ~ Mon May 27 20:59:59 UTC 2024" fjord_time="(not configured)" interop_time="(not configured)"
Jun 21 10:10:39 m-blast-02 node[77016]: t=2024-06-21T10:10:39+0000 lvl=info msg="Initializing rollup node" version=untagged-706acdde-1716265963
Jun 21 10:10:39 m-blast-02 node[77016]: t=2024-06-21T10:10:39+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 21 10:10:39 m-blast-02 node[77016]: t=2024-06-21T10:10:39+0000 lvl=eror msg="Error initializing the rollup node" err="failed to init L2: failed to get L2 genesis blockhash: expected L2 genesis hash to match L2 block at genesis block number 0: 0x97b954c32af650ee0fb4fbc367cf99a8a9ee6aa3e7b4ecf2d72942790dce1904 <> 0xb689b35ef29d0bec5816938e0e52683c7257d2e325420ea69b739a2be4754b89"
Jun 21 10:10:39 m-blast-02 node[77016]: t=2024-06-21T10:10:39+0000 lvl=crit msg="Application failed"                 message="failed to setup: unable to create the rollup node: failed to init L2: failed to get L2 genesis blockhash: expected L2 genesis hash to match L2 block at genesis block number 0: 0x97b954c32af650ee0fb4fbc367cf99a8a9ee6aa3e7b4ecf2d72942790dce1904 <> 0xb689b35ef29d0bec5816938e0e52683c7257d2e325420ea69b739a2be4754b89"
Jun 21 10:10:39 m-blast-02 systemd[1]: op-node.service: Main process exited, code=exited, status=1/FAILURE
Jun 21 10:10:39 m-blast-02 systemd[1]: op-node.service: Failed with result 'exit-code'.

op-erigon logs:

INFO[06-21|10:05:58.031] console logging only
INFO[06-21|10:05:58.032] Enabling metrics export to prometheus    path=http://0.0.0.0:6060/debug/metrics/prometheus
INFO[06-21|10:05:58.032] Build info                               git_branch= git_tag= git_commit=
INFO[06-21|10:05:58.033] Maximum peer count                       ETH=100 total=100
INFO[06-21|10:05:58.033] starting HTTP APIs                       port=8545 APIs=web3,debug,eth,net,engine,erigon
INFO[06-21|10:05:58.034] torrent verbosity                        level=WRN
INFO[06-21|10:06:00.137] Set global gas cap                       cap=50000000
INFO[06-21|10:06:00.138] [Downloader] Running with                ipv6-enabled=true ipv4-enabled=true download.rate=1000mb upload.rate=4mb
INFO[06-21|10:06:00.138] Opening Database                         label=chaindata path=/var/lib/blast/data/execution/chaindata
mdbx_setup_dxb:15946 filesize mismatch (expect 3686400b/450p, have 16777216b/2048p)
INFO[06-21|10:06:00.141] [db] open                                label=chaindata sizeLimit=8TB pageSize=8192
WARN[06-21|10:06:00.144] Optimism FjordTime has not been set
INFO[06-21|10:06:00.146] Initialised chain configuration          config="{ChainID: 81457, Homestead: 0, DAO: <nil>, Tangerine Whistle: 0, Spurious Dragon: 0, Byzantium: 0, Constantinople: 0, Petersburg: 0, Istanbul: 0, Muir Glacier: 0, Berlin: 0, London: 0, Arrow Glacier: 0, Gray Glacier: 0, Terminal Total Difficulty: 0, Merge Netsplit: 0, Shanghai: 0, Cancun: 1716843599, Prague: <nil>, Osaka: <nil>, Engine: unknown, NoPruneContracts: map[]}{Bedrock: 0, Regolith: 0, Canyon: 0, Ecotone: 1716843599, Fjord: <nil>}" genesis=0x97b954c32af650ee0fb4fbc367cf99a8a9ee6aa3e7b4ecf2d72942790dce1904
INFO[06-21|10:06:00.154] Initialising Ethereum protocol           network=81457
INFO[06-21|10:06:00.154] Disk storage enabled for ethash DAGs     dir=/var/lib/blast/data/execution/ethash-dags count=2
INFO[06-21|10:06:00.162] Starting private RPC server              on=127.0.0.1:9090
INFO[06-21|10:06:00.162] new subscription to logs established
INFO[06-21|10:06:00.163] [txpool] Started
INFO[06-21|10:06:00.168] rpc filters: subscribing to Erigon events
INFO[06-21|10:06:00.169] new subscription to newHeaders established
INFO[06-21|10:06:00.169] New txs subscriber joined
INFO[06-21|10:06:00.170] JsonRpc endpoint opened                  ws=true ws.compression=true grpc=false websocket.url=[::]:8546 http.url=[::]:8545
INFO[06-21|10:06:00.171] Reading JWT secret                       path=/var/lib/blast/jwt.hex
INFO[06-21|10:06:00.171] HTTP endpoint opened for Engine API      url=127.0.0.1:8551 ws=true ws.compression=true
WARN[06-21|10:06:00.178] NAT ExternalIP resolution has failed, try to pass a different --nat option err="no UPnP or NAT-PMP router discovered"
INFO[06-21|10:06:00.181] Started P2P networking                   version=68 self="enode://ef9fd20875df36540b3b3f17f86d5fbcbae43ff814ef6a7049c0d6a2c4d47690ee0a58f3710a367402ad0e3c1d1760b30fedee9aa6fd2115966981ff6e4737ef@127.0.0.1:46304?discport=0" name=erigon/v0.06.4/linux-amd64/go1.22.3
WARN[06-21|10:06:00.182] NAT ExternalIP resolution has failed, try to pass a different --nat option err="no UPnP or NAT-PMP router discovered"
INFO[06-21|10:06:00.184] Started P2P networking                   version=66 self="enode://ef9fd20875df36540b3b3f17f86d5fbcbae43ff814ef6a7049c0d6a2c4d47690ee0a58f3710a367402ad0e3c1d1760b30fedee9aa6fd2115966981ff6e4737ef@127.0.0.1:30303?discport=0" name=erigon/v0.06.4/linux-amd64/go1.22.3
WARN[06-21|10:06:00.194] NAT ExternalIP resolution has failed, try to pass a different --nat option err="no UPnP or NAT-PMP router discovered"
INFO[06-21|10:06:00.196] Started P2P networking                   version=67 self="enode://ef9fd20875df36540b3b3f17f86d5fbcbae43ff814ef6a7049c0d6a2c4d47690ee0a58f3710a367402ad0e3c1d1760b30fedee9aa6fd2115966981ff6e4737ef@127.0.0.1:46303?discport=0" name=erigon/v0.06.4/linux-amd64/go1.22.3
INFO[06-21|10:09:00.155] [p2p] GoodPeers
INFO[06-21|10:09:00.157] [mem] memory stats                       Rss=104.3MB Size=0B Pss=102.1MB SharedClean=2.4MB SharedDirty=0B PrivateClean=66.6MB PrivateDirty=35.3MB Referenced=104.3MB Anonymous=35.3MB Swap=0B alloc=26.7MB sys=46.0MB
INFO[06-21|10:09:00.163] [txpool] stat                            pending=0 baseFee=0 queued=0 alloc=26.7MB sys=46.0MB

CLI

op-node cli:

/usr/local/bin/node \
    --l1=ws://L1_IP_ADDRESS:8546 \
    --l1.beacon=http://L1_IP_ADDRESS:5052 \
    --l2=http://127.0.0.1:8551 \
    --l2.jwt-secret=/var/lib/blast/jwt.hex \
    --rpc.addr=127.0.0.1 \
    --rpc.port=9545 \
    --rollup.config=/var/lib/blast/data/blast-mainnet/rollup.json \
    --rollup.halt=major \
    --p2p.listen.tcp=30304 \
    --p2p.listen.udp=30304 \
    --p2p.bootnodes=enr:-J64QGwHl9uYLfC_cnmxSA6wQH811nkOWJDWjzxqkEUlJoZHWvI66u-BXgVcPCeMUmg0dBpFQAPotFchG67FHJMZ9OSGAY3d6wevgmlkgnY0gmlwhANizeSHb3BzdGFja4Sx_AQAiXNlY3AyNTZrMaECg4pk0cskPAyJ7pOmo9E6RqGBwV-Lex4VS9a3MQvu7PWDdGNwgnZhg3VkcIJ2YQ,enr:-J64QDge2jYBQtcNEpRqmKfci5E5BHAhNBjgv4WSdwH1_wPqbueq2bDj38-TSW8asjy5lJj1Xftui6Or8lnaYFCqCI-GAY3d6wf3gmlkgnY0gmlwhCO2D9yHb3BzdGFja4Sx_AQAiXNlY3AyNTZrMaEDo4aCTq7pCEN8om9U5n_VyWdambGnQhwHNwKc8o-OicaDdGNwgnZhg3VkcIJ2YQ \
    --p2p.priv.path=/var/lib/blast/data/consensus/priv.key \
    --p2p.peerstore.path=/var/lib/blast/data/consensus/peerstore \
    --p2p.discovery.path=/var/lib/blast/data/consensus/discovery \
    --metrics.enabled=true \
    --metrics.addr=0.0.0.0 \
    --metrics.port=6061

op-erigon cli:

/usr/local/bin/erigon \
    --genesis.path /var/lib/blast/data/blast-mainnet/genesis.json \
    --networkid 81457 \
    --datadir /var/lib/blast/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/blast/jwt.hex \
    --rollup.sequencerhttp https://sequencer.blast.io \
    --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
andreclaro commented 5 months ago

eth_getBlockByHash on block 0x0 returns: hash":"0x97b954c32af650ee0fb4fbc367cf99a8a9ee6aa3e7b4ecf2d72942790dce1904"

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
        "method":"eth_getBlockByHash",
        "params":["0x0",false],
        "id":1,
        "jsonrpc":"2.0"
}'

{"jsonrpc":"2.0","id":1,"result":{"baseFeePerGas":"0x3b9aca00","difficulty":"0x0","extraData":"0x424544524f434b","gasLimit":"0x1c9c380","gasUsed":"0x0","hash":"0x97b954c32af650ee0fb4fbc367cf99a8a9ee6aa3e7b4ecf2d72942790dce1904","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0x4200000000000000000000000000000000000011","mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000","nonce":"0x0000000000000000","number":"0x0","parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000","receiptsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","size":"0x22b","stateRoot":"0x145c40755efdef6b837816ee78cefcfb251868a76acbc59038acaef59139f1f8","timestamp":"0x65da5e57","totalDifficulty":"0x0","transactions":[],"transactionsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","uncles":[],"withdrawals":[],"withdrawalsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"}}
andreclaro commented 5 months ago

When I start op-erigon I see the following message where genesis is "genesis=0x97b954c32af650ee0fb4fbc367cf99a8a9ee6aa3e7b4ecf2d72942790dce1904"

INFO[06-21|10:06:00.146] Initialised chain configuration          config="{ChainID: 81457, Homestead: 0, DAO: <nil>, Tangerine Whistle: 0, Spurious Dragon: 0, Byzantium: 0, Constantinople: 0, Petersburg: 0, Istanbul: 0, Muir Glacier: 0, Berlin: 0, London: 0, Arrow Glacier: 0, Gray Glacier: 0, Terminal Total Difficulty: 0, Merge Netsplit: 0, Shanghai: 0, Cancun: 1716843599, Prague: <nil>, Osaka: <nil>, Engine: unknown, NoPruneContracts: map[]}{Bedrock: 0, Regolith: 0, Canyon: 0, Ecotone: 1716843599, Fjord: <nil>}" genesis=0x97b954c32af650ee0fb4fbc367cf99a8a9ee6aa3e7b4ecf2d72942790dce1904

When I initialize the erigon db, the genesis block hash is 0x97b954c32af650ee0fb4fbc367cf99a8a9ee6aa3e7b4ecf2d72942790dce1904:

erigon --datadir=/var/lib/blast/data/execution init blast-mainnet/genesis.json
INFO[06-21|10:52:00.725] logging to file system                   log dir=/var/lib/blast/data/execution/logs file prefix=erigon log level=info json=false
INFO[06-21|10:52:01.023] Starting Erigon on Ethereum mainnet...
INFO[06-21|10:52:01.025] Maximum peer count                       ETH=100 total=100
INFO[06-21|10:52:01.025] starting HTTP APIs                       port=8545 APIs=eth,erigon,engine
INFO[06-21|10:52:01.025] Opening Database                         label=chaindata path=/var/lib/blast/data/execution/chaindata
INFO[06-21|10:52:01.027] [db] open                                label=chaindata sizeLimit=12TB pageSize=8192
INFO[06-21|10:52:01.047] Re-Opening DB in exclusive mode to apply migrations
INFO[06-21|10:52:01.048] [db] open                                label=chaindata sizeLimit=12TB pageSize=8192
INFO[06-21|10:52:01.049] Apply migration                          name=db_schema_version5
INFO[06-21|10:52:01.064] Applied migration                        name=db_schema_version5
INFO[06-21|10:52:01.064] Apply migration                          name=txs_begin_end
INFO[06-21|10:52:01.066] Applied migration                        name=txs_begin_end
INFO[06-21|10:52:01.066] Apply migration                          name=txs_v3
INFO[06-21|10:52:01.068] Applied migration                        name=txs_v3
INFO[06-21|10:52:01.068] Apply migration                          name=prohibit_new_downloads_lock
INFO[06-21|10:52:01.070] Applied migration                        name=prohibit_new_downloads_lock
INFO[06-21|10:52:01.070] Apply migration                          name=prohibit_new_downloads_lock2
INFO[06-21|10:52:01.072] Applied migration                        name=prohibit_new_downloads_lock2
INFO[06-21|10:52:01.073] Updated DB schema to                     version=6.1.0
INFO[06-21|10:52:01.075] [db] open                                label=chaindata sizeLimit=12TB pageSize=8192
INFO[06-21|10:52:01.226] Writing custom genesis block             hash=0x97b954c32af650ee0fb4fbc367cf99a8a9ee6aa3e7b4ecf2d72942790dce1904
INFO[06-21|10:52:01.237] Successfully wrote genesis state         hash=0x97b954c32af650ee0fb4fbc367cf99a8a9ee6aa3e7b4ecf2d72942790dce1904

Genesis.json and rollup.json are available at https://github.com/blast-io/deployment/tree/master/mainnet

However, genesis hash block is 0xb689b35ef29d0bec5816938e0e52683c7257d2e325420ea69b739a2be4754b89 , right? šŸ¤”

source: https://blastscan.io/block/0

andreclaro commented 5 months ago

Cc: @ImTe @mininny

mininny commented 5 months ago

Hi @andreclaro, it seems like blast.io is maintaining their own fork of optimism. Do you know whether blast.io is op-stack compliant? If they modified internal optimism code like state transition functions, the root hash from the genesis file might differ. I just tested with op-geth. and it also returns a different genesis hash block.

andreclaro commented 5 months ago

Hi @andreclaro, it seems like blast.io is maintaining their own fork of optimism. Do you know whether blast.io is op-stack compliant? If they modified internal optimism code like state transition functions, the root hash from the genesis file might differ. I just tested with op-geth. and it also returns a different genesis hash block.

Yes, that's correct! Blast uses a fork of op-stack (op-geth and op-node) and the source code is available at https://github.com/blast-io/blast

https://github.com/blast-io/deployment has the network configuration (genesis and rollup files).

Documentation:

mininny commented 5 months ago

@andreclaro Thanks for the info! Like you said, it seems like blast is not op-stack compliant. And because it has different chain logic than Optimism, op-erigon won't be able to support it unfortunately. šŸ™

mininny commented 5 months ago

@andreclaro I'll close this issue for now as there isn't much we can do here. If you need help supporting other chains, feel free to let us know :)