mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 06:36:43 +00:00
perf(miner): reduce rawdb calls for getting StartL1QueueIndex when inniting environment (#550)
Reduce rawdb calls
This commit is contained in:
parent
441212200a
commit
a8a9dc83cb
1 changed files with 1 additions and 8 deletions
|
|
@ -813,14 +813,7 @@ func (w *worker) makeCurrent(parent *types.Block, header *types.Header) error {
|
|||
env.tcount = 0
|
||||
env.blockSize = 0
|
||||
env.l1TxCount = 0
|
||||
|
||||
// find next L1 message queue index
|
||||
nextQueueIndex := rawdb.ReadFirstQueueIndexNotInL2Block(w.eth.ChainDb(), parent.Hash())
|
||||
if nextQueueIndex == nil {
|
||||
// the parent must have been processed before we start a new mining job.
|
||||
log.Crit("Failed to read last L1 message in L2 block", "parent.Hash()", parent.Hash().String())
|
||||
}
|
||||
env.nextL1MsgIndex = *nextQueueIndex
|
||||
env.nextL1MsgIndex = traceEnv.StartL1QueueIndex
|
||||
|
||||
// Swap out the old work with the new one, terminating any leftover prefetcher
|
||||
// processes in the mean time and starting a new one.
|
||||
|
|
|
|||
Loading…
Reference in a new issue