Skip to content

Commit

Permalink
improve: remove sharedpool from miner
Browse files Browse the repository at this point in the history
  • Loading branch information
zzzckck committed Jan 19, 2024
1 parent e606461 commit c84179a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1022,9 +1022,9 @@ 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)
// StateAt returns a new mutable state based on a particular point in time with sharedStorage
func (bc *BlockChain) StateAt(root common.Hash) (*state.StateDB, error) {
return state.New(root, bc.stateCache, bc.snaps)
}

// Reset purges the entire blockchain, restoring it to its genesis state.
Expand Down
2 changes: 1 addition & 1 deletion miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit c84179a

Please sign in to comment.