ethereum-optimism / optimism

Optimism is Ethereum, scaled.
https://optimism.io
MIT License
5.68k stars 3.32k forks source link

op-node error when fetching L1 block #10183

Closed wy51084915 closed 7 months ago

wy51084915 commented 7 months ago

Bug Description i was trying to build my own first L2 OP Chain in the guide of the optimism docs, and when i finally launch op-geth and op-node, an error occurred. the code is on the branch: tutorials/chain

Expected behavior i guess in the normal way, the op-node is responsible for getting blocks from L1, but now there is some problems between their jsonrpc conmmunication. The message they sent to each other seems mismatch their expectation.

Environment Information:

Dependency | Minimum | Actual
git          2         2.44.0
go           1.21      1.22.1
node         20        20.9.0
pnpm         8         8.15.6
foundry      0.2.0     0.2.0
make         3         3.81
jq           1.6       1.7.1
direnv       2         2.34.0

Configurations: ./bin/op-node --l1.rpc-max-batch-size=200 --l2=http://localhost:8551 --l2.jwt-secret=./jwt.txt --sequencer.enabled --sequencer.l1-confs=5 --verifier.l1-confs=4 --rollup.config=./rollup.json --rpc.addr=0.0.0.0 --rpc.port=8547 --p2p.disable --rpc.enable-admin --p2p.sequencer.key=$GS_SEQUENCER_PRIVATE_KEY --l1=https://sepolia.infura.io/v3/673923aa4cc74918af3b0a2ef3a3ad5a --l1.rpckind=infura

Logs:

