From 76dc0c7b934214f52400d34aed39de2dc0c10299 Mon Sep 17 00:00:00 2001 From: Darioush Jalali Date: Mon, 24 Feb 2025 20:02:49 -0800 Subject: [PATCH] fix(core/evm): set difficulty post shanghai to 0 --- core/evm.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/evm.go b/core/evm.go index 8f9559b44c..67402744a0 100644 --- a/core/evm.go +++ b/core/evm.go @@ -54,7 +54,7 @@ type hooks struct{} // It allows for the modification of the EVM arguments before the EVM is created. // Specifically, we set Random to be the same as Difficulty since Shanghai. // This allows using the same jump table as upstream. -// Then we set Difficulty to nil as it is post Merge in upstream. +// Then we set Difficulty to 0 as it is post Merge in upstream. // Additionally we wrap the StateDB with the appropriate StateDB wrapper, // which is used in coreth to process historical pre-AP1 blocks with the // GetCommittedState method as it was historically. @@ -65,7 +65,7 @@ func (hooks) OverrideNewEVMArgs(args *vm.NewEVMArgs) *vm.NewEVMArgs { if rules.IsShanghai { args.BlockContext.Random = new(common.Hash) args.BlockContext.Random.SetBytes(args.BlockContext.Difficulty.Bytes()) - args.BlockContext.Difficulty = nil + args.BlockContext.Difficulty = new(big.Int) } return args