bor icon indicating copy to clipboard operation
bor copied to clipboard

Bad block 25890752 Error: invalid merkle root

Open julia-light opened this issue 4 years ago • 14 comments

System information

Geth version:

Bor
Version: 0.2.14-stable
Git Commit: 28963d5ccd3028e0ac6f1915845c747862d649d1
Architecture: amd64
Go Version: go1.17.7
Operating System: linux
GOPATH=/go
GOROOT=go

OS & Version: Linux

Expected behaviour

Sync new blockdata

Actual behaviour

BAD BLOCK

Steps to reproduce the behaviour

Our snapshot from "https://matic-blockchain-snapshots.s3-accelerate.amazonaws.com/matic-mainnet/bor-fullnode-snapshot-2022-02-20.tar.gz "
And already up to date
services:
  bor:
    container_name: bor
    image: bor:latest
    build: /github/bor
    volumes:
        - /data/bor:/datadir
    ports:
        - "8545:8545" # RPC
        - "30303:30303" # Peers (TCP)
        - "30303:30303/udp" # Peers (UDP)
    command:
        - --syncmode=full
        - --datadir=/datadir
        - --networkid=137
        - --bor.heimdall=http://heimdallr:1317
        - --bor.logs
        - --miner.gaslimit=200000000
        - --miner.gastarget=20000000
        - --http
        - --http.addr=0.0.0.0
        - --http.port=8545
        - --http.api=eth,net,web3,admin,txpool,debug,bor
        - --http.corsdomain=*
        - --http.vhosts=*
        - --ws
        - --ws.addr=0.0.0.0
        - --ws.port=8545
        - --ws.api=eth,net,web3,admin,txpool,debug,bor
        - --ws.origins=*
        - --ipcdisable
        - --nousb
        - --bootnodes=enode://0cb82b395094ee4a2915e9714894627de9ed8498fb881cec6db7c65e8b9a5bd7f2f25cc84e71e89d0947e51c76e85d0847de848c7782b13c0255247a6758178c@44.232.55.71:30303,enode://88116f4295f5a31538ae409e4d44ad40d22e44ee9342869e7d68bdec55b0f83c1530355ce8b41fbec0928a7d75a5745d528450d30aec92066ab6ba1ee351d710@159.203.9.164:30303,enode://3178257cd1e1ab8f95eeb7cc45e28b6047a0432b2f9412cff1db9bb31426eac30edeb81fedc30b7cd3059f0902b5350f75d1b376d2c632e1b375af0553813e6f@35.221.13.28:30303,enode://16d9a28eadbd247a09ff53b7b1f22231f6deaf10b86d4b23924023aea49bfdd51465b36d79d29be46a5497a96151a1a1ea448f8a8666266284e004306b2afb6e@35.199.4.13:30303,enode://ef271e1c28382daa6ac2d1006dd1924356cfd843dbe88a7397d53396e0741ca1a8da0a113913dee52d9071f0ad8d39e3ce87aa81ebc190776432ee7ddc9d9470@35.230.116.151:30303

Backtrace

########## BAD BLOCK #########
Chain config: {ChainID: 137 Homestead: 0 DAO: <nil> DAOSupport: true EIP150: 0 EIP155: 0 EIP158: 0 Byzantium: 0 Constantinople: 0 Petersburg: 0 Istanbul: 3395000, Muir Glacier: 3395000, Berlin: 14750000, London: 23850000, Engine: bor}

Number: 25890752
Hash: 0x6ab3f085d16ac7a3bdb11a3bd86ac36afb45fade22f94a79e87b47b6f4440b4b


Error: invalid merkle root (remote: 91805118cec29925f8ee7daebb03d439cdd0b4f55ef03c8d63d1b267c01832ed local: fedfc15b5d82eebc891fcaa1381b4cb6aebe532ef3088cf8e393875987283e87)
##############################

Kindly check and help us

julia-light avatar Mar 15 '22 03:03 julia-light

I ran into the same problem

wangzhen130 avatar Mar 16 '22 10:03 wangzhen130

