Send timeout param in debug_traceBlockByNumber request (#9654)

kf-jsonrpc-tests-without-matrix
Victor Baranov 8 months ago committed by GitHub
parent 824e10d166
commit 3d6025b261
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 17
      apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/geth.ex
  3. 20
      apps/ethereum_jsonrpc/test/ethereum_jsonrpc/geth_test.exs
  4. 2
      config/runtime.exs
  5. 1
      docker-compose/envs/common-blockscout.env

@ -34,6 +34,7 @@
### Fixes ### Fixes
- [#9654](https://github.com/blockscout/blockscout/pull/9654) - Send timeout param in debug_traceBlockByNumber request
- [#9652](https://github.com/blockscout/blockscout/pull/9652) - Remove duplicated tx hashes while indexing OP batches - [#9652](https://github.com/blockscout/blockscout/pull/9652) - Remove duplicated tx hashes while indexing OP batches
- [#9646](https://github.com/blockscout/blockscout/pull/9646) - Hotfix for Optimism Ecotone batch blobs indexing - [#9646](https://github.com/blockscout/blockscout/pull/9646) - Hotfix for Optimism Ecotone batch blobs indexing
- [#9640](https://github.com/blockscout/blockscout/pull/9640) - Fix no function clause matching in `BENS.item_to_address_hash_strings/1` - [#9640](https://github.com/blockscout/blockscout/pull/9640) - Fix no function clause matching in `BENS.item_to_address_hash_strings/1`

@ -42,10 +42,9 @@ defmodule EthereumJSONRPC.Geth do
end end
defp correct_timeouts(json_rpc_named_arguments) do defp correct_timeouts(json_rpc_named_arguments) do
debug_trace_transaction_timeout = debug_trace_timeout = Application.get_env(:ethereum_jsonrpc, __MODULE__)[:debug_trace_timeout]
Application.get_env(:ethereum_jsonrpc, __MODULE__)[:debug_trace_transaction_timeout]
case CommonHelper.parse_duration(debug_trace_transaction_timeout) do case CommonHelper.parse_duration(debug_trace_timeout) do
{:error, :invalid_format} -> {:error, :invalid_format} ->
json_rpc_named_arguments json_rpc_named_arguments
@ -152,21 +151,25 @@ defmodule EthereumJSONRPC.Geth do
@tracer File.read!(@tracer_path) @tracer File.read!(@tracer_path)
defp debug_trace_transaction_request(%{id: id, hash_data: hash_data}) do defp debug_trace_transaction_request(%{id: id, hash_data: hash_data}) do
debug_trace_transaction_timeout = debug_trace_timeout = Application.get_env(:ethereum_jsonrpc, __MODULE__)[:debug_trace_timeout]
Application.get_env(:ethereum_jsonrpc, __MODULE__)[:debug_trace_transaction_timeout]
request(%{ request(%{
id: id, id: id,
method: "debug_traceTransaction", method: "debug_traceTransaction",
params: [hash_data, %{timeout: debug_trace_transaction_timeout} |> Map.merge(tracer_params())] params: [hash_data, %{timeout: debug_trace_timeout} |> Map.merge(tracer_params())]
}) })
end end
defp debug_trace_block_by_number_request({id, block_number}) do defp debug_trace_block_by_number_request({id, block_number}) do
debug_trace_timeout = Application.get_env(:ethereum_jsonrpc, __MODULE__)[:debug_trace_timeout]
request(%{ request(%{
id: id, id: id,
method: "debug_traceBlockByNumber", method: "debug_traceBlockByNumber",
params: [integer_to_quantity(block_number), tracer_params()] params: [
integer_to_quantity(block_number),
%{timeout: debug_trace_timeout} |> Map.merge(tracer_params())
]
}) })
end end

@ -47,7 +47,7 @@ defmodule EthereumJSONRPC.GethTest do
]} ]}
end) end)
Application.put_env(:ethereum_jsonrpc, Geth, tracer: "js", debug_trace_transaction_timeout: "5s") Application.put_env(:ethereum_jsonrpc, Geth, tracer: "js", debug_trace_timeout: "5s")
assert {:ok, assert {:ok,
[ [
@ -357,11 +357,11 @@ defmodule EthereumJSONRPC.GethTest do
]} ]}
end) end)
Application.put_env(:ethereum_jsonrpc, Geth, tracer: "call_tracer", debug_trace_transaction_timeout: "5s") Application.put_env(:ethereum_jsonrpc, Geth, tracer: "call_tracer", debug_trace_timeout: "5s")
call_tracer_internal_txs = Geth.fetch_internal_transactions([transaction_params], json_rpc_named_arguments) call_tracer_internal_txs = Geth.fetch_internal_transactions([transaction_params], json_rpc_named_arguments)
Application.put_env(:ethereum_jsonrpc, Geth, tracer: "js", debug_trace_transaction_timeout: "5s") Application.put_env(:ethereum_jsonrpc, Geth, tracer: "js", debug_trace_timeout: "5s")
assert call_tracer_internal_txs == assert call_tracer_internal_txs ==
Geth.fetch_internal_transactions([transaction_params], json_rpc_named_arguments) Geth.fetch_internal_transactions([transaction_params], json_rpc_named_arguments)
@ -429,11 +429,11 @@ defmodule EthereumJSONRPC.GethTest do
]} ]}
end) end)
Application.put_env(:ethereum_jsonrpc, Geth, tracer: "call_tracer", debug_trace_transaction_timeout: "5s") Application.put_env(:ethereum_jsonrpc, Geth, tracer: "call_tracer", debug_trace_timeout: "5s")
call_tracer_internal_txs = Geth.fetch_internal_transactions([transaction_params], json_rpc_named_arguments) call_tracer_internal_txs = Geth.fetch_internal_transactions([transaction_params], json_rpc_named_arguments)
Application.put_env(:ethereum_jsonrpc, Geth, tracer: "js", debug_trace_transaction_timeout: "5s") Application.put_env(:ethereum_jsonrpc, Geth, tracer: "js", debug_trace_timeout: "5s")
assert call_tracer_internal_txs == assert call_tracer_internal_txs ==
Geth.fetch_internal_transactions([transaction_params], json_rpc_named_arguments) Geth.fetch_internal_transactions([transaction_params], json_rpc_named_arguments)
@ -469,7 +469,7 @@ defmodule EthereumJSONRPC.GethTest do
]} ]}
end) end)
Application.put_env(:ethereum_jsonrpc, Geth, tracer: "call_tracer", debug_trace_transaction_timeout: "5s") Application.put_env(:ethereum_jsonrpc, Geth, tracer: "call_tracer", debug_trace_timeout: "5s")
assert {:ok, assert {:ok,
[ [
@ -522,7 +522,7 @@ defmodule EthereumJSONRPC.GethTest do
]} ]}
end) end)
Application.put_env(:ethereum_jsonrpc, Geth, tracer: "call_tracer", debug_trace_transaction_timeout: "5s") Application.put_env(:ethereum_jsonrpc, Geth, tracer: "call_tracer", debug_trace_timeout: "5s")
uppercase_result = Geth.fetch_internal_transactions([transaction_params], json_rpc_named_arguments) uppercase_result = Geth.fetch_internal_transactions([transaction_params], json_rpc_named_arguments)
@ -601,7 +601,7 @@ defmodule EthereumJSONRPC.GethTest do
]} ]}
end) end)
Application.put_env(:ethereum_jsonrpc, Geth, tracer: "call_tracer", debug_trace_transaction_timeout: "5s") Application.put_env(:ethereum_jsonrpc, Geth, tracer: "call_tracer", debug_trace_timeout: "5s")
assert {:ok, assert {:ok,
[ [
@ -721,7 +721,7 @@ defmodule EthereumJSONRPC.GethTest do
]} ]}
end) end)
Application.put_env(:ethereum_jsonrpc, Geth, tracer: "call_tracer", debug_trace_transaction_timeout: "5s") Application.put_env(:ethereum_jsonrpc, Geth, tracer: "call_tracer", debug_trace_timeout: "5s")
assert {:ok, assert {:ok,
[ [
@ -868,7 +868,7 @@ defmodule EthereumJSONRPC.GethTest do
]} ]}
end) end)
Application.put_env(:ethereum_jsonrpc, Geth, tracer: "call_tracer", debug_trace_transaction_timeout: "5s") Application.put_env(:ethereum_jsonrpc, Geth, tracer: "call_tracer", debug_trace_timeout: "5s")
assert Geth.fetch_block_internal_transactions([block_number], json_rpc_named_arguments) == assert Geth.fetch_block_internal_transactions([block_number], json_rpc_named_arguments) ==
Geth.fetch_internal_transactions( Geth.fetch_internal_transactions(

@ -164,7 +164,7 @@ config :ethereum_jsonrpc, EthereumJSONRPC.HTTP,
config :ethereum_jsonrpc, EthereumJSONRPC.Geth, config :ethereum_jsonrpc, EthereumJSONRPC.Geth,
block_traceable?: ConfigHelper.parse_bool_env_var("ETHEREUM_JSONRPC_GETH_TRACE_BY_BLOCK"), block_traceable?: ConfigHelper.parse_bool_env_var("ETHEREUM_JSONRPC_GETH_TRACE_BY_BLOCK"),
debug_trace_transaction_timeout: System.get_env("ETHEREUM_JSONRPC_DEBUG_TRACE_TRANSACTION_TIMEOUT", "5s"), debug_trace_timeout: System.get_env("ETHEREUM_JSONRPC_DEBUG_TRACE_TRANSACTION_TIMEOUT", "5s"),
tracer: tracer:
if(ConfigHelper.chain_type() == "polygon_edge", if(ConfigHelper.chain_type() == "polygon_edge",
do: "polygon_edge", do: "polygon_edge",

@ -140,6 +140,7 @@ INDEXER_DISABLE_INTERNAL_TRANSACTIONS_FETCHER=false
# INDEXER_EMPTY_BLOCKS_SANITIZER_INTERVAL= # INDEXER_EMPTY_BLOCKS_SANITIZER_INTERVAL=
# INDEXER_INTERNAL_TRANSACTIONS_BATCH_SIZE= # INDEXER_INTERNAL_TRANSACTIONS_BATCH_SIZE=
# INDEXER_INTERNAL_TRANSACTIONS_CONCURRENCY= # INDEXER_INTERNAL_TRANSACTIONS_CONCURRENCY=
# ETHEREUM_JSONRPC_DEBUG_TRACE_TRANSACTION_TIMEOUT=
# INDEXER_BLOCK_REWARD_BATCH_SIZE= # INDEXER_BLOCK_REWARD_BATCH_SIZE=
# INDEXER_BLOCK_REWARD_CONCURRENCY= # INDEXER_BLOCK_REWARD_CONCURRENCY=
# INDEXER_TOKEN_INSTANCE_USE_BASE_URI_RETRY= # INDEXER_TOKEN_INSTANCE_USE_BASE_URI_RETRY=

Loading…
Cancel
Save