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.
pull/29643/head
Chris Ziogas 7 months ago committed by GitHub
parent 94579932b1
commit 882d1e22f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      cmd/geth/chaincmd.go
  2. 2
      cmd/geth/main.go
  3. 12
      cmd/utils/flags.go
  4. 4
      eth/backend.go
  5. 4
      eth/ethconfig/config.go
  6. 10
      eth/ethconfig/gen_config.go

@ -100,7 +100,7 @@ if one is set. Otherwise it prints the genesis from the datadir.`,
utils.MetricsInfluxDBOrganizationFlag, utils.MetricsInfluxDBOrganizationFlag,
utils.TxLookupLimitFlag, utils.TxLookupLimitFlag,
utils.VMTraceFlag, utils.VMTraceFlag,
utils.VMTraceConfigFlag, utils.VMTraceJsonConfigFlag,
utils.TransactionHistoryFlag, utils.TransactionHistoryFlag,
utils.StateHistoryFlag, utils.StateHistoryFlag,
}, utils.DatabaseFlags), }, utils.DatabaseFlags),

@ -137,7 +137,7 @@ var (
utils.DeveloperPeriodFlag, utils.DeveloperPeriodFlag,
utils.VMEnableDebugFlag, utils.VMEnableDebugFlag,
utils.VMTraceFlag, utils.VMTraceFlag,
utils.VMTraceConfigFlag, utils.VMTraceJsonConfigFlag,
utils.NetworkIdFlag, utils.NetworkIdFlag,
utils.EthStatsURLFlag, utils.EthStatsURLFlag,
utils.NoCompactionFlag, utils.NoCompactionFlag,

@ -544,7 +544,7 @@ var (
Usage: "Name of tracer which should record internal VM operations (costly)", Usage: "Name of tracer which should record internal VM operations (costly)",
Category: flags.VMCategory, Category: flags.VMCategory,
} }
VMTraceConfigFlag = &cli.StringFlag{ VMTraceJsonConfigFlag = &cli.StringFlag{
Name: "vmtrace.jsonconfig", Name: "vmtrace.jsonconfig",
Usage: "Tracer configuration (JSON)", Usage: "Tracer configuration (JSON)",
Category: flags.VMCategory, Category: flags.VMCategory,
@ -1903,12 +1903,12 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
if ctx.IsSet(VMTraceFlag.Name) { if ctx.IsSet(VMTraceFlag.Name) {
if name := ctx.String(VMTraceFlag.Name); name != "" { if name := ctx.String(VMTraceFlag.Name); name != "" {
var config string var config string
if ctx.IsSet(VMTraceConfigFlag.Name) { if ctx.IsSet(VMTraceJsonConfigFlag.Name) {
config = ctx.String(VMTraceConfigFlag.Name) config = ctx.String(VMTraceJsonConfigFlag.Name)
} }
cfg.VMTrace = 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 ctx.IsSet(VMTraceFlag.Name) {
if name := ctx.String(VMTraceFlag.Name); name != "" { if name := ctx.String(VMTraceFlag.Name); name != "" {
var config json.RawMessage var config json.RawMessage
if ctx.IsSet(VMTraceConfigFlag.Name) { if ctx.IsSet(VMTraceJsonConfigFlag.Name) {
config = json.RawMessage(ctx.String(VMTraceConfigFlag.Name)) config = json.RawMessage(ctx.String(VMTraceJsonConfigFlag.Name))
} }
t, err := tracers.LiveDirectory.New(name, config) t, err := tracers.LiveDirectory.New(name, config)
if err != nil { if err != nil {

@ -203,8 +203,8 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
) )
if config.VMTrace != "" { if config.VMTrace != "" {
var traceConfig json.RawMessage var traceConfig json.RawMessage
if config.VMTraceConfig != "" { if config.VMTraceJsonConfig != "" {
traceConfig = json.RawMessage(config.VMTraceConfig) traceConfig = json.RawMessage(config.VMTraceJsonConfig)
} }
t, err := tracers.LiveDirectory.New(config.VMTrace, traceConfig) t, err := tracers.LiveDirectory.New(config.VMTrace, traceConfig)
if err != nil { if err != nil {

@ -142,8 +142,8 @@ type Config struct {
EnablePreimageRecording bool EnablePreimageRecording bool
// Enables VM tracing // Enables VM tracing
VMTrace string VMTrace string
VMTraceConfig string VMTraceJsonConfig string
// Miscellaneous options // Miscellaneous options
DocRoot string `toml:"-"` DocRoot string `toml:"-"`

@ -51,7 +51,7 @@ func (c Config) MarshalTOML() (interface{}, error) {
GPO gasprice.Config GPO gasprice.Config
EnablePreimageRecording bool EnablePreimageRecording bool
VMTrace string VMTrace string
VMTraceConfig string VMTraceJsonConfig string
DocRoot string `toml:"-"` DocRoot string `toml:"-"`
RPCGasCap uint64 RPCGasCap uint64
RPCEVMTimeout time.Duration RPCEVMTimeout time.Duration
@ -94,7 +94,7 @@ func (c Config) MarshalTOML() (interface{}, error) {
enc.GPO = c.GPO enc.GPO = c.GPO
enc.EnablePreimageRecording = c.EnablePreimageRecording enc.EnablePreimageRecording = c.EnablePreimageRecording
enc.VMTrace = c.VMTrace enc.VMTrace = c.VMTrace
enc.VMTraceConfig = c.VMTraceConfig enc.VMTraceJsonConfig = c.VMTraceJsonConfig
enc.DocRoot = c.DocRoot enc.DocRoot = c.DocRoot
enc.RPCGasCap = c.RPCGasCap enc.RPCGasCap = c.RPCGasCap
enc.RPCEVMTimeout = c.RPCEVMTimeout enc.RPCEVMTimeout = c.RPCEVMTimeout
@ -141,7 +141,7 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
GPO *gasprice.Config GPO *gasprice.Config
EnablePreimageRecording *bool EnablePreimageRecording *bool
VMTrace *string VMTrace *string
VMTraceConfig *string VMTraceJsonConfig *string
DocRoot *string `toml:"-"` DocRoot *string `toml:"-"`
RPCGasCap *uint64 RPCGasCap *uint64
RPCEVMTimeout *time.Duration RPCEVMTimeout *time.Duration
@ -255,8 +255,8 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
if dec.VMTrace != nil { if dec.VMTrace != nil {
c.VMTrace = *dec.VMTrace c.VMTrace = *dec.VMTrace
} }
if dec.VMTraceConfig != nil { if dec.VMTraceJsonConfig != nil {
c.VMTraceConfig = *dec.VMTraceConfig c.VMTraceJsonConfig = *dec.VMTraceJsonConfig
} }
if dec.DocRoot != nil { if dec.DocRoot != nil {
c.DocRoot = *dec.DocRoot c.DocRoot = *dec.DocRoot

Loading…
Cancel
Save