Skip to content

Commit

Permalink
eth, miner: retrieve mining state from live database (ethereum#25139)
Browse files Browse the repository at this point in the history
* miner: retrieve mining state from live database

* eth/catalyst: ignore stale fcu events from cl
  • Loading branch information
rjl493456442 authored and maoueh committed Nov 29, 2022
1 parent 53f8587 commit 723cb19
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
1 change: 0 additions & 1 deletion miner/miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import (
type Backend interface {
BlockChain() *core.BlockChain
TxPool() *core.TxPool
StateAtBlock(block *types.Block, reexec uint64, base *state.StateDB, checkLive bool, preferDisk bool) (statedb *state.StateDB, err error)
}

// Config is the configuration parameters of mining.
Expand Down
10 changes: 0 additions & 10 deletions miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -795,16 +795,6 @@ func (w *worker) makeEnv(parent *types.Block, header *types.Header, coinbase com
// 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())
if err != nil {
// Note since the sealing block can be created upon the arbitrary parent
// block, but the state of parent block may already be pruned, so the necessary
// state recovery is needed here in the future.
//
// The maximum acceptable reorg depth can be limited by the finalised block
// somehow. TODO(rjl493456442) fix the hard-coded number here later.
state, err = w.eth.StateAtBlock(parent, 1024, nil, false, false)
log.Warn("Recovered mining state", "root", parent.Root(), "err", err)
}
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 723cb19

Please sign in to comment.