From 847382ea371e214bac1029658f8874c97c1dd9aa Mon Sep 17 00:00:00 2001 From: Tyler Smith Date: Tue, 5 Mar 2024 15:03:49 -0400 Subject: [PATCH] fix: nil pointer deref. --- core/state_processor.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/state_processor.go b/core/state_processor.go index afa309ca87a1..9d426a6d4a70 100644 --- a/core/state_processor.go +++ b/core/state_processor.go @@ -259,7 +259,16 @@ func ApplyUnsignedTransactionWithResult(config *params.ChainConfig, bc ChainCont // Create a new context to be used in the EVM environment blockContext := NewEVMBlockContext(header, bc, author) - vmenv := vm.NewEVM(blockContext, vm.TxContext{}, statedb, config, vm.Config{Tracer: tracer, NoBaseFee: true}) + txContext := vm.TxContext{ + Origin: msg.From, + GasPrice: msg.GasPrice, + BlobHashes: msg.BlobHashes, + BlobFeeCap: msg.BlobGasFeeCap, + } + if txContext.GasPrice == nil { + txContext.GasPrice = common.Big0 + } + vmenv := vm.NewEVM(blockContext, txContext, statedb, config, vm.Config{Tracer: tracer, NoBaseFee: true}) return applyTransactionWithResult(msg, config, bc, author, gp, statedb, header, msg, usedGas, vmenv, tracer) }