Address PR comments
This commit is contained in:
parent
9774f934d2
commit
8fc2cab837
@ -158,10 +158,6 @@ func makeFullNode(ctx *cli.Context) *node.Node {
|
|||||||
cfg.Eth.ConstantinopleOverride = new(big.Int).SetUint64(ctx.GlobalUint64(utils.ConstantinopleOverrideFlag.Name))
|
cfg.Eth.ConstantinopleOverride = new(big.Int).SetUint64(ctx.GlobalUint64(utils.ConstantinopleOverrideFlag.Name))
|
||||||
}
|
}
|
||||||
|
|
||||||
if ctx.GlobalBool(utils.StateDiffFlag.Name) {
|
|
||||||
cfg.Eth.StateDiff = true
|
|
||||||
}
|
|
||||||
|
|
||||||
utils.RegisterEthService(stack, &cfg.Eth)
|
utils.RegisterEthService(stack, &cfg.Eth)
|
||||||
|
|
||||||
if ctx.GlobalBool(utils.StateDiffFlag.Name) {
|
if ctx.GlobalBool(utils.StateDiffFlag.Name) {
|
||||||
|
@ -938,9 +938,6 @@ func (bc *BlockChain) WriteBlockWithoutState(block *types.Block, td *big.Int) (e
|
|||||||
|
|
||||||
func (bc *BlockChain) AddToStateDiffProcessedCollection(hash common.Hash) {
|
func (bc *BlockChain) AddToStateDiffProcessedCollection(hash common.Hash) {
|
||||||
count, ok := bc.stateDiffsProcessed[hash]
|
count, ok := bc.stateDiffsProcessed[hash]
|
||||||
if count > 1 {
|
|
||||||
log.Error("count is too high", "count", count, "hash", hash.Hex())
|
|
||||||
}
|
|
||||||
|
|
||||||
if ok {
|
if ok {
|
||||||
count++
|
count++
|
||||||
@ -1035,15 +1032,7 @@ func (bc *BlockChain) writeBlockWithState(block *types.Block, receipts []*types.
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
if bc.cacheConfig.ProcessStateDiffs {
|
if bc.cacheConfig.ProcessStateDiffs {
|
||||||
count, ok := bc.stateDiffsProcessed[root.(common.Hash)]
|
if !bc.allowedRootToBeDereferenced(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.Debug("Current root NOT found root in stateDiffsProcessed", "root", root.(common.Hash).Hex())
|
|
||||||
bc.triegc.Push(root, number)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
if count < 2 {
|
|
||||||
log.Debug("Current root has not yet been processed for it's child", "root", root.(common.Hash).Hex())
|
|
||||||
bc.triegc.Push(root, number)
|
bc.triegc.Push(root, number)
|
||||||
break
|
break
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user