Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
62919d7
all: remove Message interface
chiphamskymavis Apr 24, 2025
3eea103
core: renaming isFake to skipAccountChecks
chiphamskymavis Apr 25, 2025
17811bb
all: expose message fields to remove getter func
chiphamskymavis Apr 25, 2025
b04e96f
simulate: call apply message for short
chiphamskymavis Apr 28, 2025
39423a0
light: remove unused callmsg struct
chiphamskymavis Apr 28, 2025
5345872
core: refactor TransactionToMessage to use NewMessage constructor
chiphamskymavis Apr 28, 2025
b9e0956
ci: update job name in EVM tests
chiphamskymavis Apr 28, 2025
1a65a0e
core: enhance TransactionToMessage to include ExpiredTime field
chiphamskymavis Apr 28, 2025
23a0401
core: update NewMessage constructor to include SetCodeAuthorizations
chiphamskymavis Jun 30, 2025
a471a5e
core: rename TransactionToMessage function for clarity
chiphamskymavis Jun 30, 2025
161032d
core: update TransactionToMessage to utilize SetCodeAuthorizations
chiphamskymavis Jun 30, 2025
7a27a68
core/tracing: add hooks for live tracing of block processing and tran…
chiphamskymavis May 5, 2025
7a67d14
core: add VM new tracing support with new configuration options
chiphamskymavis May 7, 2025
db7b13c
core/state: add tracing hook to state db and state object (#73)
sonhv0212 May 13, 2025
6825741
core/state: add BalanceChangeReason to state db and state object (#74)
sonhv0212 May 14, 2025
d1ce73b
core: state transition, processor, evm support live tracer (#75)
sonhv0212 May 14, 2025
fdcf035
core: blockchain supports live tracer (#77)
sonhv0212 May 14, 2025
753f2be
all: replace the older tracer by live tracer (#78)
sonhv0212 May 16, 2025
b852a6c
core, tests: add missing usages of live tracer in blockchain and stat…
sonhv0212 May 17, 2025
13cdcac
eth/tracer/live: add supply live tracer (#84)
sonhv0212 May 19, 2025
df1f9cf
core, eth/tracers: move chainconfig to tracers and some refactors (#86)
sonhv0212 May 20, 2025
16895e2
evm: remove EVMLogger interface (#91)
chiphamskymavis May 27, 2025
9515d2e
core: minor cleanup in stateDB and Call (#96)
sonhv0212 Jun 2, 2025
952cdf6
core/vm: update gas usage to use Tracer instead of LiveTracer in EIP-…
chiphamskymavis Jul 1, 2025
0f3cb84
eth/tracers/internal/tracetest: disable KotaroBlock in pre-Cancun tests
sonhv0212 Jul 1, 2025
9872c6a
core/vm/runtime: fix type error
sonhv0212 Jul 1, 2025
363fbe4
core/tracing: extends tracing.Hooks with OnSystemCallStartV2 (#30786)
sonhv0212 Jul 1, 2025
c75aeda
core: capture on gas change when applying eip-7623
sonhv0212 Jul 1, 2025
2ff8d81
all: remove Message interface
chiphamskymavis Apr 24, 2025
2b85945
core/state: add BalanceChangeReason to state db and state object (#74)
sonhv0212 May 14, 2025
3fdc126
core: state transition, processor, evm support live tracer (#75)
sonhv0212 May 14, 2025
0ea4af8
all: replace the older tracer by live tracer (#78)
sonhv0212 May 16, 2025
6d9d28c
internal/ethapi: eth_multicall (#27720)
chiphamskymavis May 20, 2025
9cd6a1e
core/vm: init precompile logic, update tests
chiphamskymavis May 20, 2025
510ae89
core/vm: init precompile logic, update tests
chiphamskymavis May 20, 2025
45044a7
gethclient: update block overwrite json
chiphamskymavis May 20, 2025
2ed32d3
ethapi: move validation from ToMessage to CallDefault
chiphamskymavis May 20, 2025
ce138dd
ethapi: remove un-used fee logic
chiphamskymavis May 21, 2025
fe7e253
ci: try enable test report
chiphamskymavis May 21, 2025
0b03afc
internal/ethapi/api: for simulated calls, set gaspool to max value if…
jwasinger Sep 23, 2024
34b3f17
core/types: remove redundance hashes
chiphamskymavis May 26, 2025
bd72592
ethapi: correct simulate blocktime to 3s
chiphamskymavis May 26, 2025
6c99822
ethapi: add tests for simulate
chiphamskymavis May 26, 2025
0d20097
genesis: support nil balance when init genesis
chiphamskymavis May 27, 2025
f584e06
eth/api: remove err unmarshal block rpc
chiphamskymavis May 27, 2025
55e8e10
simulate: apply evm txcontext, fix state hook
chiphamskymavis May 27, 2025
e70254b
internal/ethapi: fix simulate tests related to gas, base fee (#95)
sonhv0212 May 28, 2025
86efb67
core: remove redundant receipt bloom
chiphamskymavis May 28, 2025
6788852
eth: lower blob basefee for gasestimator
chiphamskymavis May 28, 2025
0325966
eth, internal: remove err in transaction to msg func
chiphamskymavis May 28, 2025
b219069
core: remove receipt generator
chiphamskymavis May 28, 2025
3242e42
simulate: skip system transactions during simulation when signTxFn is…
chiphamskymavis Jun 20, 2025
50efe71
ethapi: update gas used values in simulation tests for accuracy
chiphamskymavis Jul 2, 2025
966f9be
ci: trigger build nightly for simulate
chiphamskymavis Jul 8, 2025
657418c
eth: Fix movePrecompileToAddress ignored on debug_traceCall (#114)
chiphamskymavis Jul 9, 2025
dbe2d7d
eth/tracers: set logger hooks for stateDB (#115)
chiphamskymavis Jul 15, 2025
d6b26a4
cmd: add vm trace flags
sonhv0212 Jul 17, 2025
2f48d41
eth: add tracer initialization
sonhv0212 Jul 18, 2025
31ed508
cmd: init live tracer
sonhv0212 Jul 18, 2025
61aaacc
internal/ethapi: remove hard code timeout
sonhv0212 Aug 11, 2025
1131834
ci: revert custom actions
trantienduchn Aug 11, 2025
485fe81
ci: revert custom trigger condition
trantienduchn Aug 11, 2025
14c8856
ethapi: remove duplicated code
TuDo1403 Aug 12, 2025
a27851f
consensus,ethapi: remove skip system tx when simulate, remove unused …
TuDo1403 Aug 14, 2025
4b91587
ci: trigger build nightly for simulate
TuDo1403 Aug 14, 2025
f360edb
internal/ethapi: process EIP-2935 in simulation
sonhv0212 Aug 18, 2025
966517c
ci: revert build nightly
TuDo1403 Aug 19, 2025
f8c73a5
internal/ethapi: use skipChecks in applyMessage()
trantienduchn Aug 27, 2025
80e52b0
internal/ethapi: use vmConfig
trantienduchn Aug 27, 2025
40cdc59
eth/gasestimator: use gasLimit
trantienduchn Aug 27, 2025
645f205
internal/ethapi: fix test fails
trantienduchn Aug 27, 2025
62d2500
internal/ethapi: resolve comments
trantienduchn Aug 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/evm-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

jobs:
state-test:
name: Run State Tests
name: Run EVM Tests
strategy:
matrix:
go-version: [1.22.x]
Expand Down
49 changes: 21 additions & 28 deletions accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import (
"github.com/ethereum/go-ethereum/core/bloombits"
"github.com/ethereum/go-ethereum/core/rawdb"
"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/eth/filters"
Expand Down Expand Up @@ -620,9 +621,26 @@ func (b *SimulatedBackend) callContract(ctx context.Context, call ethereum.CallM
}
// Set infinite balance to the fake caller account.
from := stateDB.GetOrNewStateObject(call.From)
from.SetBalance(math.MaxBig256)
from.SetBalance(math.MaxBig256, tracing.BalanceChangeUnspecified)

// Execute the call.
msg := callMsg{call}
msg := core.NewMessage(
call.From,
call.To,
0,
call.Value,
call.Gas,
call.GasPrice,
call.GasFeeCap,
call.GasTipCap,
call.Data,
call.AccessList,
// Skip nonce check for simulated backend
true,
nil,
nil,
nil,
)

txContext := core.NewEVMTxContext(msg)
evmContext := core.NewEVMBlockContext(block.Header(), b.blockchain, nil)
Expand All @@ -631,7 +649,7 @@ func (b *SimulatedBackend) callContract(ctx context.Context, call ethereum.CallM
vmEnv := vm.NewEVM(evmContext, txContext, stateDB, b.config, vm.Config{NoBaseFee: true})
gasPool := new(core.GasPool).AddGas(math.MaxUint64)

return core.NewStateTransition(vmEnv, msg, gasPool).TransitionDb()
return core.ApplyMessage(vmEnv, msg, gasPool)
}

// SendTransaction updates the pending block to include the given transaction.
Expand Down Expand Up @@ -795,31 +813,6 @@ func (b *SimulatedBackend) Blockchain() *core.BlockChain {
return b.blockchain
}

// callMsg implements core.Message to allow passing it as a transaction simulator.
type callMsg struct {
ethereum.CallMsg
}

func (m callMsg) From() common.Address { return m.CallMsg.From }
func (m callMsg) Nonce() uint64 { return 0 }
func (m callMsg) IsFake() bool { return true }
func (m callMsg) To() *common.Address { return m.CallMsg.To }
func (m callMsg) GasPrice() *big.Int { return m.CallMsg.GasPrice }
func (m callMsg) GasFeeCap() *big.Int { return m.CallMsg.GasFeeCap }
func (m callMsg) GasTipCap() *big.Int { return m.CallMsg.GasTipCap }
func (m callMsg) Gas() uint64 { return m.CallMsg.Gas }
func (m callMsg) Value() *big.Int { return m.CallMsg.Value }
func (m callMsg) Data() []byte { return m.CallMsg.Data }
func (m callMsg) AccessList() types.AccessList { return m.CallMsg.AccessList }
func (m callMsg) SetCodeAuthorizations() []types.SetCodeAuthorization { return nil }

// FIXME: support sponsored transaction in callMsg
func (m callMsg) Payer() common.Address { return m.CallMsg.From }
func (m callMsg) ExpiredTime() uint64 { return 0 }

func (m callMsg) BlobHashes() []common.Hash { return nil }
func (m callMsg) BlobGasFeeCap() *big.Int { return nil }

// filterBackend implements filters.Backend to support filtering for logs without
// taking bloom-bits acceleration structures into account.
type filterBackend struct {
Expand Down
23 changes: 14 additions & 9 deletions cmd/evm/internal/t8ntool/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package t8ntool

import (
"fmt"
"io"
"math/big"
"os"

Expand All @@ -28,9 +29,11 @@ import (
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/rawdb"
"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"
"github.com/ethereum/go-ethereum/eth/tracers"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/params"
Expand Down Expand Up @@ -97,7 +100,7 @@ type rejectedTx struct {
// Apply applies a set of transactions to a pre-state
func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
txs types.Transactions, miningReward int64,
getTracerFn func(txIndex int, txHash common.Hash) (tracer vm.EVMLogger, err error),
getTracerFn func(txIndex int, txHash common.Hash) (*tracers.Tracer, io.WriteCloser, error),
) (*state.StateDB, *ExecutionResult, error) {
// Capture errors for BLOCKHASH operation, if we haven't been supplied the
// required blockhashes
Expand Down Expand Up @@ -148,17 +151,19 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
}

for i, tx := range txs {
msg, err := tx.AsMessage(signer, pre.Env.BaseFee)
msg, err := core.TransactionToMessage(tx, signer, pre.Env.BaseFee)
if err != nil {
log.Warn("rejected tx", "index", i, "hash", tx.Hash(), "error", err)
rejectedTxs = append(rejectedTxs, &rejectedTx{i, err.Error()})
continue
}
tracer, err := getTracerFn(txIndex, tx.Hash())
tracer, _, err := getTracerFn(txIndex, tx.Hash())
if err != nil {
return nil, nil, err
}
vmConfig.Tracer = tracer
if tracer != nil {
vmConfig.Tracer = tracer.Hooks
}
vmConfig.Debug = (tracer != nil)
statedb.SetTxContext(tx.Hash(), txIndex)
txContext := core.NewEVMTxContext(msg)
Expand All @@ -169,7 +174,7 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
msgResult, err := core.ApplyMessage(evm, msg, gaspool)
if err != nil {
statedb.RevertToSnapshot(snapshot)
log.Info("rejected tx", "index", i, "hash", tx.Hash(), "from", msg.From(), "error", err)
log.Info("rejected tx", "index", i, "hash", tx.Hash(), "from", msg.From, "error", err)
rejectedTxs = append(rejectedTxs, &rejectedTx{i, err.Error()})
continue
}
Expand Down Expand Up @@ -200,7 +205,7 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
receipt.GasUsed = msgResult.UsedGas

// If the transaction created a contract, store the creation address in the receipt.
if msg.To() == nil {
if msg.To == nil {
receipt.ContractAddress = crypto.CreateAddress(evm.TxContext.Origin, tx.Nonce())
}

Expand Down Expand Up @@ -238,9 +243,9 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
reward.Sub(reward, big.NewInt(0).SetUint64(ommer.Delta))
reward.Mul(reward, blockReward)
reward.Div(reward, big.NewInt(8))
statedb.AddBalance(ommer.Address, reward)
statedb.AddBalance(ommer.Address, reward, tracing.BalanceIncreaseRewardMineUncle)
}
statedb.AddBalance(pre.Env.Coinbase, minerReward)
statedb.AddBalance(pre.Env.Coinbase, minerReward, tracing.BalanceIncreaseRewardMineBlock)
}
// Commit block
root, err := statedb.Commit(vmContext.BlockNumber.Uint64(), chainConfig.IsEIP158(vmContext.BlockNumber))
Expand Down Expand Up @@ -274,7 +279,7 @@ func MakePreState(db ethdb.Database, accounts types.GenesisAlloc) *state.StateDB
for addr, a := range accounts {
statedb.SetCode(addr, a.Code)
statedb.SetNonce(addr, a.Nonce)
statedb.SetBalance(addr, a.Balance)
statedb.SetBalance(addr, a.Balance, tracing.BalanceIncreaseGenesisBalance)
for k, v := range a.Storage {
statedb.SetState(addr, k, v)
}
Expand Down
36 changes: 17 additions & 19 deletions cmd/evm/internal/t8ntool/transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,15 @@ import (
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
"math/big"
"os"
"path"
"path/filepath"
"strings"

"github.com/ethereum/go-ethereum/eth/tracers"
"github.com/ethereum/go-ethereum/eth/tracers/logger"

"github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -91,10 +94,9 @@ func Transition(ctx *cli.Context) error {
log.Root().SetHandler(glogger)

var (
err error
tracer vm.EVMLogger
err error
)
var getTracer func(txIndex int, txHash common.Hash) (vm.EVMLogger, error)
var getTracer = func(txIndex int, txHash common.Hash) (*tracers.Tracer, io.WriteCloser, error) { return nil, nil, nil }

baseDir, err := createBasedir(ctx)
if err != nil {
Expand Down Expand Up @@ -127,20 +129,19 @@ func Transition(ctx *cli.Context) error {
prevFile.Close()
}
}()
getTracer = func(txIndex int, txHash common.Hash) (vm.EVMLogger, error) {
if prevFile != nil {
prevFile.Close()
}
traceFile, err := os.Create(path.Join(baseDir, fmt.Sprintf("trace-%d-%v.jsonl", txIndex, txHash.String())))
getTracer = func(txIndex int, txHash common.Hash) (*tracers.Tracer, io.WriteCloser, error) {
traceFile, err := os.Create(filepath.Join(baseDir, fmt.Sprintf("trace-%d-%v.jsonl", txIndex, txHash.String())))
if err != nil {
return nil, NewError(ErrorIO, fmt.Errorf("failed creating trace-file: %v", err))
return nil, nil, NewError(ErrorIO, fmt.Errorf("failed creating trace-file: %v", err))
}
prevFile = traceFile
return logger.NewJSONLogger(logConfig, traceFile), nil
}
} else {
getTracer = func(txIndex int, txHash common.Hash) (tracer vm.EVMLogger, err error) {
return nil, nil
logger := logger.NewJSONLogger(logConfig, traceFile)
tracer := &tracers.Tracer{
Hooks: logger,
// jsonLogger streams out result to file.
GetResult: func() (json.RawMessage, error) { return nil, nil },
Stop: func(err error) {},
}
return tracer, traceFile, nil
}
}
// We need to load three things: alloc, env and transactions. May be either in
Expand Down Expand Up @@ -179,10 +180,7 @@ func Transition(ctx *cli.Context) error {
}
prestate.Env = *inputData.Env

vmConfig := vm.Config{
Tracer: tracer,
Debug: (tracer != nil),
}
vmConfig := vm.Config{}
// Construct the chainconfig
var chainConfig *params.ChainConfig
if cConf, extraEips, err := tests.GetChainConfig(ctx.String(ForknameFlag.Name)); err != nil {
Expand Down
5 changes: 3 additions & 2 deletions cmd/evm/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import (
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/rawdb"
"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/core/vm/runtime"
Expand Down Expand Up @@ -122,7 +123,7 @@ func runCmd(ctx *cli.Context) error {
}

var (
tracer vm.EVMLogger
tracer *tracing.Hooks
debugLogger *logger.StructLogger
statedb *state.StateDB
chainConfig *params.ChainConfig
Expand All @@ -134,7 +135,7 @@ func runCmd(ctx *cli.Context) error {
tracer = logger.NewJSONLogger(logconfig, os.Stdout)
} else if ctx.Bool(DebugFlag.Name) {
debugLogger = logger.NewStructLogger(logconfig)
tracer = debugLogger
tracer = debugLogger.Hooks()
} else {
debugLogger = logger.NewStructLogger(logconfig)
}
Expand Down
5 changes: 3 additions & 2 deletions cmd/evm/staterunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/state/snapshot"
"github.com/ethereum/go-ethereum/core/tracing"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/tests"
Expand Down Expand Up @@ -68,7 +69,7 @@ func stateTestCmd(ctx *cli.Context) error {
EnableReturnData: !ctx.Bool(DisableReturnDataFlag.Name),
}
var (
tracer vm.EVMLogger
tracer *tracing.Hooks
debugger *logger.StructLogger
)
switch {
Expand All @@ -77,7 +78,7 @@ func stateTestCmd(ctx *cli.Context) error {

case ctx.Bool(DebugFlag.Name):
debugger = logger.NewStructLogger(config)
tracer = debugger
tracer = debugger.Hooks()

default:
debugger = logger.NewStructLogger(config)
Expand Down
3 changes: 3 additions & 0 deletions cmd/ronin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import (

// Force-load the tracer engines to trigger registration
_ "github.com/ethereum/go-ethereum/eth/tracers/js"
_ "github.com/ethereum/go-ethereum/eth/tracers/live"
_ "github.com/ethereum/go-ethereum/eth/tracers/native"

"github.com/urfave/cli/v2"
Expand Down Expand Up @@ -164,6 +165,8 @@ var (
utils.RinkebyFlag,
utils.GoerliFlag,
utils.VMEnableDebugFlag,
utils.VMTraceFlag,
utils.VMTraceConfigFlag,
utils.NetworkIdFlag,
utils.EthStatsURLFlag,
utils.FakePoWFlag,
Expand Down
31 changes: 29 additions & 2 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package utils

import (
"crypto/ecdsa"
"encoding/json"
"fmt"
"io/ioutil"
"math"
Expand Down Expand Up @@ -641,6 +642,17 @@ var (
Usage: "Record information useful for VM and contract debugging",
Category: flags.VMCategory,
}
VMTraceFlag = &cli.StringFlag{
Name: "vmtrace",
Usage: "Name of tracer which should record internal VM operations (costly)",
Category: flags.VMCategory,
}
VMTraceConfigFlag = &cli.StringFlag{
Name: "vmtrace.config",
Usage: "Tracer configuration (JSON)",
Value: "{}",
Category: flags.VMCategory,
}
RPCGlobalGasCapFlag = &cli.Uint64Flag{
Name: "rpc.gascap",
Usage: "Sets a cap on gas that can be used in eth_call/estimateGas (0=infinite)",
Expand Down Expand Up @@ -1349,7 +1361,6 @@ func setWS(ctx *cli.Context, cfg *node.Config) {

cfg.WSReadBuffer = ctx.Int(WSReadBufferFlag.Name)
cfg.WSWriteBuffer = ctx.Int(WSWriteBufferFlag.Name)

}

// setIPC creates an IPC path configuration from the set command line flags,
Expand Down Expand Up @@ -2134,6 +2145,13 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
if err := kzg4844.UseCKZG(ctx.String(CryptoKZGFlag.Name) == "ckzg"); err != nil {
Fatalf("Failed to set KZG library implementation to %s: %v", ctx.String(CryptoKZGFlag.Name), err)
}
// VM tracing config.
if ctx.IsSet(VMTraceFlag.Name) {
if name := ctx.String(VMTraceFlag.Name); name != "" {
cfg.VMTrace = name
cfg.VMTraceConfig = ctx.String(VMTraceConfigFlag.Name)
}
}
if ctx.IsSet(DisableTxBroadcastFromFlag.Name) {
scheme := enode.V4ID{}
nodeIds := SplitAndTrim(ctx.String(DisableTxBroadcastFromFlag.Name))
Expand Down Expand Up @@ -2404,7 +2422,16 @@ func MakeChain(ctx *cli.Context, stack *node.Node) (chain *core.BlockChain, chai
cache.TrieDirtyLimit = ctx.Int(CacheFlag.Name) * ctx.Int(CacheGCFlag.Name) / 100
}
vmcfg := vm.Config{EnablePreimageRecording: ctx.Bool(VMEnableDebugFlag.Name)}

if ctx.IsSet(VMTraceFlag.Name) {
if name := ctx.String(VMTraceFlag.Name); name != "" {
config := json.RawMessage(ctx.String(VMTraceConfigFlag.Name))
t, err := tracers.LiveDirectory.New(name, config)
if err != nil {
Fatalf("Failed to create tracer %q: %v", name, err)
}
vmcfg.Tracer = t
}
}
// TODO(rjl493456442) disable snapshot generation/wiping if the chain is read only.
// Disable transaction indexing/unindexing by default.
chain, err = core.NewBlockChain(chainDb, cache, gpec, nil, engine, vmcfg, nil, nil)
Expand Down
Loading