Skip to content

Commit

Permalink
Add additional check that deposit txes included
Browse files Browse the repository at this point in the history
This additionally removes the 'abort' path inside of the add mining txes
code when dealing with deposit txes.
  • Loading branch information
jyellick committed May 8, 2024
1 parent 48a003e commit fe563da
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion eth/stagedsync/stage_mining_exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,16 @@ func SpawnMiningExecStage(s *StageState, tx kv.RwTx, cfg MiningExecCfg, quit <-c
}
depTS := types.NewTransactionsFixedOrder(txs)

logs, _, err := addTransactionsToMiningBlock(logPrefix, current, cfg.chainConfig, cfg.vmConfig, getHeader, cfg.engine, depTS, cfg.miningState.MiningConfig.Etherbase, ibs, quit, cfg.interrupt, cfg.payloadId, logger)
// Note, we do not allow early interrupt of adding deposit txes to the
// block, as they must all be included.
logs, _, err := addTransactionsToMiningBlock(logPrefix, current, cfg.chainConfig, cfg.vmConfig, getHeader, cfg.engine, depTS, cfg.miningState.MiningConfig.Etherbase, ibs, quit, nil, cfg.payloadId, logger)
log.Debug("addTransactionsToMiningBlock (deposit) result", "err", err, "logs", logs)
if err != nil {
return err
}
if len(current.Txs) != len(current.Deposits) {
return fmt.Errorf("all deposit transactions must commit but only %d of %d did", len(current.Txs), len(txs))
}
}

if txs != nil && !txs.Empty() {
Expand Down

0 comments on commit fe563da

Please sign in to comment.