Merge pull request #54 from sei-protocol/tony/refactor-statedb-trace

set txCtx upfront
This commit is contained in:
codchen 2025-05-30 11:53:40 +08:00 committed by GitHub
commit ee49395d63
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -22,7 +22,6 @@ import (
"encoding/json"
"errors"
"fmt"
"math/big"
"os"
"runtime"
"strings"
@ -1035,7 +1034,8 @@ func (api *API) traceTx(ctx context.Context, tx *types.Transaction, message *cor
return nil, err
}
}
vmenv := vm.NewEVM(vmctx, vm.TxContext{GasPrice: big.NewInt(0)}, statedb, api.backend.ChainConfig(), vm.Config{Tracer: tracer.Hooks, NoBaseFee: true}, api.backend.GetCustomPrecompiles(vmctx.BlockNumber.Int64()))
txCtx := core.NewEVMTxContext(message)
vmenv := vm.NewEVM(vmctx, txCtx, statedb, api.backend.ChainConfig(), vm.Config{Tracer: tracer.Hooks}, api.backend.GetCustomPrecompiles(vmctx.BlockNumber.Int64()))
statedb.SetLogger(tracer.Hooks)
// Define a meaningful timeout of a single transaction trace