From 6c516843dda8b45c58abece832622309ab90b6af Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi Date: Wed, 20 Mar 2024 16:53:13 +0100 Subject: [PATCH] minor improvements --- core/blockchain.go | 1 + core/state_processor.go | 10 +--------- core/state_transition.go | 3 --- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index ee230123cd..e5c54adeba 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1834,6 +1834,7 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool) (int, error) throwaway, _ := state.New(parent.Root, bc.stateCache, bc.snaps) go func(start time.Time, followup *types.Block, throwaway *state.StateDB) { + // Disable tracing for prefetcher executions. vmCfg := bc.vmConfig vmCfg.Tracer = nil bc.prefetcher.Prefetch(followup, throwaway, vmCfg, &followupInterrupt) diff --git a/core/state_processor.go b/core/state_processor.go index 59e3c80c2a..188fb903e3 100644 --- a/core/state_processor.go +++ b/core/state_processor.go @@ -25,7 +25,6 @@ import ( "github.com/ethereum/go-ethereum/consensus" "github.com/ethereum/go-ethereum/consensus/misc" "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/tracing" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/crypto" @@ -112,14 +111,7 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg // this method takes an already created EVM instance as input. func ApplyTransactionWithEVM(msg *Message, config *params.ChainConfig, gp *GasPool, statedb *state.StateDB, blockNumber *big.Int, blockHash common.Hash, tx *types.Transaction, usedGas *uint64, evm *vm.EVM) (receipt *types.Receipt, err error) { if evm.Config.Tracer != nil && evm.Config.Tracer.OnTxStart != nil { - evm.Config.Tracer.OnTxStart(&tracing.VMContext{ - ChainConfig: evm.ChainConfig(), - StateDB: statedb, - BlockNumber: evm.Context.BlockNumber, - Time: evm.Context.Time, - Coinbase: evm.Context.Coinbase, - Random: evm.Context.Random, - }, tx, msg.From) + evm.Config.Tracer.OnTxStart(evm.GetVMContext(), tx, msg.From) if evm.Config.Tracer.OnTxEnd != nil { defer func() { evm.Config.Tracer.OnTxEnd(receipt, err) diff --git a/core/state_transition.go b/core/state_transition.go index b908adeb4c..173bf2fc67 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -139,8 +139,6 @@ type Message struct { AccessList types.AccessList BlobGasFeeCap *big.Int BlobHashes []common.Hash - // Distinguishes type-2 txes - DynamicFee bool // When SkipAccountChecks is true, the message nonce is not checked against the // account nonce in state. It also disables checking that the sender is an EOA. @@ -163,7 +161,6 @@ func TransactionToMessage(tx *types.Transaction, s types.Signer, baseFee *big.In SkipAccountChecks: false, BlobHashes: tx.BlobHashes(), BlobGasFeeCap: tx.BlobGasFeeCap(), - DynamicFee: tx.Type() == 2 || tx.Type() == 3, } // If baseFee provided, set gasPrice to effectiveGasPrice. if baseFee != nil {