From fc9fb609b3567b3a194f94de2b14e9691c16cfbe Mon Sep 17 00:00:00 2001 From: zzzckck <152148891+zzzckck@users.noreply.github.com> Date: Fri, 19 Jan 2024 22:18:38 +0800 Subject: [PATCH] improve: remove sharedpool from miner --- core/blockchain.go | 5 ----- miner/worker.go | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index 7e42798e1a..8ecf8bd3bf 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1022,11 +1022,6 @@ func (bc *BlockChain) SnapSyncCommitHead(hash common.Hash) error { return nil } -// StateAtWithSharedPool returns a new mutable state based on a particular point in time with sharedStorage -func (bc *BlockChain) StateAtWithSharedPool(root common.Hash) (*state.StateDB, error) { - return state.NewWithSharedPool(root, bc.stateCache, bc.snaps) -} - // Reset purges the entire blockchain, restoring it to its genesis state. func (bc *BlockChain) Reset() error { return bc.ResetWithGenesisBlock(bc.genesisBlock) diff --git a/miner/worker.go b/miner/worker.go index 2b76f3fc28..0b8f248742 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -650,7 +650,7 @@ func (w *worker) makeEnv(parent *types.Header, header *types.Header, coinbase co prevEnv *environment) (*environment, error) { // Retrieve the parent state to execute on top and start a prefetcher for // the miner to speed block sealing up a bit - state, err := w.chain.StateAtWithSharedPool(parent.Root) + state, err := w.chain.StateAt(parent.Root) if err != nil { return nil, err }