Skip to content

Commit

Permalink
perf(miner): reduce rawdb calls for getting StartL1QueueIndex when …
Browse files Browse the repository at this point in the history
…inniting `environment` (#550)

Reduce rawdb calls
  • Loading branch information
GDdark authored Nov 8, 2023
1 parent 4412122 commit a8a9dc8
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit a8a9dc8

Please sign in to comment.