geth同步 retrieved hash chain is invalid 错误

错误信息:

########## BAD BLOCK #########
Chain config: {ChainID: 1 Homestead: 1150000 DAO: 1920000 DAOSupport: true EIP150: 2463000 EIP155: 2675000 EIP158: 2675000 Byzantium: 4370000 Constantinople: 7280000 Petersburg: 7280000 Istanbul: 9069000, Muir Glacier: 9200000, Engine: ethash}

Number: 9069000
Hash: 0x072cf1df374159c5f23087750d8a2f3201542da196939ce446ff2c5c390fe5f6
·································································
·································································
·································································
·································································
·································································
Error: invalid gas used (remote: 6395997 local: 6449093)
##############################
 
WARN [12-10|12:01:11.813] Synchronisation failed, dropping peer    peer=106a4c4cba9167bf err="retrieved hash chain is invalid"

环境

Geth
Version: 1.9.7
Architecture: amd64
Protocol Versions: [64 63]
Go Version: go1.13.1
Operating System: linux

原因:

以太坊更新2.0 , 从块 9069000开始更新, 通过github 发现 1.9.8 1.9.7 版本都会出现这种错误

方案:

把geth 更新到1.9.9版本,以下提供一种更新方法

centos7环境

  1. 选择最新版本想下载 geth下载地址
wget -c https://github.com/ethereum/go-ethereum/archive/v1.9.9.zip
  1. 下载好了之后,解压 (没有unzip 下载个unzip)
unzip v1.9.9.zip
  1. 然后进入目录,进行make geth
cd go-ethereum-1.9.9 
make geth
  1. 如果make geth 长时间没有反应,大概有可能是网的问题,加个代理, 命令行输入:

export GOPROXY=https://goproxy.cn

  1. 然后重新 make geth 已经就可以了

  2. 装完之后,查看geth version 的版本, 如果还是原来的版本需要把原来的geth 命令删除
    如果 报 geth 找不到, 需要把 命令加入到环境变量中 (末尾加入一句话:

export PATH=$PATH:~/go-ethereum-1.9.9/build/bin/
$PATH: 后面为你自己的geth命令所在目录

vim  /etc/profile
  1. 然后刷新
source /etc/profile

再查看下版本应该就可以了

然后在重新回入正轨, 拉块

你可能感兴趣的:(区块链)