mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
miner: perform EIP-7002, EIP-7251 system calls
This commit is contained in:
parent
759455e205
commit
e488ec915f
1 changed files with 10 additions and 0 deletions
|
|
@ -120,11 +120,21 @@ func (miner *Miner) generateWork(params *generateParams, witness bool) *newPaylo
|
|||
// Collect consensus-layer requests if Prague is enabled.
|
||||
var requests [][]byte
|
||||
if miner.chainConfig.IsPrague(work.header.Number, work.header.Time) {
|
||||
// EIP-6110 deposits
|
||||
depositRequests, err := core.ParseDepositLogs(allLogs, miner.chainConfig)
|
||||
if err != nil {
|
||||
return &newPayloadResult{err: err}
|
||||
}
|
||||
requests = append(requests, depositRequests)
|
||||
// create EVM for system calls
|
||||
blockContext := core.NewEVMBlockContext(work.header, miner.chain, &work.header.Coinbase)
|
||||
vmenv := vm.NewEVM(blockContext, vm.TxContext{}, work.state, miner.chainConfig, vm.Config{})
|
||||
// EIP-7002 withdrawals
|
||||
withdrawalRequests := core.ProcessWithdrawalQueue(vmenv, work.state)
|
||||
requests = append(requests, withdrawalRequests)
|
||||
// EIP-7251 consolidations
|
||||
consolidationRequests := core.ProcessConsolidationQueue(vmenv, work.state)
|
||||
requests = append(requests, consolidationRequests)
|
||||
}
|
||||
if requests != nil {
|
||||
reqHash := types.CalcRequestsHash(requests)
|
||||
|
|
|
|||
Loading…
Reference in a new issue