From 6e82f82f1f6c11e72415ba771f8992cc2ea0adee Mon Sep 17 00:00:00 2001 From: Atif Anowar Date: Wed, 20 Oct 2021 14:23:11 +0200 Subject: [PATCH] Fixed header encoding/decoding issue for integrating eip-1559 --- consensus/pandora/consensus.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/consensus/pandora/consensus.go b/consensus/pandora/consensus.go index 65ffbf1fe14d..236580229fb6 100644 --- a/consensus/pandora/consensus.go +++ b/consensus/pandora/consensus.go @@ -40,7 +40,7 @@ func (p *Pandora) SealHash(header *types.Header) (hash common.Hash) { headerExtra.Slot = pandoraExtraData.Slot extraData, _ = rlp.EncodeToBytes(headerExtra) } - rlp.Encode(hasher, []interface{}{ + enc := []interface{}{ header.ParentHash, header.UncleHash, header.Coinbase, @@ -54,7 +54,11 @@ func (p *Pandora) SealHash(header *types.Header) (hash common.Hash) { header.GasUsed, header.Time, extraData, - }) + } + if header.BaseFee != nil { + enc = append(enc, header.BaseFee) + } + rlp.Encode(hasher, enc) hasher.Sum(hash[:0]) return hash }