diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b25857c98..826abf3786 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## Current ### Features +- [#5505](https://github.com/blockscout/blockscout/pull/5505) - Manage debug_traceTransaction JSON RPC method timeout - [#5491](https://github.com/blockscout/blockscout/pull/5491) - Sequential blocks broadcast on the main page - [#5312](https://github.com/blockscout/blockscout/pull/5312) - Add OpenZeppelin proxy storage slot - [#5302](https://github.com/blockscout/blockscout/pull/5302) - Add specific tx receipt fields for the GoQuorum client diff --git a/apps/ethereum_jsonrpc/config/config.exs b/apps/ethereum_jsonrpc/config/config.exs index 251b7c7e3a..e85965204d 100644 --- a/apps/ethereum_jsonrpc/config/config.exs +++ b/apps/ethereum_jsonrpc/config/config.exs @@ -26,6 +26,9 @@ config :ethereum_jsonrpc, EthereumJSONRPC.Tracer, adapter: SpandexDatadog.Adapter, trace_key: :blockscout +debug_trace_transaction_timeout = System.get_env("ETHEREUM_JSONRPC_DEBUG_TRACE_TRANSACTION_TIMEOUT", "5s") +config :ethereum_jsonrpc, EthereumJSONRPC.Geth, debug_trace_transaction_timeout: debug_trace_transaction_timeout + config :logger, :ethereum_jsonrpc, # keep synced with `config/config.exs` format: "$dateT$time $metadata[$level] $message\n", diff --git a/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/geth.ex b/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/geth.ex index 05e32348f2..b067ed1f1c 100644 --- a/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/geth.ex +++ b/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/geth.ex @@ -89,7 +89,14 @@ defmodule EthereumJSONRPC.Geth do @tracer File.read!(@tracer_path) defp debug_trace_transaction_request(%{id: id, hash_data: hash_data}) do - request(%{id: id, method: "debug_traceTransaction", params: [hash_data, %{tracer: @tracer}]}) + debug_trace_transaction_timeout = + Application.get_env(:ethereum_jsonrpc, __MODULE__)[:debug_trace_transaction_timeout] + + request(%{ + id: id, + method: "debug_traceTransaction", + params: [hash_data, %{tracer: @tracer, timeout: debug_trace_transaction_timeout}] + }) end defp debug_trace_transaction_responses_to_internal_transactions_params( diff --git a/docker/Makefile b/docker/Makefile index 86cae05a18..a6ddcfa191 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -397,6 +397,9 @@ endif ifdef INDEXER_MEMORY_LIMIT BLOCKSCOUT_CONTAINER_PARAMS += -e 'INDEXER_MEMORY_LIMIT=$(INDEXER_MEMORY_LIMIT)' endif +ifdef ETHEREUM_JSONRPC_DEBUG_TRACE_TRANSACTION_TIMEOUT + BLOCKSCOUT_CONTAINER_PARAMS += -e 'ETHEREUM_JSONRPC_DEBUG_TRACE_TRANSACTION_TIMEOUT=$(ETHEREUM_JSONRPC_DEBUG_TRACE_TRANSACTION_TIMEOUT)' +endif HAS_BLOCKSCOUT_IMAGE := $(shell docker images | grep -sw "${BS_CONTAINER_IMAGE} ") build: