Use the passed VMConfig (#1141)

* Use the passed VMConfig

* Explicitly pass the vmConfig into runBlock
This commit is contained in:
Horacio Mijail Antón Quiles 2020-09-28 06:31:49 +10:00 committed by GitHub
parent f33ddec7ab
commit 252863fedf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

View File

@ -76,7 +76,7 @@ func CheckChangeSets(genesis *core.Genesis, blockNum uint64, chaindata string, h
blockWriter = csw
}
receipts, err1 := runBlock(intraBlockState, noOpWriter, blockWriter, chainConfig, bc, block)
receipts, err1 := runBlock(intraBlockState, noOpWriter, blockWriter, chainConfig, bc, block, vmConfig)
if err1 != nil {
return err1
}

View File

@ -40,10 +40,9 @@ var chartColors = []drawing.Color{
}
func runBlock(ibs *state.IntraBlockState, txnWriter state.StateWriter, blockWriter state.StateWriter,
chainConfig *params.ChainConfig, bcb core.ChainContext, block *types.Block,
) (types.Receipts, error) {
chainConfig *params.ChainConfig, bcb core.ChainContext, block *types.Block, vmConfig vm.Config) (types.Receipts, error) {
header := block.Header()
vmConfig := vm.Config{TraceJumpDest: true}
vmConfig.TraceJumpDest = true
engine := ethash.NewFullFaker()
gp := new(core.GasPool).AddGas(block.GasLimit())
usedGas := new(uint64)
@ -399,7 +398,7 @@ func Stateless(
ibs := state.New(s)
ibs.SetTrace(trace)
s.SetBlockNr(blockNum)
if _, err = runBlock(ibs, s, s, chainConfig, blockProvider, block); err != nil {
if _, err = runBlock(ibs, s, s, chainConfig, blockProvider, block, vmConfig); err != nil {
fmt.Printf("Error running block %d through stateless2: %v\n", blockNum, err)
finalRootFail = true
} else if !binary {