Skip to content

Commit e380580

Browse files
Clean up log lines and remove unnecessary fields from builder
1 parent 08d0fe3 commit e380580

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

core/blockchain.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,16 +1018,16 @@ func (bc *BlockChain) WriteBlockWithState(block *types.Block, receipts []*types.
10181018
count, ok := bc.stateDiffsProcessed[root.(common.Hash)]
10191019
//if we haven't processed the statediff for a given state root and it's child, don't dereference it yet
10201020
if !ok {
1021-
log.Info("Current root NOT found root in stateDiffsProcessed", "root", root.(common.Hash).Hex())
1021+
log.Debug("Current root NOT found root in stateDiffsProcessed", "root", root.(common.Hash).Hex())
10221022
bc.triegc.Push(root, number)
10231023
break
10241024
}
10251025
if count < 2 {
1026-
log.Info("Current root has not yet been processed for it's child", "root", root.(common.Hash).Hex())
1026+
log.Debug("Current root has not yet been processed for it's child", "root", root.(common.Hash).Hex())
10271027
bc.triegc.Push(root, number)
10281028
break
10291029
} else {
1030-
log.Warn("Current root found in stateDiffsProcessed collection with a count of 2, okay to dereference",
1030+
log.Debug("Current root found in stateDiffsProcessed collection with a count of 2, okay to dereference",
10311031
"root", root.(common.Hash).Hex(),
10321032
"blockNumber", uint64(-number),
10331033
"size of stateDiffsProcessed", len(bc.stateDiffsProcessed))
@@ -1036,7 +1036,7 @@ func (bc *BlockChain) WriteBlockWithState(block *types.Block, receipts []*types.
10361036
}
10371037
}
10381038

1039-
log.Info("DEREFERENCING", "root", root.(common.Hash).Hex())
1039+
log.Debug("Dereferencing", "root", root.(common.Hash).Hex())
10401040
triedb.Dereference(root.(common.Hash))
10411041
}
10421042
}

statediff/builder/builder.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ type Builder interface {
3636

3737
type builder struct {
3838
chainDB ethdb.Database
39-
trieDB *trie.Database
40-
cachedTrie *trie.Trie
4139
blockChain *core.BlockChain
4240
}
4341

@@ -46,7 +44,6 @@ type AccountsMap map[common.Hash]*state.Account
4644
func NewBuilder(db ethdb.Database, blockChain *core.BlockChain) *builder {
4745
return &builder{
4846
chainDB: db,
49-
trieDB: trie.NewDatabase(db),
5047
blockChain: blockChain,
5148
}
5249
}
@@ -121,7 +118,6 @@ func (sdb *builder) collectDiffNodes(a, b trie.NodeIterator) (AccountsMap, error
121118
for {
122119
log.Debug("Current Path and Hash", "path", pathToStr(it), "hashold", it.Hash())
123120
if it.Leaf() {
124-
125121
leafKey := make([]byte, len(it.LeafKey()))
126122
copy(leafKey, it.LeafKey())
127123
leafKeyHash := common.BytesToHash(leafKey)

0 commit comments

Comments
 (0)