mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 05:06:43 +00:00
miner: add inclusionListTxs to environment
This commit is contained in:
parent
3111ae8157
commit
8ddd60a301
1 changed files with 16 additions and 14 deletions
|
|
@ -59,6 +59,7 @@ type environment struct {
|
|||
receipts []*types.Receipt
|
||||
sidecars []*types.BlobTxSidecar
|
||||
blobs int
|
||||
inclusionListTxs []*types.Transaction
|
||||
|
||||
witness *stateless.Witness
|
||||
}
|
||||
|
|
@ -246,7 +247,7 @@ func (miner *Miner) prepareWork(genParams *generateParams, witness bool) (*envir
|
|||
// Could potentially happen if starting to mine in an odd state.
|
||||
// Note genParams.coinbase can be different with header.Coinbase
|
||||
// since clique algorithm can modify the coinbase field in header.
|
||||
env, err := miner.makeEnv(parent, header, genParams.coinbase, witness)
|
||||
env, err := miner.makeEnv(parent, header, genParams.coinbase, genParams.inclusionList, witness)
|
||||
if err != nil {
|
||||
log.Error("Failed to create sealing context", "err", err)
|
||||
return nil, err
|
||||
|
|
@ -261,7 +262,7 @@ func (miner *Miner) prepareWork(genParams *generateParams, witness bool) (*envir
|
|||
}
|
||||
|
||||
// makeEnv creates a new environment for the sealing block.
|
||||
func (miner *Miner) makeEnv(parent *types.Header, header *types.Header, coinbase common.Address, witness bool) (*environment, error) {
|
||||
func (miner *Miner) makeEnv(parent *types.Header, header *types.Header, coinbase common.Address, inclusionList types.InclusionList, witness bool) (*environment, error) {
|
||||
// Retrieve the parent state to execute on top.
|
||||
state, err := miner.chain.StateAt(parent.Root)
|
||||
if err != nil {
|
||||
|
|
@ -281,6 +282,7 @@ func (miner *Miner) makeEnv(parent *types.Header, header *types.Header, coinbase
|
|||
size: uint64(header.Size()),
|
||||
coinbase: coinbase,
|
||||
header: header,
|
||||
inclusionListTxs: types.InclusionListToTransactions(inclusionList),
|
||||
witness: state.Witness(),
|
||||
evm: vm.NewEVM(core.NewEVMBlockContext(header, miner.chain, &coinbase), state, miner.chainConfig, vm.Config{}),
|
||||
}, nil
|
||||
|
|
|
|||
Loading…
Reference in a new issue