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
|
|
@ -54,11 +54,12 @@ type environment struct {
|
||||||
coinbase common.Address
|
coinbase common.Address
|
||||||
evm *vm.EVM
|
evm *vm.EVM
|
||||||
|
|
||||||
header *types.Header
|
header *types.Header
|
||||||
txs []*types.Transaction
|
txs []*types.Transaction
|
||||||
receipts []*types.Receipt
|
receipts []*types.Receipt
|
||||||
sidecars []*types.BlobTxSidecar
|
sidecars []*types.BlobTxSidecar
|
||||||
blobs int
|
blobs int
|
||||||
|
inclusionListTxs []*types.Transaction
|
||||||
|
|
||||||
witness *stateless.Witness
|
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.
|
// Could potentially happen if starting to mine in an odd state.
|
||||||
// Note genParams.coinbase can be different with header.Coinbase
|
// Note genParams.coinbase can be different with header.Coinbase
|
||||||
// since clique algorithm can modify the coinbase field in header.
|
// 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 {
|
if err != nil {
|
||||||
log.Error("Failed to create sealing context", "err", err)
|
log.Error("Failed to create sealing context", "err", err)
|
||||||
return nil, 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.
|
// 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.
|
// Retrieve the parent state to execute on top.
|
||||||
state, err := miner.chain.StateAt(parent.Root)
|
state, err := miner.chain.StateAt(parent.Root)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -276,13 +277,14 @@ func (miner *Miner) makeEnv(parent *types.Header, header *types.Header, coinbase
|
||||||
}
|
}
|
||||||
// Note the passed coinbase may be different with header.Coinbase.
|
// Note the passed coinbase may be different with header.Coinbase.
|
||||||
return &environment{
|
return &environment{
|
||||||
signer: types.MakeSigner(miner.chainConfig, header.Number, header.Time),
|
signer: types.MakeSigner(miner.chainConfig, header.Number, header.Time),
|
||||||
state: state,
|
state: state,
|
||||||
size: uint64(header.Size()),
|
size: uint64(header.Size()),
|
||||||
coinbase: coinbase,
|
coinbase: coinbase,
|
||||||
header: header,
|
header: header,
|
||||||
witness: state.Witness(),
|
inclusionListTxs: types.InclusionListToTransactions(inclusionList),
|
||||||
evm: vm.NewEVM(core.NewEVMBlockContext(header, miner.chain, &coinbase), state, miner.chainConfig, vm.Config{}),
|
witness: state.Witness(),
|
||||||
|
evm: vm.NewEVM(core.NewEVMBlockContext(header, miner.chain, &coinbase), state, miner.chainConfig, vm.Config{}),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue