Skip to content

Commit

Permalink
miner: add skelton support for exits in miner
Browse files Browse the repository at this point in the history
  • Loading branch information
lightclient committed Feb 22, 2024
1 parent 692127e commit 311163a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ type environment struct {
receipts []*types.Receipt
sidecars []*types.BlobTxSidecar
blobs int
exits []*types.Exit
}

// copy creates a deep copy of environment.
Expand All @@ -116,6 +117,9 @@ func (env *environment) copy() *environment {
cpy.sidecars = make([]*types.BlobTxSidecar, len(env.sidecars))
copy(cpy.sidecars, env.sidecars)

cpy.exits = make([]*types.Exit, len(env.exits))
copy(cpy.exits, env.exits)

return cpy
}

Expand Down Expand Up @@ -1096,7 +1100,7 @@ func (w *worker) generateWork(params *generateParams) *newPayloadResult {
log.Warn("Block building is interrupted", "allowance", common.PrettyDuration(w.newpayloadTimeout))
}
}
block, err := w.engine.FinalizeAndAssemble(w.chain, work.header, work.state, work.txs, nil, work.receipts, params.withdrawals)
block, err := w.engine.FinalizeAndAssemble(w.chain, work.header, work.state, work.txs, nil, work.receipts, params.withdrawals, work.exits)
if err != nil {
return &newPayloadResult{err: err}
}
Expand Down Expand Up @@ -1184,8 +1188,8 @@ func (w *worker) commit(env *environment, interval func(), update bool, start ti
// Create a local environment copy, avoid the data race with snapshot state.
// https://github.com/ethereum/go-ethereum/issues/24299
env := env.copy()
// Withdrawals are set to nil here, because this is only called in PoW.
block, err := w.engine.FinalizeAndAssemble(w.chain, env.header, env.state, env.txs, nil, env.receipts, nil)
// Withdrawals and exits are set to nil here, because this is only called in PoW.
block, err := w.engine.FinalizeAndAssemble(w.chain, env.header, env.state, env.txs, nil, env.receipts, nil, nil)
if err != nil {
return err
}
Expand Down

0 comments on commit 311163a

Please sign in to comment.