From 7842bc9ffad14835a11e23d4e75518a00b008dab Mon Sep 17 00:00:00 2001 From: Nam Truong Date: Thu, 7 Nov 2024 03:41:58 +0000 Subject: [PATCH] Add additional logging when forking happens which can be useful for monitoring --- core/blockchain.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/blockchain.go b/core/blockchain.go index 3682eab317..2fd3291a63 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -2159,6 +2159,15 @@ func (bc *BlockChain) insertChain(chain types.Blocks, verifySeals bool) (int, er "diff", block.Difficulty(), "elapsed", common.PrettyDuration(time.Since(start)), "txs", len(block.Transactions()), "gas", block.GasUsed(), "uncles", len(block.Uncles()), "root", block.Root()) + // Quorum + if bc.chainConfig.IsQuorum { + log.Error("Fork detected - which is not an expected behavior in Quorum", + "number", block.Number(), "hash", block.Hash(), + "diff", block.Difficulty(), "elapsed", common.PrettyDuration(time.Since(start)), + "txs", len(block.Transactions()), "gas", block.GasUsed(), "uncles", len(block.Uncles()), + "root", block.Root()) + } + // End Quorum default: // This in theory is impossible, but lets be nice to our future selves and leave