diff --git a/cmd/XDC/chaincmd.go b/cmd/XDC/chaincmd.go index bd4d49752c70..cb916dbfde2c 100644 --- a/cmd/XDC/chaincmd.go +++ b/cmd/XDC/chaincmd.go @@ -80,7 +80,7 @@ It expects the genesis file or the network name [ mainnet | testnet | devnet ] a utils.MetricsInfluxDBBucketFlag, utils.MetricsInfluxDBOrganizationFlag, utils.VMTraceFlag, - utils.VMTraceConfigFlag, + utils.VMTraceJsonConfigFlag, }, utils.DatabaseFlags), Description: ` The import command imports blocks from an RLP-encoded form. The form can be one file diff --git a/cmd/XDC/main.go b/cmd/XDC/main.go index a63e9a89a630..039694d61f56 100644 --- a/cmd/XDC/main.go +++ b/cmd/XDC/main.go @@ -123,7 +123,7 @@ var ( utils.Enable0xPrefixFlag, utils.EnableXDCPrefixFlag, utils.VMTraceFlag, - utils.VMTraceConfigFlag, + utils.VMTraceJsonConfigFlag, utils.NetworkIdFlag, utils.HTTPCORSDomainFlag, utils.AuthListenFlag, diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 1dcb8491cc16..afc367f2563f 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -381,7 +381,7 @@ var ( Usage: "Name of tracer which should record internal VM operations (costly)", Category: flags.VMCategory, } - VMTraceConfigFlag = &cli.StringFlag{ + VMTraceJsonConfigFlag = &cli.StringFlag{ Name: "vmtrace-config", Usage: "Tracer configuration (JSON)", Category: flags.VMCategory, @@ -1674,12 +1674,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 } } } @@ -1863,8 +1863,8 @@ func MakeChain(ctx *cli.Context, stack *node.Node, readonly bool) (chain *core.B 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 cbe025d7e90c..dd67bf0efc91 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -188,8 +188,8 @@ func New(stack *node.Node, config *ethconfig.Config, XDCXServ *XDCx.XDCX, lendin ) 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 b09ae583350e..8a2490ebfb5f 100644 --- a/eth/ethconfig/config.go +++ b/eth/ethconfig/config.go @@ -106,8 +106,8 @@ type Config struct { EnablePreimageRecording bool // Enables VM tracing - VMTrace string - VMTraceConfig string + VMTrace string + VMTraceJsonConfig string // RPCGasCap is the global gas cap for eth-call variants. RPCGasCap uint64 diff --git a/eth/ethconfig/gen_config.go b/eth/ethconfig/gen_config.go index 5237536e420f..e157e0ffbba0 100644 --- a/eth/ethconfig/gen_config.go +++ b/eth/ethconfig/gen_config.go @@ -23,6 +23,7 @@ func (c Config) MarshalTOML() (interface{}, error) { NetworkId uint64 SyncMode downloader.SyncMode NoPruning bool + NoPrefetch bool LightServ int `toml:",omitempty"` LightPeers int `toml:",omitempty"` SkipBcVersionCheck bool `toml:"-"` @@ -40,6 +41,8 @@ func (c Config) MarshalTOML() (interface{}, error) { TxPool txpool.Config GPO gasprice.Config EnablePreimageRecording bool + VMTrace string + VMTraceJsonConfig string RPCGasCap uint64 RPCTxFeeCap float64 } @@ -48,6 +51,7 @@ func (c Config) MarshalTOML() (interface{}, error) { enc.NetworkId = c.NetworkId enc.SyncMode = c.SyncMode enc.NoPruning = c.NoPruning + enc.NoPrefetch = c.NoPrefetch enc.LightServ = c.LightServ enc.LightPeers = c.LightPeers enc.SkipBcVersionCheck = c.SkipBcVersionCheck @@ -65,6 +69,8 @@ func (c Config) MarshalTOML() (interface{}, error) { enc.TxPool = c.TxPool enc.GPO = c.GPO enc.EnablePreimageRecording = c.EnablePreimageRecording + enc.VMTrace = c.VMTrace + enc.VMTraceJsonConfig = c.VMTraceJsonConfig enc.RPCGasCap = c.RPCGasCap enc.RPCTxFeeCap = c.RPCTxFeeCap return &enc, nil @@ -77,6 +83,7 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { NetworkId *uint64 SyncMode *downloader.SyncMode NoPruning *bool + NoPrefetch *bool LightServ *int `toml:",omitempty"` LightPeers *int `toml:",omitempty"` SkipBcVersionCheck *bool `toml:"-"` @@ -94,6 +101,8 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { TxPool *txpool.Config GPO *gasprice.Config EnablePreimageRecording *bool + VMTrace *string + VMTraceJsonConfig *string RPCGasCap *uint64 RPCTxFeeCap *float64 } @@ -113,6 +122,9 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { if dec.NoPruning != nil { c.NoPruning = *dec.NoPruning } + if dec.NoPrefetch != nil { + c.NoPrefetch = *dec.NoPrefetch + } if dec.LightServ != nil { c.LightServ = *dec.LightServ } @@ -164,6 +176,12 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { if dec.EnablePreimageRecording != nil { c.EnablePreimageRecording = *dec.EnablePreimageRecording } + if dec.VMTrace != nil { + c.VMTrace = *dec.VMTrace + } + if dec.VMTraceJsonConfig != nil { + c.VMTraceJsonConfig = *dec.VMTraceJsonConfig + } if dec.RPCGasCap != nil { c.RPCGasCap = *dec.RPCGasCap }