From d73eb87979021e63cb5867319c8ef07a9ba8a7d2 Mon Sep 17 00:00:00 2001 From: aaronbuchwald Date: Tue, 27 Jun 2023 04:29:19 -0400 Subject: [PATCH] core: log message if DeriveFields returns error (#27530) This error will never happen, but if it ever does happen, we will at least see it. --- core/blockchain.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/blockchain.go b/core/blockchain.go index becd39a1fa..1110e3e5f1 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -2048,7 +2048,9 @@ func (bc *BlockChain) recoverAncestors(block *types.Block) (common.Hash, error) // the processing of a block. These logs are later announced as deleted or reborn. func (bc *BlockChain) collectLogs(b *types.Block, removed bool) []*types.Log { receipts := rawdb.ReadRawReceipts(bc.db, b.Hash(), b.NumberU64()) - receipts.DeriveFields(bc.chainConfig, b.Hash(), b.NumberU64(), b.Time(), b.BaseFee(), b.Transactions()) + if err := receipts.DeriveFields(bc.chainConfig, b.Hash(), b.NumberU64(), b.Time(), b.BaseFee(), b.Transactions()); err != nil { + log.Error("Failed to derive block receipts fields", "hash", b.Hash(), "number", b.NumberU64(), "err", err) + } var logs []*types.Log for _, receipt := range receipts {