diff --git a/core/state_processor_test.go b/core/state_processor_test.go index dc9cb203bc..1c29ef39dc 100644 --- a/core/state_processor_test.go +++ b/core/state_processor_test.go @@ -481,7 +481,7 @@ func TestProcessVerkle(t *testing.T) { txCost1 := params.TxGas txCost2 := params.TxGas contractCreationCost := intrinsicContractCreationGas + uint64(2039 /* execution costs */) - codeWithExtCodeCopyGas := intrinsicCodeWithExtCodeCopyGas + uint64(293644 /* execution costs */) + codeWithExtCodeCopyGas := intrinsicCodeWithExtCodeCopyGas + uint64(179444 /* execution costs */) blockGasUsagesExpected := []uint64{ txCost1*2 + txCost2, txCost1*2 + txCost2 + contractCreationCost + codeWithExtCodeCopyGas, diff --git a/core/vm/evm.go b/core/vm/evm.go index 85474da08a..742ea86236 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -457,16 +457,10 @@ func (evm *EVM) create(caller ContractRef, codeAndHash *codeAndHash, gas uint64, return nil, common.Address{}, gas, ErrNonceUintOverflow } evm.StateDB.SetNonce(caller.Address(), nonce+1) -<<<<<<< HEAD // We add this to the access list _before_ taking a snapshot. Even if the // creation fails, the access-list change should not be rolled back. - if evm.chainRules.IsBerlin { -======= - // We add this to the access list _before_ taking a snapshot. Even if the creation fails, - // the access-list change should not be rolled back if evm.chainRules.IsEIP2929 { ->>>>>>> fc62f50eb (cmd, core, params, trie: Add verkle access witness) evm.StateDB.AddAddressToAccessList(address) } // Ensure there's no existing contract already at the designated address. diff --git a/eth/state_accessor.go b/eth/state_accessor.go index 372c76f496..9d43973429 100644 --- a/eth/state_accessor.go +++ b/eth/state_accessor.go @@ -237,7 +237,7 @@ func (eth *Ethereum) stateAtTransaction(ctx context.Context, block *types.Block, if beaconRoot := block.BeaconRoot(); beaconRoot != nil { context := core.NewEVMBlockContext(block.Header(), eth.blockchain, nil) vmenv := vm.NewEVM(context, vm.TxContext{}, statedb, eth.blockchain.Config(), vm.Config{}) - core.ProcessBeaconBlockRoot(*beaconRoot, vmenv, statedb) + core.ProcessBeaconBlockRoot(*beaconRoot, vmenv, statedb, block.Number(), block.Time()) } if txIndex == 0 && len(block.Transactions()) == 0 { return nil, vm.BlockContext{}, statedb, release, nil diff --git a/eth/tracers/api.go b/eth/tracers/api.go index d99531d48f..93f43a278a 100644 --- a/eth/tracers/api.go +++ b/eth/tracers/api.go @@ -381,7 +381,7 @@ func (api *API) traceChain(start, end *types.Block, config *TraceConfig, closed if beaconRoot := next.BeaconRoot(); beaconRoot != nil { context := core.NewEVMBlockContext(next.Header(), api.chainContext(ctx), nil) vmenv := vm.NewEVM(context, vm.TxContext{}, statedb, api.backend.ChainConfig(), vm.Config{}) - core.ProcessBeaconBlockRoot(*beaconRoot, vmenv, statedb) + core.ProcessBeaconBlockRoot(*beaconRoot, vmenv, statedb, vmenv.Context.BlockNumber, vmenv.Context.Time) } // Clean out any pending release functions of trace state. Note this // step must be done after constructing tracing state, because the @@ -533,7 +533,7 @@ func (api *API) IntermediateRoots(ctx context.Context, hash common.Hash, config ) if beaconRoot := block.BeaconRoot(); beaconRoot != nil { vmenv := vm.NewEVM(vmctx, vm.TxContext{}, statedb, chainConfig, vm.Config{}) - core.ProcessBeaconBlockRoot(*beaconRoot, vmenv, statedb) + core.ProcessBeaconBlockRoot(*beaconRoot, vmenv, statedb, vmenv.Context.BlockNumber, vmenv.Context.Time) } for i, tx := range block.Transactions() { if err := ctx.Err(); err != nil { @@ -612,7 +612,7 @@ func (api *API) traceBlock(ctx context.Context, block *types.Block, config *Trac ) if beaconRoot := block.BeaconRoot(); beaconRoot != nil { vmenv := vm.NewEVM(blockCtx, vm.TxContext{}, statedb, api.backend.ChainConfig(), vm.Config{}) - core.ProcessBeaconBlockRoot(*beaconRoot, vmenv, statedb) + core.ProcessBeaconBlockRoot(*beaconRoot, vmenv, statedb, vmenv.Context.BlockNumber, vmenv.Context.Time) } for i, tx := range txs { // Generate the next state snapshot fast without tracing @@ -770,7 +770,7 @@ func (api *API) standardTraceBlockToFile(ctx context.Context, block *types.Block } if beaconRoot := block.BeaconRoot(); beaconRoot != nil { vmenv := vm.NewEVM(vmctx, vm.TxContext{}, statedb, chainConfig, vm.Config{}) - core.ProcessBeaconBlockRoot(*beaconRoot, vmenv, statedb) + core.ProcessBeaconBlockRoot(*beaconRoot, vmenv, statedb, vmenv.Context.BlockNumber, vmenv.Context.Time) } for i, tx := range block.Transactions() { // Prepare the transaction for un-traced execution