From 882d1e22f66521d62ecdfe4566fb419765d744cf Mon Sep 17 00:00:00 2001 From: Chris Ziogas Date: Wed, 24 Apr 2024 08:53:16 +0300 Subject: [PATCH] cmd/geth, cmd/utils: rename config and flag to` VMTraceJsonConfig` (#29573) renames the yaml config field VMTraceConfig to VMTraceJsonConfig, in order to be consistent with the renaming of the CLI flag. --- cmd/geth/chaincmd.go | 2 +- cmd/geth/main.go | 2 +- cmd/utils/flags.go | 12 ++++++------ eth/backend.go | 4 ++-- eth/ethconfig/config.go | 4 ++-- eth/ethconfig/gen_config.go | 10 +++++----- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index dc45661eaecb..d787f340a38b 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -100,7 +100,7 @@ if one is set. Otherwise it prints the genesis from the datadir.`, utils.MetricsInfluxDBOrganizationFlag, utils.TxLookupLimitFlag, utils.VMTraceFlag, - utils.VMTraceConfigFlag, + utils.VMTraceJsonConfigFlag, utils.TransactionHistoryFlag, utils.StateHistoryFlag, }, utils.DatabaseFlags), diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 37b99a2621b3..b7885608bc17 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -137,7 +137,7 @@ var ( utils.DeveloperPeriodFlag, utils.VMEnableDebugFlag, utils.VMTraceFlag, - utils.VMTraceConfigFlag, + utils.VMTraceJsonConfigFlag, utils.NetworkIdFlag, utils.EthStatsURLFlag, utils.NoCompactionFlag, diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 8ef9d9e7e836..e1c33678be37 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -544,7 +544,7 @@ var ( Usage: "Name of tracer which should record internal VM operations (costly)", Category: flags.VMCategory, } - VMTraceConfigFlag = &cli.StringFlag{ + VMTraceJsonConfigFlag = &cli.StringFlag{ Name: "vmtrace.jsonconfig", Usage: "Tracer configuration (JSON)", Category: flags.VMCategory, @@ -1903,12 +1903,12 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { if ctx.IsSet(VMTraceFlag.Name) { if name := ctx.String(VMTraceFlag.Name); name != "" { var config string - if ctx.IsSet(VMTraceConfigFlag.Name) { - config = ctx.String(VMTraceConfigFlag.Name) + if ctx.IsSet(VMTraceJsonConfigFlag.Name) { + config = ctx.String(VMTraceJsonConfigFlag.Name) } cfg.VMTrace = name - cfg.VMTraceConfig = config + cfg.VMTraceJsonConfig = config } } } @@ -2192,8 +2192,8 @@ func MakeChain(ctx *cli.Context, stack *node.Node, readonly bool) (*core.BlockCh if ctx.IsSet(VMTraceFlag.Name) { if name := ctx.String(VMTraceFlag.Name); name != "" { var config json.RawMessage - if ctx.IsSet(VMTraceConfigFlag.Name) { - config = json.RawMessage(ctx.String(VMTraceConfigFlag.Name)) + if ctx.IsSet(VMTraceJsonConfigFlag.Name) { + config = json.RawMessage(ctx.String(VMTraceJsonConfigFlag.Name)) } t, err := tracers.LiveDirectory.New(name, config) if err != nil { diff --git a/eth/backend.go b/eth/backend.go index 04ee82efeeaa..e616b5f2f195 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -203,8 +203,8 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) { ) if config.VMTrace != "" { var traceConfig json.RawMessage - if config.VMTraceConfig != "" { - traceConfig = json.RawMessage(config.VMTraceConfig) + if config.VMTraceJsonConfig != "" { + traceConfig = json.RawMessage(config.VMTraceJsonConfig) } t, err := tracers.LiveDirectory.New(config.VMTrace, traceConfig) if err != nil { diff --git a/eth/ethconfig/config.go b/eth/ethconfig/config.go index 91f2c8d33010..f36f212d9c3b 100644 --- a/eth/ethconfig/config.go +++ b/eth/ethconfig/config.go @@ -142,8 +142,8 @@ type Config struct { EnablePreimageRecording bool // Enables VM tracing - VMTrace string - VMTraceConfig string + VMTrace string + VMTraceJsonConfig string // Miscellaneous options DocRoot string `toml:"-"` diff --git a/eth/ethconfig/gen_config.go b/eth/ethconfig/gen_config.go index cda62bc9dd5d..b8b9eee29423 100644 --- a/eth/ethconfig/gen_config.go +++ b/eth/ethconfig/gen_config.go @@ -51,7 +51,7 @@ func (c Config) MarshalTOML() (interface{}, error) { GPO gasprice.Config EnablePreimageRecording bool VMTrace string - VMTraceConfig string + VMTraceJsonConfig string DocRoot string `toml:"-"` RPCGasCap uint64 RPCEVMTimeout time.Duration @@ -94,7 +94,7 @@ func (c Config) MarshalTOML() (interface{}, error) { enc.GPO = c.GPO enc.EnablePreimageRecording = c.EnablePreimageRecording enc.VMTrace = c.VMTrace - enc.VMTraceConfig = c.VMTraceConfig + enc.VMTraceJsonConfig = c.VMTraceJsonConfig enc.DocRoot = c.DocRoot enc.RPCGasCap = c.RPCGasCap enc.RPCEVMTimeout = c.RPCEVMTimeout @@ -141,7 +141,7 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { GPO *gasprice.Config EnablePreimageRecording *bool VMTrace *string - VMTraceConfig *string + VMTraceJsonConfig *string DocRoot *string `toml:"-"` RPCGasCap *uint64 RPCEVMTimeout *time.Duration @@ -255,8 +255,8 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { if dec.VMTrace != nil { c.VMTrace = *dec.VMTrace } - if dec.VMTraceConfig != nil { - c.VMTraceConfig = *dec.VMTraceConfig + if dec.VMTraceJsonConfig != nil { + c.VMTraceJsonConfig = *dec.VMTraceJsonConfig } if dec.DocRoot != nil { c.DocRoot = *dec.DocRoot