same issue on block: 26071679

bor[25925]: 171: cumulative: 25434761 gas: 24428 contract: 0x0000000000000000000000000000000000000000 status: 1 tx: 0xcc23941f42c11f01bfec8ee7b68f9c3832dd2b7415a054beea88029ff3e9bfd1 logs: [0xc0de40d290 0xc0de40d3f0] bloom: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000200000000000000000000000000000000000800000000000000000000100000000000000000000021082000000000000000000000000000000000080200000000000800010010000000000000000000000000000010000000010000000000000000000220000000000000000000000000000000000000000000000000000000000004000000000000000000001000000000000000000000000000000100000000000000010000000000000000000000000000080000000000000000000040000100000 state:
bor[25925]: Error: invalid merkle root (remote: 75972facca9bb483adba1f7eb5dbdb63260f40c0dc92ab9899d5b087a2b8d6f0 local: 2f3aea33895e6d62478823936bed2c9dfbd8f4633f3f19d83d2c185a139048e9)
bor[25925]: ##############################
bor[25925]: WARN [03-18|12:58:15.725] Synchronisation failed, dropping peer    peer=6d91ca827b397f5e16e8c6edc9600e0759255ccbdfd482dcdeb22a1cc0ff658e err="retrieved hash chain is invalid: invalid merkle root (remote: 75972facca9bb483adba1f7eb5dbdb63260f40c0dc92ab9899d5b087a2b8d6f0 local: 2f3aea33895e6d62478823936bed2c9dfbd8f4633f3f19d83d2c185a139048e9)"
bor[25925]: WARN [03-18|12:58:21.726] Synchronisation failed, dropping peer    peer=6d91ca827b397f5e16e8c6edc9600e0759255ccbdfd482dcdeb22a1cc0ff658e err=timeout

Bor version: https://github.com/maticnetwork/bor/releases/tag/v0.2.14-tmp-span-hotfix

jsvisa avatar Mar 18 '22 13:03 jsvisa

Started happening here as well -

########## BAD BLOCK #########                                                                                                                                                                                                                                                                                                
Chain config: {ChainID: 137 Homestead: 0 DAO: <nil> DAOSupport: true EIP150: 0 EIP155: 0 EIP158: 0 Byzantium: 0 Constantinople: 0 Petersburg: 0 Istanbul: 3395000, Muir Glacier: 3395000, Berlin: 14750000, London: 23850000, Engine: bor}                                                                                    
                                                                                                                                                                                                                                                                                                                              
Number: 26071680                                                                                                                                                                                                                                                                                                              
Hash: 0xa58a903a0fc239ae2fdfcfd78b1f73e09f3e790d93b04dd8da141a9324f452fe   
...
Error: invalid merkle root (remote: 75972facca9bb483adba1f7eb5dbdb63260f40c0dc92ab9899d5b087a2b8d6f0 local: 2f3aea33895e6d62478823936bed2c9dfbd8f4633f3f19d83d2c185a139048e9)

ko0f avatar Mar 18 '22 15:03 ko0f

Same here


Bor
Version: 0.2.14-stable
Git Commit: 28963d5ccd3028e0ac6f1915845c747862d649d1
Architecture: amd64
Go Version: go1.17
Operating System: linux
GOPATH=/home/ubuntu/go
GOROOT=/home/ubuntu/.go

