Skip to content

Commit

Permalink
Merge pull request #66 from testinprod-io/prevent-block-building-inte…
Browse files Browse the repository at this point in the history
…rrupt

Do not handle block building interrupt while processing force txs
  • Loading branch information
ImTei authored Jun 12, 2023
2 parents 093a193 + 1571026 commit f9e6a05
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion eth/stagedsync/stage_mining_exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ func SpawnMiningExecStage(s *StageState, tx kv.RwTx, cfg MiningExecCfg, quit <-c
// empty block is necessary to keep the liveness of the network.
if noempty {
if !forceTxs.Empty() {
logs, _, err := addTransactionsToMiningBlock(logPrefix, current, cfg.chainConfig, cfg.vmConfig, getHeader, cfg.engine, forceTxs, cfg.miningState.MiningConfig.Etherbase, ibs, quit, cfg.interrupt, cfg.payloadId, true)
// forceTxs is sent by Optimism consensus client, and all force txs must be included in the payload.
// Therefore, interrupts to block building must not be handled while force txs are being processed.
// So do not pass cfg.interrupt
logs, _, err := addTransactionsToMiningBlock(logPrefix, current, cfg.chainConfig, cfg.vmConfig, getHeader, cfg.engine, forceTxs, cfg.miningState.MiningConfig.Etherbase, ibs, quit, nil, cfg.payloadId, true)
if err != nil {
return err
}
Expand Down

0 comments on commit f9e6a05

Please sign in to comment.