Skip to content

Commit

Permalink
Clean up log lines and remove unnecessary fields from builder
Browse files Browse the repository at this point in the history
  • Loading branch information
elizabethengelman committed Feb 12, 2019
1 parent 08d0fe3 commit e380580
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 4 additions & 4 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1018,16 +1018,16 @@ func (bc *BlockChain) WriteBlockWithState(block *types.Block, receipts []*types.
count, ok := bc.stateDiffsProcessed[root.(common.Hash)]
//if we haven't processed the statediff for a given state root and it's child, don't dereference it yet
if !ok {
log.Info("Current root NOT found root in stateDiffsProcessed", "root", root.(common.Hash).Hex())
log.Debug("Current root NOT found root in stateDiffsProcessed", "root", root.(common.Hash).Hex())
bc.triegc.Push(root, number)
break
}
if count < 2 {
log.Info("Current root has not yet been processed for it's child", "root", root.(common.Hash).Hex())
log.Debug("Current root has not yet been processed for it's child", "root", root.(common.Hash).Hex())
bc.triegc.Push(root, number)
break
} else {
log.Warn("Current root found in stateDiffsProcessed collection with a count of 2, okay to dereference",
log.Debug("Current root found in stateDiffsProcessed collection with a count of 2, okay to dereference",
"root", root.(common.Hash).Hex(),
"blockNumber", uint64(-number),
"size of stateDiffsProcessed", len(bc.stateDiffsProcessed))
Expand All @@ -1036,7 +1036,7 @@ func (bc *BlockChain) WriteBlockWithState(block *types.Block, receipts []*types.
}
}

log.Info("DEREFERENCING", "root", root.(common.Hash).Hex())
log.Debug("Dereferencing", "root", root.(common.Hash).Hex())
triedb.Dereference(root.(common.Hash))
}
}
Expand Down
4 changes: 0 additions & 4 deletions statediff/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ type Builder interface {

type builder struct {
chainDB ethdb.Database
trieDB *trie.Database
cachedTrie *trie.Trie
blockChain *core.BlockChain
}

Expand All @@ -46,7 +44,6 @@ type AccountsMap map[common.Hash]*state.Account
func NewBuilder(db ethdb.Database, blockChain *core.BlockChain) *builder {
return &builder{
chainDB: db,
trieDB: trie.NewDatabase(db),
blockChain: blockChain,
}
}
Expand Down Expand Up @@ -121,7 +118,6 @@ func (sdb *builder) collectDiffNodes(a, b trie.NodeIterator) (AccountsMap, error
for {
log.Debug("Current Path and Hash", "path", pathToStr(it), "hashold", it.Hash())
if it.Leaf() {

leafKey := make([]byte, len(it.LeafKey()))
copy(leafKey, it.LeafKey())
leafKeyHash := common.BytesToHash(leafKey)
Expand Down

0 comments on commit e380580

Please sign in to comment.