dump witness sizes instead of loggin them to disk

This commit is contained in:
Jared Wasinger 2023-12-12 17:30:42 +01:00
parent 9d172df8bb
commit 4fc9f889ad
2 changed files with 3 additions and 8 deletions

View file

@ -1852,7 +1852,6 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool) (int, error)
} else { } else {
status, err = bc.writeBlockAndSetHead(block, receipts, logs, statedb, false) status, err = bc.writeBlockAndSetHead(block, receipts, logs, statedb, false)
} }
statedb.GetWitness().SetBlock(block) statedb.GetWitness().SetBlock(block)
log.Info(fmt.Sprintf("block %d summary:\n%s", block.NumberU64(), statedb.GetWitness().Summary())) log.Info(fmt.Sprintf("block %d summary:\n%s", block.NumberU64(), statedb.GetWitness().Summary()))
//state.DumpBlockWithWitnessToFile(statedb.GetWitness(), block) //state.DumpBlockWithWitnessToFile(statedb.GetWitness(), block)

View file

@ -161,13 +161,9 @@ func (w Witness) Copy() Witness {
panic("not implemented") panic("not implemented")
} }
func (w *Witness) Dump() { func (w *Witness) LogSizeWithBlock(b *types.Block) {
for owner, al := range w.lists { enc := w.EncodeRLP()
fmt.Printf("owner %x:\n", owner) fmt.Printf("block %d witness+block size: %d\n", b.Number(), len(enc))
for path, node := range al {
fmt.Printf("%x: %x\n", []byte(path), node)
}
}
} }
func (w *Witness) Summary() string { func (w *Witness) Summary() string {