//原代码
asMessage, e := tx.AsMessage(types.NewEIP155Signer(big.NewInt(int64(1))), tx.GasPrice())
if e == nil {
log.Println(asMessage.From().String())
}
log.Println(e)
//改成如下
asMessage, e := tx.AsMessage(types.LatestSignerForChainID(big.NewInt(int64(1))), tx.GasPrice())
if e == nil {
log.Println(asMessage.From().String())
}
log.Println(e)
原因应该为签名协议变更了,不应该用eip1559签名协议.导致解析签名的时候from地址解析出错,具体原因我没有深究。有大神知道的话请在底下回复,谢谢