Mar 18 16:26:10 bash[55777]: Error: invalid merkle root (remote: 75972facca9bb483adba1f7eb5dbdb63260f40c0dc92ab9899d5b087a2b8d6f0 local: 2f3aea33895e6d62478823936bed2c9dfbd8f4633f3f19d83d2c185a139048e9)
Mar 18 16:26:10 bash[55777]: ##############################
Mar 18 16:26:10 bash[55777]:  
Mar 18 16:26:10 bash[55777]: WARN [03-18|16:26:10.217] Synchronisation failed, dropping peer    peer=69e523e476814ae515ae2ab9cd045881def7f7434b248d00e1c43b675e2a9f62 err="retrieved hash chain is invalid: invalid merkle root (remote: 75972facca9bb483adba1f7eb5dbdb63260f40c0dc92ab9899d5b087a2b8d6f0 local: 2f3aea33895e6d62478823936bed2c9dfbd8f4633f3f19d83d2c185a139048e9)"
Mar 18 16:26:10 bash[55777]: WARN [03-18|16:26:10.217] Synchronisation failed, retrying         err="peer is unknown or unhealthy"
Mar 18 16:26:10 bash[55777]: WARN [03-18|16:26:10.217] Synchronisation failed, retrying         err="peer is unknown or unhealthy"
Mar 18 16:26:10 bash[55777]: WARN [03-18|16:26:10.217] Synchronisation failed, retrying         err="peer is unknown or unhealthy"
Mar 18 16:26:32 bash[55777]: ERROR[03-18|16:26:32.718] Snapshot extension registration failed   peer=ecbeebb8 err="peer connected on snap without compatible eth support"

fstepho avatar Mar 18 '22 16:03 fstepho

I also encountered this error today on block 26071679.

I checked heimdall and noticed it had stopped syncing, updated to 0.2.8 and then had an apphash mismatch. I'm restoring heimdall from the most recent snapshot right now and then will try syncing bor again.

EDIT: found this on twitter, heimdall update is most likely the culprit

EDIT2: Applying the heimdall update and rewinding the chain on bor solved the issue.

https://twitter.com/0xPolygonDevs/status/1504819653431992320

As shared yesterday, Polygon is undergoing a hard fork with the Heimdall update to improve performance across Polygon. This started as block number 8664000 was mined at approximately 10:30AM UTC and is progressing without issue.

zcrypt0 avatar Mar 18 '22 20:03 zcrypt0

Is there single place on Internet where the polygon team announces hardforks? It's pretty frustrating to find the node is down because team released a new version a few ago days again.

ruXlab avatar Mar 19 '22 08:03 ruXlab

Heimdall v0.2.8 may solve this https://forum.polygon.technology/t/heimdall-v0-2-8-includes-hardfork/2675

ko0f avatar Mar 19 '22 10:03 ko0f

After update of heimdall to v0.2.8 I'm getting Error: invalid merkle root (remote: 75972facca9bb483adba1f7eb5dbdb63260f40c0dc92ab9899d5b087a2b8d6f0 local: 8afb9a9191 in bor and ERROR: error during handshake: error on replay: Wrong Block.Header.AppHash. Expected EBC68C180769161664897E8A5 in heimdall. Shall I rewind heimdall chain to block 8664000 somehow?

ruXlab avatar Mar 19 '22 12:03 ruXlab

@ruXlab After updating then restoring heimdall from the latest snapshot, waiting for it to sync, and then rewinding the head on bor, my node is running successfully again.

zcrypt0 avatar Mar 19 '22 17:03 zcrypt0

@zcrypt0 thanks! I was hoping to fix it locally

ruXlab avatar Mar 19 '22 17:03 ruXlab

@ruXlab After updating then restoring heimdall from the latest snapshot, waiting for it to sync, and then rewinding the head on bor, my node is running successfully again.

Hi, @zcrypt0 back to what block height?

jsvisa avatar Mar 20 '22 01:03 jsvisa

@zcrypt0 thanks for your advice, after resetting the Heimdall's snapshot, the bor starts to synchronize again.

IMHO, if Heimdall has RPC to reset block height, no need to reset the snapshot.

jsvisa avatar Mar 20 '22 02:03 jsvisa

heimdalld does have a rollback command, but that only rolls back state (and only to the previous height) -- the actual block will still remain in the heimdall db and prevent you from syncing even after you upgrade to v0.2.8

if you were running any version of heimdall older than v0.2.8 and you didn't upgrade in time for the hard fork, you'll have to sync heimdall from scratch again (or use a snapshot)

zhongfu avatar Mar 20 '22 10:03 zhongfu

Closing this as no further updates on this

temaniarpit27 avatar May 12 '22 08:05 temaniarpit27