erigontech / erigon

Ethereum implementation on the efficiency frontier https://erigon.gitbook.io
GNU Lesser General Public License v3.0
3.13k stars 1.11k forks source link

panic: runtime error: index out of range [3] with length 0 #12250

Open githubsavelib opened 1 week ago

githubsavelib commented 1 week ago

System information

Erigon version: ./erigon --version

erigon version 2.60.8-dec9d206

OS & Version: Ubuntu 20.04

Commit hash:

Erigon Command (with flags/config): /root/erigon/build/bin/erigon --datadir=/mnt/volume-fsn1-1/eth

Consensus Layer:

Consensus Layer Command (with flags/config):

Chain/Network: Eth

Expected behaviour

Actual behaviour

Steps to reproduce the behaviour

Backtrace

INFO[10-08|16:45:28.442] logging to file system                   log dir=/mnt/volume-fsn1-1/eth/logs file prefix=erigon log level=info json=false
INFO[10-08|16:45:28.442] Build info                               git_branch=HEAD git_tag=v2.60.6-32-gdec9d2067 git_commit=dec9d2067be63cb155016efa05050339e2a8994a
INFO[10-08|16:45:28.442] Starting Erigon on Ethereum mainnet...
INFO[10-08|16:45:28.443] Maximum peer count                       ETH=100 total=100
INFO[10-08|16:45:28.443] starting HTTP APIs                       port=8545 APIs=eth,erigon,engine
INFO[10-08|16:45:28.443] torrent verbosity                        level=WRN

INFO[10-08|16:45:30.547] Set global gas cap                       cap=50000000
INFO[10-08|16:45:30.618] [Downloader] Running with                ipv6-enabled=true ipv4-enabled=true download.rate=16mb upload.rate=4mb
INFO[10-08|16:45:30.618] Opening Database                         label=chaindata path=/mnt/volume-fsn1-1/eth/chaindata
INFO[10-08|16:45:30.620] [db] open                                label=chaindata sizeLimit=12TB pageSize=8192
INFO[10-08|16:45:30.620] Initialised chain configuration          config="{ChainID: 1, Homestead: 1150000, DAO: 1920000, Tangerine Whistle: 2463000, Spurious Dragon: 2675000, Byzantium: 4370000, Constantinople: 7280000, Petersburg: 7280000, Istanbul: 9069000, Muir Glacier: 9200000, Berlin: 12244000, London: 12965000, Arrow Glacier: 13773000, Gray Glacier: 15050000, Terminal Total Difficulty: 58750000000000000000000, Merge Netsplit: <nil>, Shanghai: 1681338455, Cancun: 1710338135, Prague: <nil>, Osaka: <nil>, Engine: ethash, NoPruneContracts: map[0x00000000219ab540356cBB839Cbe05303d7705Fa:true]}" genesis=0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3
INFO[10-08|16:45:51.881] Initialising Ethereum protocol           network=1
INFO[10-08|16:45:51.881] Disk storage enabled for ethash DAGs     dir=/mnt/volume-fsn1-1/eth/ethash-dags count=2
INFO[10-08|16:45:51.888] Starting private RPC server              on=127.0.0.1:9090
INFO[10-08|16:45:51.888] new subscription to logs established
INFO[10-08|16:45:51.889] rpc filters: subscribing to Erigon events
INFO[10-08|16:45:51.889] New txs subscriber joined
INFO[10-08|16:45:51.889] new subscription to newHeaders established
INFO[10-08|16:45:51.890] Reading JWT secret                       path=/mnt/volume-fsn1-1/eth/jwt.hex
INFO[10-08|16:45:51.890] HTTP endpoint opened for Engine API      url=127.0.0.1:8551 ws=true ws.compression=true
INFO[10-08|16:45:51.890] JsonRpc endpoint opened                  ws=false ws.compression=true grpc=false http.url=127.0.0.1:8545
INFO[10-08|16:45:51.897] [txpool] Started
mdbx_setup_dxb:16114 opening after an unclean shutdown, but boot-id(975122c734a517b9-db775fa57dee4398) is MATCH: rollback NOT needed, steady-sync NEEDED
INFO[10-08|16:45:51.919] [1/12 Snapshots] Requesting downloads
WARN[10-08|16:45:51.920] NAT ExternalIP resolution has failed, try to pass a different --nat option err="no UPnP or NAT-PMP router discovered"
INFO[10-08|16:45:51.922] Started P2P networking                   version=68 self=enode://5c1cffbcbd714b71936acb80d32e668ad0f41f7c1cd2c5524dcca42f7c41a083e7a44395edfc18de31f98dcac8fadd75301d42761b246b3256888102f1417a5b@127.0.0.1:30303 name=erigon/v2.60.8-dec9d206/linux-amd64/go1.23.2
mdbx_setup_dxb:16114 opening after an unclean shutdown, but boot-id(975122c734a517b9-db775fa57dee4398) is MATCH: rollback NOT needed, steady-sync NEEDED
WARN[10-08|16:45:51.926] NAT ExternalIP resolution has failed, try to pass a different --nat option err="no UPnP or NAT-PMP router discovered"
INFO[10-08|16:45:51.928] Started P2P networking                   version=67 self=enode://5c1cffbcbd714b71936acb80d32e668ad0f41f7c1cd2c5524dcca42f7c41a083e7a44395edfc18de31f98dcac8fadd75301d42761b246b3256888102f1417a5b@127.0.0.1:30304 name=erigon/v2.60.8-dec9d206/linux-amd64/go1.23.2
INFO[10-08|16:45:54.844] [snapshots:download] Stat                blocks=20400k indices=0k alloc=3.2GB sys=3.3GB
INFO[10-08|16:45:54.845] [snapshots:missed-idx] Stat              blocks=20400k indices=0k alloc=3.2GB sys=3.3GB
panic: runtime error: index out of range [3] with length 0

