From 39f52c5600ea77e24384904f0c263d5d08193451 Mon Sep 17 00:00:00 2001 From: makcandrov <108467407+makcandrov@users.noreply.github.com> Date: Mon, 19 Sep 2022 09:51:14 -0700 Subject: [PATCH 1/4] eth: fix trace config for `TraceCall` Co-authored-by: AtomicAzzaz Co-authored-by: ewile --- eth/tracers/api.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/eth/tracers/api.go b/eth/tracers/api.go index 0cf2f45a8729..7be2ae3bdbe7 100644 --- a/eth/tracers/api.go +++ b/eth/tracers/api.go @@ -896,10 +896,11 @@ func (api *API) TraceCall(ctx context.Context, args ethapi.TransactionArgs, bloc var traceConfig *TraceConfig if config != nil { traceConfig = &TraceConfig{ - Config: config.Config, - Tracer: config.Tracer, - Timeout: config.Timeout, - Reexec: config.Reexec, + Config: config.Config, + Tracer: config.Tracer, + TracerConfig: config.TracerConfig, + Timeout: config.Timeout, + Reexec: config.Reexec, } } return api.traceTx(ctx, msg, new(Context), vmctx, statedb, traceConfig) From add360bc262598dba13752f7391eb07426f61e42 Mon Sep 17 00:00:00 2001 From: makcandrov <108467407+makcandrov@users.noreply.github.com> Date: Mon, 19 Sep 2022 10:56:14 -0700 Subject: [PATCH 2/4] eth: fix config types in `TraceCall` --- eth/tracers/api.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/eth/tracers/api.go b/eth/tracers/api.go index 7be2ae3bdbe7..f826ed56b73f 100644 --- a/eth/tracers/api.go +++ b/eth/tracers/api.go @@ -870,8 +870,8 @@ func (api *API) TraceCall(ctx context.Context, args ethapi.TransactionArgs, bloc } // try to recompute the state reexec := defaultTraceReexec - if config != nil && config.Reexec != nil { - reexec = *config.Reexec + if config != nil && &config.TraceConfig != nil && config.TraceConfig.Reexec != nil { + reexec = *config.TraceConfig.Reexec } statedb, release, err := api.backend.StateAtBlock(ctx, block, reexec, nil, true, false) if err != nil { @@ -895,13 +895,7 @@ func (api *API) TraceCall(ctx context.Context, args ethapi.TransactionArgs, bloc var traceConfig *TraceConfig if config != nil { - traceConfig = &TraceConfig{ - Config: config.Config, - Tracer: config.Tracer, - TracerConfig: config.TracerConfig, - Timeout: config.Timeout, - Reexec: config.Reexec, - } + traceConfig = &config.TraceConfig } return api.traceTx(ctx, msg, new(Context), vmctx, statedb, traceConfig) } From 81adbe839e8ceb28fb9cc5ea302dff16424d1589 Mon Sep 17 00:00:00 2001 From: makcandrov Date: Tue, 20 Sep 2022 05:08:14 -0700 Subject: [PATCH 3/4] eth/tracers: restore previous `config.Reexec` nil check --- eth/tracers/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth/tracers/api.go b/eth/tracers/api.go index f826ed56b73f..360926813e22 100644 --- a/eth/tracers/api.go +++ b/eth/tracers/api.go @@ -870,7 +870,7 @@ func (api *API) TraceCall(ctx context.Context, args ethapi.TransactionArgs, bloc } // try to recompute the state reexec := defaultTraceReexec - if config != nil && &config.TraceConfig != nil && config.TraceConfig.Reexec != nil { + if config != nil && config.Reexec != nil { reexec = *config.TraceConfig.Reexec } statedb, release, err := api.backend.StateAtBlock(ctx, block, reexec, nil, true, false) From 87161c0532cccd968f92fb97ed5a0ee5d960ddc2 Mon Sep 17 00:00:00 2001 From: makcandrov Date: Tue, 20 Sep 2022 05:12:24 -0700 Subject: [PATCH 4/4] eth/tracers: restore previous config.Reexec nil check --- eth/tracers/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth/tracers/api.go b/eth/tracers/api.go index 360926813e22..1e04bea411f3 100644 --- a/eth/tracers/api.go +++ b/eth/tracers/api.go @@ -871,7 +871,7 @@ func (api *API) TraceCall(ctx context.Context, args ethapi.TransactionArgs, bloc // try to recompute the state reexec := defaultTraceReexec if config != nil && config.Reexec != nil { - reexec = *config.TraceConfig.Reexec + reexec = *config.Reexec } statedb, release, err := api.backend.StateAtBlock(ctx, block, reexec, nil, true, false) if err != nil {