Merge pull request #6827 from blockscout/mf-fix-calltracer

Fix handling unknown calls from `callTracer`
pull/6831/head
Victor Baranov 2 years ago committed by GitHub
commit 82652c5188
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 10
      apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/geth.ex

@ -13,6 +13,7 @@
### Fixes
- [#6827](https://github.com/blockscout/blockscout/pull/6827) - Fix handling unknown calls from `callTracer`
- [#6793](https://github.com/blockscout/blockscout/pull/6793) - Change sig-provider default image tag to main
- [#6777](https://github.com/blockscout/blockscout/pull/6777) - Fix -1 transaction counter
- [#6746](https://github.com/blockscout/blockscout/pull/6746) - Fix -1 address counter

@ -3,6 +3,8 @@ defmodule EthereumJSONRPC.Geth do
Ethereum JSONRPC methods that are only supported by [Geth](https://github.com/ethereum/go-ethereum/wiki/geth).
"""
require Logger
import EthereumJSONRPC, only: [id_to_params: 1, integer_to_quantity: 1, json_rpc: 2, request: 1]
alias EthereumJSONRPC.{FetchedBalance, FetchedCode, PendingTransaction}
@ -238,7 +240,8 @@ defmodule EthereumJSONRPC.Geth do
acc,
trace_address,
inner?
) do
)
when type in ~w(CALL CALLCODE DELEGATECALL STATICCALL CREATE CREATE2 SELFDESTRUCT REWARD) do
new_trace_address = [index | trace_address]
formatted_call =
@ -275,6 +278,11 @@ defmodule EthereumJSONRPC.Geth do
)
end
defp parse_call_tracer_calls({call, _}, acc, _trace_address, _inner?) do
Logger.warning("Call from a callTracer with an unknown type: #{inspect(call)}")
acc
end
defp parse_call_tracer_calls(calls, acc, trace_address, _inner) when is_list(calls) do
calls
|> Stream.with_index()

Loading…
Cancel
Save