INFO [04-17|11:54:35.698] Not opted in to ProtocolVersions signal loading, disabling ProtocolVersions contract now. 
INFO [04-17|11:54:35.699] No persisted sequencer state loaded 
INFO [04-17|11:54:35.699] Rollup Config                            l2_chain_id=42069 l2_network="unknown L2" l1_chain_id=11,155,111 l1_network=sepolia l2_start_time=1,712,805,984 l2_block_hash=0xc4daaff41e0e100af7e23406e38df3c9bca9b06d6fdf30ad8510c9dcccfe839c l2_block_number=0 l1_block_hash=0xd6822cafd796ddf6396a615202376630d9326c520c1dea425b3466e68c7a0078 l1_block_number=5,672,369 regolith_time="@ genesis" canyon_time="@ genesis" delta_time="(not configured)" ecotone_time="(not configured)" fjord_time="(not configured)" interop_time="(not configured)"
INFO [04-17|11:54:35.699] Initializing rollup node                 version=v0.0.0-a06cae81-1705510057
WARN [04-17|11:54:37.686] No beacon endpoint configured. Configuration is mandatory for the Ecotone upgrade 
INFO [04-17|11:54:38.611] loaded new runtime config values!        p2p_seq_address=0x0000000000000000000000000000000000000000
INFO [04-17|11:54:38.612] Admin RPC enabled 
INFO [04-17|11:54:38.612] Starting JSON-RPC server 
INFO [04-17|11:54:38.613] metrics disabled 
INFO [04-17|11:54:38.613] Starting execution engine driver 
INFO [04-17|11:54:38.613] Starting driver                          sequencerEnabled=true sequencerStopped=false
INFO [04-17|11:54:38.613] Rollup node started 
INFO [04-17|11:54:38.613] State loop started 
INFO [04-17|11:54:38.618] Loaded current L2 heads                  unsafe=b63e8a..86069a:5 safe=c4daaf..fe839c:0 finalized=c4daaf..fe839c:0 unsafe_origin=d6822c..7a0078:5672369 safe_origin=d6822c..7a0078:5672369
INFO [04-17|11:54:38.915] Walking back L1Block by number           curr=d6822c..7a0078:5672369 next=d6822c..7a0078:5672369 l2block=b63e8a..86069a:5
INFO [04-17|11:54:38.921] Hit finalized L2 head, returning immediately unsafe=b63e8a..86069a:5 safe=c4daaf..fe839c:0 finalized=c4daaf..fe839c:0 unsafe_origin=d6822c..7a0078:5672369 safe_origin=d6822c..7a0078:5672369
INFO [04-17|11:54:38.921] Sync progress                            reason="reset derivation work" l2_finalized=c4daaf..fe839c:0 l2_safe=c4daaf..fe839c:0 l2_pending_safe=c4daaf..fe839c:0 l2_unsafe=b63e8a..86069a:5 l2_time=1,712,805,994 l1_derived=d6822c..7a0078:5672369
INFO [04-17|11:54:38.922] completed reset of derivation pipeline   origin=d6822c..7a0078:5672369
INFO [04-17|11:54:39.221] Reset of L1Retrieval done                origin=d6822c..7a0078:5672369
WARN [04-17|11:54:41.271] Derivation process temporary error       attempts=1 err="temp: failed to fetch receipts of L1 block 0xd6eefbc4e732b6ff282b6be3c687a5b3419c1b43fd447353fbc8305ffa7531e4:5672370 (parent: 0xd6822cafd796ddf6396a615202376630d9326c520c1dea425b3466e68c7a0078:5672369) for L1 sysCfg update: failed batch-retrieval: 429 Too Many Requests: {\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32005,\"message\":\"batch item count exceeded\"}}"
WARN [04-17|11:54:44.136] Derivation process temporary error       attempts=2 err="temp: failed to fetch receipts of L1 block 0xd6eefbc4e732b6ff282b6be3c687a5b3419c1b43fd447353fbc8305ffa7531e4:5672370 (parent: 0xd6822cafd796ddf6396a615202376630d9326c520c1dea425b3466e68c7a0078:5672369) for L1 sysCfg update: failed batch-retrieval: 429 Too Many Requests: {\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32005,\"message\":\"batch item count exceeded\"}}"
WARN [04-17|11:54:49.003] Derivation process temporary error       attempts=3 err="temp: failed to fetch receipts of L1 block 0xd6eefbc4e732b6ff282b6be3c687a5b3419c1b43fd447353fbc8305ffa7531e4:5672370 (parent: 0xd6822cafd796ddf6396a615202376630d9326c520c1dea425b3466e68c7a0078:5672369) for L1 sysCfg update: failed batch-retrieval: 429 Too Many Requests: {\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32005,\"message\":\"batch item count exceeded\"}}"
INFO [04-17|11:54:49.003] Received first L1 head signal            l1_head=af17f7..aa41ad:5715290
INFO [04-17|11:54:49.333] creating new block                       parent=b63e8a..86069a:5 l1Origin=d6eefb..7531e4:5672370
ERROR[04-17|11:54:49.665] sequencer temporarily failed to start building new block err="temp: failed to fetch L1 block info and receipts: failed batch-retrieval: 429 Too Many Requests: {\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32005,\"message\":\"batch item count exceeded\"}}"
INFO [04-17|11:54:49.975] creating new block                       parent=b63e8a..86069a:5 l1Origin=d6eefb..7531e4:5672370
ERROR[04-17|11:54:50.333] sequencer temporarily failed to start building new block err="temp: failed to fetch L1 block info and receipts: failed batch-retrieval: 429 Too Many Requests: {\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32005,\"message\":\"batch item count exceeded\"}}"
INFO [04-17|11:54:50.794] creating new block                       parent=b63e8a..86069a:5 l1Origin=d6eefb..7531e4:5672370
ERROR[04-17|11:54:51.101] sequencer temporarily failed to start building new block err="temp: failed to fetch L1 block info and receipts: failed batch-retrieval: 429 Too Many Requests: {\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32005,\"message\":\"batch item count exceeded\"}}"

does anyone have some idea? Thanks!

zhiqiangxu commented 7 months ago

It seems your l1 rpc service is rate-limited.

wy51084915 commented 7 months ago

It seems your l1 rpc service is rate-limited.

yes! i have found the error on docs.infura.io. Thanks! But this may not be the real reason. I am using the l1 rpc service on infura and i have checked the requests sent to the infura node. All batch requests failed while other requests survived. i guess the point is that "batch item count exceeded", i will try to limit the batch-size tomorrow.

zhiqiangxu commented 7 months ago

@wy51084915 You can fine tune the batch size by the l1.rpc-max-batch-size parameter.

wy51084915 commented 7 months ago

@wy51084915 You can fine tune the batch size by the l1.rpc-max-batch-size parameter.

yes! That is what i planed to do yesterday and that worked! Thanks for your reply!