Skip to content

Commit

Permalink
feat(beacon): change the reorg log level (#350)
Browse files Browse the repository at this point in the history
* use debug log level to avoid logging too many logs when frequently soft block reorg.

* use debug log level to avoid logging too many logs when frequently soft block reorg.

* feat: check --taiko flag

---------

Co-authored-by: David <david@taiko.xyz>
  • Loading branch information
mask-pp and davidtaikocha authored Nov 17, 2024
1 parent 3cd4472 commit ca660bd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -2269,7 +2269,12 @@ func (bc *BlockChain) reorg(oldHead *types.Header, newHead *types.Block) error {
} else {
// len(newChain) == 0 && len(oldChain) > 0
// rewind the canonical chain to a lower point.
log.Error("Impossible reorg, please file an issue", "oldnum", oldBlock.Number(), "oldhash", oldBlock.Hash(), "oldblocks", len(oldChain), "newnum", newBlock.Number(), "newhash", newBlock.Hash(), "newblocks", len(newChain))
// CHANGE(taiko): use debug log level to avoid logging too many logs when frequently soft block rollback.
if bc.chainConfig.Taiko {
log.Debug("Impossible reorg, please file an issue", "oldnum", oldBlock.Number(), "oldhash", oldBlock.Hash(), "oldblocks", len(oldChain), "newnum", newBlock.Number(), "newhash", newBlock.Hash(), "newblocks", len(newChain))
} else {
log.Error("Impossible reorg, please file an issue", "oldnum", oldBlock.Number(), "oldhash", oldBlock.Hash(), "oldblocks", len(oldChain), "newnum", newBlock.Number(), "newhash", newBlock.Hash(), "newblocks", len(newChain))
}
}
// Acquire the tx-lookup lock before mutation. This step is essential
// as the txlookups should be changed atomically, and all subsequent
Expand Down

0 comments on commit ca660bd

Please sign in to comment.