eth, miner: retrieve mining state from live database (#25139)
* miner: retrieve mining state from live database * eth/catalyst: ignore stale fcu events from cl
This commit is contained in:
parent
660f920cde
commit
aedd5aaba1
@ -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.
|
||||
|
@ -786,16 +786,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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user