0xPolygonHermez / cdk-erigon

Ethereum implementation on the efficiency frontier
GNU Lesser General Public License v3.0
35 stars 32 forks source link

Streams error during batches on 1.1.2 #558

Closed yorickdowne closed 4 months ago

yorickdowne commented 4 months ago

System information

Erigon version: v1.1.2

OS & Version: Linux

Chain/Network: polygon-zkemv and xlayer, both mainnet

cdk-erigon --config /home/erigon/.local/share/erigon-config/mainnet.yaml --zkevm.l1-rpc-url https://eth-rpc.example.com --zkevm.rpc-ratelimit 0 --externalcl --maxpeers 32 --downloader.disable.ipv6 --http --http.api eth,net,trace,web3,erigon,zkevm --http.addr 0.0.0.0 --http.port 8545 --http.vhosts=* --http.corsdomain=* --ws --metrics --metrics.addr 0.0.0.0

Contents of config file:

datadir: /home/erigon/.local/share/erigon
chain: hermez-mainnet
zkevm.l2-chain-id: 1101
zkevm.l2-sequencer-rpc-url: https://zkevm-rpc.com
zkevm.l2-datastreamer-url: stream.zkevm-rpc.com:6900
zkevm.l1-chain-id: 1

zkevm.address-sequencer: "0x148Ee7dAF16574cD020aFa34CC658f8F3fbd2800"
zkevm.address-zkevm: "0x519E42c24163192Dca44CD3fBDCEBF6be9130987"
zkevm.address-admin: "0x242daE44F5d8fb54B198D03a94dA45B5a4413e21"
zkevm.address-rollup: "0x5132A183E9F3CB7C848b0AAC5Ae0c4f0491B7aB2"
zkevm.address-ger-manager: "0x580bda1e7A0CFAe92Fa7F6c20A3794F169CE3CFb"

zkevm.default-gas-price: 1
zkevm.max-gas-price: 0
zkevm.gas-price-factor: 0.0375

zkevm.l1-rollup-id: 1
zkevm.l1-block-range: 20000
zkevm.l1-query-delay: 6000
zkevm.l1-first-block: 16896700
zkevm.rpc-ratelimit: 250
zkevm.datastream-version: 2

externalcl: true

Issue

Fresh sync on 1.1.2 fails, it shows a streams error. Observed on polygon-zkevm and xlayer

The exact same config with 1.0.10 syncs successfully, which makes me think this isn't an issue with the streams server

Example log from polygon-zkevm

zkevm-erigon-1  | [INFO] [06-05|14:46:21.470] [2/16 L1InfoTree] DONE                   in=3m36.521308858s
zkevm-erigon-1  | [INFO] [06-05|14:46:21.470] [3/16 Batches] Starting batches stage 
zkevm-erigon-1  | [INFO] [06-05|14:46:21.470] [3/16 Batches] Starting stream           startBlock=0
zkevm-erigon-1  | [INFO] [06-05|14:46:21.471] [3/16 Batches] Reading blocks from the datastream. 
zkevm-erigon-1  | [INFO] [06-05|14:46:21.471] [3/16 Batches] Started downloading L2Blocks routine 
zkevm-erigon-1  | [INFO] [06-05|14:46:21.558] [3/16 Batches] Finished Batches stage 
zkevm-erigon-1  | [INFO] [06-05|14:46:21.558] [3/16 Batches] Finished downloading L2Blocks routine 
zkevm-erigon-1  | [EROR] [06-05|14:46:21.558] Error while executing stage              err="[3/16 Batches] l2blocks download routine error: after start command error: got Result error code 4: Bad from bookmark"
zkevm-erigon-1  | [EROR] [06-05|14:46:21.558] Staged Sync                              err="[3/16 Batches] l2blocks download routine error: after start command error: got Result error code 4: Bad from bookmark"
zkevm-erigon-1  | [INFO] [06-05|14:46:22.060] [3/16 Batches] Starting batches stage 
zkevm-erigon-1  | [INFO] [06-05|14:46:22.060] [3/16 Batches] Starting stream           startBlock=0
zkevm-erigon-1  | [INFO] [06-05|14:46:22.060] [3/16 Batches] Reading blocks from the datastream. 
zkevm-erigon-1  | [INFO] [06-05|14:46:22.060] [3/16 Batches] Started downloading L2Blocks routine 
zkevm-erigon-1  | [INFO] [06-05|14:46:23.558] [3/16 Batches] Finished Batches stage 
zkevm-erigon-1  | [EROR] [06-05|14:46:23.558] Error while executing stage              err="[3/16 Batches] l2blocks download routine error: after start command error: read buffer error reading from server: read tcp 172.18.0.20:39202->35.189.86.110:6900: read: connection reset by peer"
zkevm-erigon-1  | [EROR] [06-05|14:46:23.558] Staged Sync                              err="[3/16 Batches] l2blocks download routine error: after start command error: read buffer error reading from server: read tcp 172.18.0.20:39202->35.189.86.110:6900: read: connection reset by peer"
zkevm-erigon-1  | [INFO] [06-05|14:46:23.558] [3/16 Batches] Finished downloading L2Blocks routine 
zkevm-erigon-1  | [INFO] [06-05|14:46:24.059] [3/16 Batches] Starting batches stage 
zkevm-erigon-1  | [INFO] [06-05|14:46:24.060] [3/16 Batches] Starting stream           startBlock=0
zkevm-erigon-1  | [INFO] [06-05|14:46:24.060] [3/16 Batches] Reading blocks from the datastream. 
zkevm-erigon-1  | [INFO] [06-05|14:46:24.060] [3/16 Batches] Started downloading L2Blocks routine 
zkevm-erigon-1  | [INFO] [06-05|14:46:24.060] [3/16 Batches] Finished Batches stage 
zkevm-erigon-1  | [INFO] [06-05|14:46:24.060] [3/16 Batches] Finished downloading L2Blocks routine 
zkevm-erigon-1  | [EROR] [06-05|14:46:24.060] Error while executing stage              err="[3/16 Batches] l2blocks download routine error: 172.18.0.20:39202 35.189.86.110:6900 Error sending to server: write tcp 172.18.0.20:39202->35.189.86.110:6900: write: broken pipe"
zkevm-erigon-1  | [EROR] [06-05|14:46:24.060] Staged Sync                              err="[3/16 Batches] l2blocks download routine error: 172.18.0.20:39202 35.189.86.110:6900 Error sending to server: write tcp 172.18.0.20:39202->35.189.86.110:6900: write: broken pipe"
zkevm-erigon-1  | [INFO] [06-05|14:46:24.560] [3/16 Batches] Starting batches stage 
zkevm-erigon-1  | [INFO] [06-05|14:46:24.561] [3/16 Batches] Starting stream           startBlock=0
zkevm-erigon-1  | [INFO] [06-05|14:46:24.561] [3/16 Batches] Reading blocks from the datastream. 

Steps to reproduce the behaviour

Fresh sync polygon-zkevm or xlayer using cdk-erigon 1.1.2

mandrigin commented 4 months ago

@yorickdowne 1.1.2 can’t be used with XLayer mainnet and zkEVM mainnet until they upgrade the sequencer to support the new version of the datastream. For these, please use 1.0.x versions. It’s a one time painful process to migrate the datastream format, but then we gonna be in a much better place (upgradeable, documented and standardized).

yorickdowne commented 4 months ago

That is important to know! Thank you! We shall hang loose.