Skip to content

Commit

Permalink
more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
manav2401 committed Feb 5, 2025
1 parent bcf2d5e commit b094dbd
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -2101,7 +2101,9 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool) (int, error)
abort, results := bc.engine.VerifyHeaders(bc, headers)
defer close(abort)

log.Info("[debug] verify headers done")
start := headers[0].Number.Uint64()
end := headers[len(headers)-1].Number.Uint64()
log.Info("[debug] verify headers done", "start", start, "end", end)

// Peek the error for the first block to decide the directing import logic
it := newInsertIterator(chain, results, bc.validator)
Expand All @@ -2124,7 +2126,7 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool) (int, error)
return it.index, whitelist.ErrMismatch
}

log.Info("[debug] validate reorg done")
log.Info("[debug] validate reorg done", "start", start, "end", end)

// Left-trim all the known blocks that don't need to build snapshot
if bc.skipBlock(err, it) {
Expand Down Expand Up @@ -2256,6 +2258,7 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool) (int, error)
}

for ; block != nil && err == nil || errors.Is(err, ErrKnownBlock); block, err = it.next() {
log.Info("[debug] starting to process block", "number", block.NumberU64())
// If the chain is terminating, stop processing blocks
if bc.insertStopped() {
log.Debug("Abort during block processing")
Expand Down Expand Up @@ -2317,6 +2320,8 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool) (int, error)
// Clique blocks to have the same state is if there are no transactions.
lastCanon = block

log.Info("[debug] skipping block while processing", "number", block.NumberU64())

continue
}

Expand All @@ -2328,6 +2333,8 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool) (int, error)
parent = bc.GetHeader(block.ParentHash(), block.NumberU64()-1)
}

log.Info("[debug] got parent block", "number", block.NumberU64(), "parent nil?", parent == nil)

// If we have a followup block, run that against the current state to pre-cache
// transactions and probabilistically some of the account/storage trie nodes.
var followupInterrupt atomic.Bool
Expand Down

0 comments on commit b094dbd

Please sign in to comment.