celo-blockchain icon indicating copy to clipboard operation
celo-blockchain copied to clipboard

Chain import not working

Open jcortejoso opened this issue 3 years ago • 0 comments

Expected Behavior

geth import <chain_backup> restore properly a chain snapshot.

Current Behavior

Import command fails showing the next error:

ERROR[07-30|09:20:42.587] Import error                             file=/tmp/chaindump err="invalid block 2500: extra-data too long: 170 > 32"

Steps to Reproduce Behavior

Working on mainnet, this can be easily reproduce from a node with some chain state:

$> geth -nousb export /tmp/chaindump 0 1000
$> rm -rf /root/.celo/celo
$> geth --nousb import /tmp/chaindump
INFO [07-30|09:36:06.422] Maximum peer count                       ETH=175 LES=0 total=175
INFO [07-30|09:36:06.422] Set global gas cap                       cap=25000000
INFO [07-30|09:36:06.423] Allocated cache and file handles         database=/root/.celo/celo/chaindata cache=512.00MiB handles=524288
INFO [07-30|09:36:06.442] Opened ancient database                  database=/root/.celo/celo/chaindata/ancient
INFO [07-30|09:36:06.444] Loaded most recent local header          number=0 hash="19ea33…bd11c3" td=1 age=1y3mo1w
INFO [07-30|09:36:06.444] Loaded most recent local full block      number=0 hash="19ea33…bd11c3" td=1 age=1y3mo1w
INFO [07-30|09:36:06.444] Loaded most recent local fast block      number=0 hash="19ea33…bd11c3" td=1 age=1y3mo1w
INFO [07-30|09:36:06.444] Importing blockchain                     file=/tmp/chaindump
ERROR[07-30|09:36:06.483]
########## BAD BLOCK #########
Chain config: {ChainID: 42220 Homestead: 0 DAO: <nil> DAOSupport: true EIP150: 0 EIP155: 0 EIP158: 0 Byzantium: 0 Constantinople: 0 Petersburg: 0 Istanbul: 0 Churrito: 6774000, Donut: 6774000, Engine: istanbul}

Number: 1
Hash: 0x805a4ceaec7435dc38a74eb036b99929953d7dd14af218c8a19430d52ca1ac57


Error: extra-data too long: 170 > 32
##############################

ERROR[07-30|09:36:06.483] Import error                             file=/tmp/chaindump err="invalid block 2500: extra-data too long: 170 > 32"
INFO [07-30|09:36:06.483] Writing snapshot state to disk           root="b7424a…a67167"
INFO [07-30|09:36:06.483] Persisted trie from memory database      nodes=0 size=0.00B time="4.261µs" gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
INFO [07-30|09:36:06.483] Blockchain stopped
Import done in 39.126128ms.

Compactions
 Level |   Tables   |    Size(MB)   |    Time(sec)  |    Read(MB)   |   Write(MB)
-------+------------+---------------+---------------+---------------+---------------
   1   |          1 |       0.01775 |       0.00000 |       0.00000 |       0.00000
-------+------------+---------------+---------------+---------------+---------------
 Total |          1 |       0.01775 |       0.00000 |       0.00000 |       0.00000

Read(MB):0.01832 Write(MB):0.00080
Object memory: 269.666 MB current, 258.471 MB peak
System memory: 337.341 MB current, 336.341 MB peak
Allocations:   0.190 million
GC pause:      146.644µs

Compacting entire database...
Compaction done in 11.800418ms.

Compactions
 Level |   Tables   |    Size(MB)   |    Time(sec)  |    Read(MB)   |   Write(MB)
-------+------------+---------------+---------------+---------------+---------------
   0   |          0 |       0.00000 |       0.00500 |       0.00000 |       0.00058
   1   |          1 |       0.01775 |       0.00434 |       0.01834 |       0.01775
-------+------------+---------------+---------------+---------------+---------------
 Total |          1 |       0.01775 |       0.00933 |       0.01834 |       0.01834

Read(MB):0.01889 Write(MB):0.01939
invalid block 2500: extra-data too long: 170 > 32

System information

Celo
Version: 1.4.0-unstable
Architecture: amd64
Protocol Versions: [66]
Go Version: go1.16.6
Operating System: linux
GOPATH=
GOROOT=go

jcortejoso avatar Jul 30 '21 09:07 jcortejoso