mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
dump witness sizes instead of loggin them to disk
This commit is contained in:
parent
9d172df8bb
commit
4fc9f889ad
2 changed files with 3 additions and 8 deletions
|
|
@ -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)
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue