fix rebase issues

This commit is contained in:
Guillaume Ballet 2024-04-24 21:44:31 +02:00
parent 2334cb7275
commit 811ebfeb08
4 changed files with 6 additions and 12 deletions

View file

@ -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,

View file

@ -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.

View file

@ -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

View file

@ -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