goroutine 5550 [running]:
encoding/binary.bigEndian.Uint32(...)
        encoding/binary/binary.go:164
github.com/ledgerwatch/erigon-lib/downloader/snaptype.GetIndexSalt({0xc0b8031800, 0x20})
        github.com/ledgerwatch/erigon-lib@v1.0.0/downloader/snaptype/type.go:106 +0x238
github.com/ledgerwatch/erigon-lib/downloader/snaptype.snapType.BuildIndexes({0x1, {0x2976b50, 0x7}, {0x1, 0x1}, {0xc0009004b0, 0x1, 0x1}, {0x31bc640, 0x2e67458}, ...}, ...)
        github.com/ledgerwatch/erigon-lib@v1.0.0/downloader/snaptype/type.go:229 +0xb8
github.com/ledgerwatch/erigon-lib/downloader/snaptype.Enum.BuildIndexes(0xc005561698?, {0x31d81f8, 0xc0b8072be0}, {0x1, 0x0, 0x7a120, {0xc0b807a400, 0x1c}, {0xc0b8031800, 0x3d}, ...}, ...)
        github.com/ledgerwatch/erigon-lib@v1.0.0/downloader/snaptype/type.go:355 +0x147
github.com/ledgerwatch/erigon/turbo/snapshotsync/freezeblocks.(*RoSnapshots).buildMissedIndices.func2.1()
        github.com/ledgerwatch/erigon/turbo/snapshotsync/freezeblocks/block_snapshots.go:786 +0x228
golang.org/x/sync/errgroup.(*Group).Go.func1()
        golang.org/x/sync@v0.7.0/errgroup/errgroup.go:78 +0x50
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 2845
        golang.org/x/sync@v0.7.0/errgroup/errgroup.go:75 +0x96
AskAlexSharov commented 1 day ago

fixed by https://github.com/erigontech/erigon/pull/12393