Pass vm.Config to ExecuteStateless

This commit is contained in:
Michael de Hoog 2024-10-31 15:07:44 -10:00
parent 25bc07749c
commit fc97a35519
No known key found for this signature in database
GPG key ID: 8ADF8244AA888446
3 changed files with 4 additions and 4 deletions

View file

@ -1926,7 +1926,7 @@ func (bc *BlockChain) processBlock(block *types.Block, statedb *state.StateDB, s
task := types.NewBlockWithHeader(context).WithBody(*block.Body())
// Run the stateless self-cross-validation
crossStateRoot, crossReceiptRoot, err := ExecuteStateless(bc.chainConfig, task, witness)
crossStateRoot, crossReceiptRoot, err := ExecuteStateless(bc.chainConfig, task, witness, vm.Config{})
if err != nil {
return nil, fmt.Errorf("stateless self-validation failed: %v", err)
}

View file

@ -40,7 +40,7 @@ import (
// - It cannot be placed outside of core, because it needs to construct a dud headerchain
//
// TODO(karalabe): Would be nice to resolve both issues above somehow and move it.
func ExecuteStateless(config *params.ChainConfig, block *types.Block, witness *stateless.Witness) (common.Hash, common.Hash, error) {
func ExecuteStateless(config *params.ChainConfig, block *types.Block, witness *stateless.Witness, cfg vm.Config) (common.Hash, common.Hash, error) {
// Sanity check if the supplied block accidentally contains a set root or
// receipt hash. If so, be very loud, but still continue.
if block.Root() != (common.Hash{}) {
@ -66,7 +66,7 @@ func ExecuteStateless(config *params.ChainConfig, block *types.Block, witness *s
validator := NewBlockValidator(config, nil) // No chain, we only validate the state, not the block
// Run the stateless blocks processing and self-validate certain fields
res, err := processor.Process(block, db, vm.Config{})
res, err := processor.Process(block, db, cfg)
if err != nil {
return common.Hash{}, common.Hash{}, err
}

View file

@ -995,7 +995,7 @@ func (api *ConsensusAPI) executeStatelessPayload(params engine.ExecutableData, v
api.lastNewPayloadLock.Unlock()
log.Trace("Executing block statelessly", "number", block.Number(), "hash", params.BlockHash)
stateRoot, receiptRoot, err := core.ExecuteStateless(api.eth.BlockChain().Config(), block, witness)
stateRoot, receiptRoot, err := core.ExecuteStateless(api.eth.BlockChain().Config(), block, witness, *api.eth.BlockChain().GetVMConfig())
if err != nil {
log.Warn("ExecuteStatelessPayload: execution failed", "err", err)
errorMsg := err.Error()