logging block size

This commit is contained in:
kant 2023-11-30 12:09:07 -08:00
parent 7b79e2ac24
commit 0893afdc14
2 changed files with 2 additions and 1 deletions

View file

@ -589,7 +589,7 @@ func (c *Clique) FinalizeAndAssemble(chain consensus.ChainHeaderReader, header *
// Assemble and return the final block for sealing.
block := types.NewBlock(header, txs, nil, receipts, trie.NewStackTrie(nil))
log.Info("block_size_in_bytes: %v", int64(block.Size()))
fmt.Printf("clique.go block_size_in_bytes: %v", int64(block.Size()))
if metrics.Enabled {
metrics.GetOrRegisterGauge(blockSizeGaugeName, nil).Update(int64(block.Size()))
}

View file

@ -1122,6 +1122,7 @@ func (w *worker) commit(env *environment, interval func(), update bool, start ti
env := env.copy()
// Withdrawals are set to nil here, because this is only called in PoW.
block, err := w.engine.FinalizeAndAssemble(w.chain, env.header, env.state, env.txs, nil, env.receipts, nil)
fmt.Printf("block_size_in_bytes: %v", int64(block.Size()))
if err != nil {
return err
}