Skip to content

Commit 74dab88

Browse files
committed
miner: add inclusionListTxs to environment
1 parent 066ba7c commit 74dab88

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

miner/worker.go

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,12 @@ type environment struct {
5454
coinbase common.Address
5555
evm *vm.EVM
5656

57-
header *types.Header
58-
txs []*types.Transaction
59-
receipts []*types.Receipt
60-
sidecars []*types.BlobTxSidecar
61-
blobs int
57+
header *types.Header
58+
txs []*types.Transaction
59+
receipts []*types.Receipt
60+
sidecars []*types.BlobTxSidecar
61+
blobs int
62+
inclusionListTxs []*types.Transaction
6263

6364
witness *stateless.Witness
6465
}
@@ -246,7 +247,7 @@ func (miner *Miner) prepareWork(genParams *generateParams, witness bool) (*envir
246247
// Could potentially happen if starting to mine in an odd state.
247248
// Note genParams.coinbase can be different with header.Coinbase
248249
// since clique algorithm can modify the coinbase field in header.
249-
env, err := miner.makeEnv(parent, header, genParams.coinbase, witness)
250+
env, err := miner.makeEnv(parent, header, genParams.coinbase, genParams.inclusionList, witness)
250251
if err != nil {
251252
log.Error("Failed to create sealing context", "err", err)
252253
return nil, err
@@ -261,7 +262,7 @@ func (miner *Miner) prepareWork(genParams *generateParams, witness bool) (*envir
261262
}
262263

263264
// makeEnv creates a new environment for the sealing block.
264-
func (miner *Miner) makeEnv(parent *types.Header, header *types.Header, coinbase common.Address, witness bool) (*environment, error) {
265+
func (miner *Miner) makeEnv(parent *types.Header, header *types.Header, coinbase common.Address, inclusionList types.InclusionList, witness bool) (*environment, error) {
265266
// Retrieve the parent state to execute on top.
266267
state, err := miner.chain.StateAt(parent.Root)
267268
if err != nil {
@@ -276,13 +277,14 @@ func (miner *Miner) makeEnv(parent *types.Header, header *types.Header, coinbase
276277
}
277278
// Note the passed coinbase may be different with header.Coinbase.
278279
return &environment{
279-
signer: types.MakeSigner(miner.chainConfig, header.Number, header.Time),
280-
state: state,
281-
size: uint64(header.Size()),
282-
coinbase: coinbase,
283-
header: header,
284-
witness: state.Witness(),
285-
evm: vm.NewEVM(core.NewEVMBlockContext(header, miner.chain, &coinbase), state, miner.chainConfig, vm.Config{}),
280+
signer: types.MakeSigner(miner.chainConfig, header.Number, header.Time),
281+
state: state,
282+
size: uint64(header.Size()),
283+
coinbase: coinbase,
284+
header: header,
285+
inclusionListTxs: types.InclusionListToTransactions(inclusionList),
286+
witness: state.Witness(),
287+
evm: vm.NewEVM(core.NewEVMBlockContext(header, miner.chain, &coinbase), state, miner.chainConfig, vm.Config{}),
286288
}, nil
287289
}
288290

0 commit comments

Comments
 (0)