From b0df97f23d45f8a86b07b1a778c39931cb9eb11f Mon Sep 17 00:00:00 2001 From: Andrew Ashikhmin <34320705+yperbasis@users.noreply.github.com> Date: Mon, 27 May 2024 17:16:58 +0200 Subject: [PATCH] try to fix 'method handler crashed' for debug_traceCall of #9090 (#10502) Cherry pick PR #10401 into the release branch Co-authored-by: mars --- turbo/jsonrpc/tracing.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/turbo/jsonrpc/tracing.go b/turbo/jsonrpc/tracing.go index c891fa25fa4..5a884a01b20 100644 --- a/turbo/jsonrpc/tracing.go +++ b/turbo/jsonrpc/tracing.go @@ -325,7 +325,7 @@ func (api *PrivateDebugAPIImpl) TraceCall(ctx context.Context, args ethapi.CallA } var stateReader state.StateReader - if config.TxIndex == nil || isLatest { + if config == nil || config.TxIndex == nil || isLatest { stateReader, err = rpchelper.CreateStateReader(ctx, dbtx, blockNrOrHash, 0, api.filters, api.stateCache, api.historyV3(dbtx), chainConfig.ChainName) } else { stateReader, err = rpchelper.CreateHistoryStateReader(dbtx, blockNumber, int(*config.TxIndex), api.historyV3(dbtx), chainConfig.ChainName)