trie : use trie.NewStackTrie instead of new(trie.Trie) (#22246)

The PR makes use of the stacktrie, which is is more lenient on resource consumption, than the regular trie, in cases where we only need it for DeriveSha
# Conflicts:
#	cmd/evm/internal/t8ntool/execution.go
#	consensus/clique/clique.go
#	consensus/ethash/consensus.go
#	core/genesis.go
#	core/tx_pool_test.go
#	eth/fetcher/block_fetcher.go
#	eth/fetcher/block_fetcher_test.go
#	les/odr_requests.go
#	miner/miner_test.go
#	miner/worker.go
#	turbo/stages/blockchain_test.go
This commit is contained in:
ucwong 2021-02-02 20:09:23 +08:00 committed by Igor Mandrigin
parent 1fb76cca04
commit e7cc88e4af

View File

@ -148,5 +148,5 @@ func GenerateBadBlock(parent *types.Block, engine consensus.Engine, txs types.Tr
}
header.Root = common.BytesToHash(hasher.Sum(nil))
// Assemble and return the final block for sealing
return types.NewBlock(header, txs, nil, receipts, new(trie.Trie))
return types.NewBlock(header, txs, nil, receipts, trie.NewStackTrie(nil))
}