From 46ee090b3faa7b096d75001734b29052da2bdb9c Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Wed, 11 Nov 2020 17:07:20 +0100 Subject: [PATCH 1/2] eth: fix error in tracing if reexec is set --- eth/api_tracer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eth/api_tracer.go b/eth/api_tracer.go index 90d4a95c147b..4a60507a4506 100644 --- a/eth/api_tracer.go +++ b/eth/api_tracer.go @@ -573,13 +573,13 @@ func (api *PrivateDebugAPI) standardTraceBlockToFile(ctx context.Context, block // in order to obtain the state. // Therefore, it's perfectly valid to specify `"futureForkBlock": 0`, to enable `futureFork` - if config != nil && config.Overrides != nil { + if config != nil && config.LogConfig != nil && config.LogConfig.Overrides != nil { // Copy the config, to not screw up the main config // Note: the Clique-part is _not_ deep copied chainConfigCopy := new(params.ChainConfig) *chainConfigCopy = *chainConfig chainConfig = chainConfigCopy - if yolov2 := config.Overrides.YoloV2Block; yolov2 != nil { + if yolov2 := config.LogConfig.Overrides.YoloV2Block; yolov2 != nil { chainConfig.YoloV2Block = yolov2 canon = false } From efcc5e46ccae3f3a414c8d3d97b54439cf307bc4 Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Tue, 1 Dec 2020 10:43:24 +0100 Subject: [PATCH 2/2] eth: change pointer embedding to value-embedding --- eth/api_tracer.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/eth/api_tracer.go b/eth/api_tracer.go index 4a60507a4506..2840c914dc94 100644 --- a/eth/api_tracer.go +++ b/eth/api_tracer.go @@ -65,7 +65,7 @@ type TraceConfig struct { // StdTraceConfig holds extra parameters to standard-json trace functions. type StdTraceConfig struct { - *vm.LogConfig + vm.LogConfig Reexec *uint64 TxHash common.Hash } @@ -553,9 +553,7 @@ func (api *PrivateDebugAPI) standardTraceBlockToFile(ctx context.Context, block txHash common.Hash ) if config != nil { - if config.LogConfig != nil { - logConfig = *config.LogConfig - } + logConfig = config.LogConfig txHash = config.TxHash } logConfig.Debug = true @@ -573,7 +571,7 @@ func (api *PrivateDebugAPI) standardTraceBlockToFile(ctx context.Context, block // in order to obtain the state. // Therefore, it's perfectly valid to specify `"futureForkBlock": 0`, to enable `futureFork` - if config != nil && config.LogConfig != nil && config.LogConfig.Overrides != nil { + if config != nil && config.Overrides != nil { // Copy the config, to not screw up the main config // Note: the Clique-part is _not_ deep copied chainConfigCopy := new(params.ChainConfig)