Skip to content

Commit

Permalink
Fix handling unknown calls from callTracer
Browse files Browse the repository at this point in the history
  • Loading branch information
sl1depengwyn authored and rkachowski committed Jul 3, 2023
1 parent 8788f74 commit f238302
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Current

### Features

- [#6721](https://github.com/blockscout/blockscout/pull/6721) - Implement fetching internal transactions from callTracer
- [#5561](https://github.com/blockscout/blockscout/pull/5561), [#6523](https://github.com/blockscout/blockscout/pull/6523) - Improve working with contracts implementations
- [#6401](https://github.com/blockscout/blockscout/pull/6401) - Add Sol2Uml contract visualization
Expand Down Expand Up @@ -29,6 +30,7 @@

### Fixes

- [#6827](https://github.com/blockscout/blockscout/pull/6827) - Fix handling unknown calls from `callTracer`
- [#6532](https://github.com/blockscout/blockscout/pull/6532) - Fix index creation migration
- [#6473](https://github.com/blockscout/blockscout/pull/6473) - Fix state changes for contract creation transactions
- [#6475](https://github.com/blockscout/blockscout/pull/6475) - Fix token name with unicode graphemes shortening
Expand Down
10 changes: 9 additions & 1 deletion apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/geth.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -246,7 +248,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 =
Expand Down Expand Up @@ -283,6 +286,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()
Expand Down

0 comments on commit f238302

Please sign in to comment.