From 4bd69dc58192f3a34d4ea00694ade795dffd491e Mon Sep 17 00:00:00 2001 From: Eduard Voiculescu Date: Fri, 20 Sep 2024 09:57:00 -0400 Subject: [PATCH] - removing debug log - implementing lib num logic --- core/blockchain.go | 1 - eth/tracers/firehose.go | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/core/blockchain.go b/core/blockchain.go index 8ca3ec099595..d1411003d8cc 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1913,7 +1913,6 @@ type blockProcessingResult struct { func (bc *BlockChain) processBlock(block *types.Block, statedb *state.StateDB, start time.Time, setHead bool) (_ *blockProcessingResult, blockEndErr error) { if bc.logger != nil && bc.logger.OnBlockStart != nil { td := bc.GetTd(block.ParentHash(), block.NumberU64()-1) - fmt.Println("DOUDOU: finalized block event", bc.CurrentFinalBlock()) bc.logger.OnBlockStart(tracing.BlockEvent{ Block: block, TD: td, diff --git a/eth/tracers/firehose.go b/eth/tracers/firehose.go index cb78e9b91b68..6bf662877819 100644 --- a/eth/tracers/firehose.go +++ b/eth/tracers/firehose.go @@ -1514,6 +1514,10 @@ func (f *Firehose) printBlockToFirehose(block *pbeth.Block, finalityStatus *Fina } } + if block.Number-libNum >= 200 { + libNum = block.Number - 200 + } + // **Important* The final space in the Sprintf template is mandatory! f.outputBuffer.WriteString(fmt.Sprintf("FIRE BLOCK %d %s %d %s %d %d ", block.Number, hex.EncodeToString(block.Hash), previousNum, previousHash, libNum, block.Time().UnixNano()))