Merge pull request #6721 from blockscout/mf-implement-fetching-internal-txs-using-call-tracer

Implement fetching internal transactions from callTracer
pull/6763/head
Victor Baranov 2 years ago committed by GitHub
commit ce787a24f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 68
      apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/geth.ex
  3. 359
      apps/ethereum_jsonrpc/test/ethereum_jsonrpc/geth_test.exs
  4. 5
      config/runtime.exs
  5. 1
      docker-compose/envs/common-blockscout.env
  6. 3
      docker/Makefile

@ -4,6 +4,7 @@
### Features
- [#6721](https://github.com/blockscout/blockscout/pull/6721) - Implement fetching internal transactions from callTracer
- [#6712](https://github.com/blockscout/blockscout/pull/6712) - API v2 update
### Fixes

@ -73,10 +73,16 @@ defmodule EthereumJSONRPC.Geth do
debug_trace_transaction_timeout =
Application.get_env(:ethereum_jsonrpc, __MODULE__)[:debug_trace_transaction_timeout]
tracer =
case Application.get_env(:ethereum_jsonrpc, __MODULE__)[:tracer] do
"js" -> @tracer
"call_tracer" -> "callTracer"
end
request(%{
id: id,
method: "debug_traceTransaction",
params: [hash_data, %{tracer: @tracer, timeout: debug_trace_transaction_timeout}]
params: [hash_data, %{tracer: tracer, timeout: debug_trace_transaction_timeout}]
})
end
@ -169,6 +175,7 @@ defmodule EthereumJSONRPC.Geth do
internal_transaction_params =
calls
|> prepare_calls()
|> Stream.with_index()
|> Enum.map(fn {trace, index} ->
Map.merge(trace, %{
@ -215,6 +222,65 @@ defmodule EthereumJSONRPC.Geth do
{:error, annotated_error}
end
defp prepare_calls(calls) do
case Application.get_env(:ethereum_jsonrpc, __MODULE__)[:tracer] do
"call_tracer" -> {calls, 0} |> parse_call_tracer_calls([], [], false) |> Enum.reverse()
"js" -> calls
end
end
defp parse_call_tracer_calls(calls, acc, trace_address, inner? \\ true)
defp parse_call_tracer_calls([], acc, _trace_address, _inner?), do: acc
defp parse_call_tracer_calls({%{"type" => 0}, _}, acc, _trace_address, _inner?), do: acc
defp parse_call_tracer_calls(
{%{"type" => type, "from" => from} = call, index},
acc,
trace_address,
inner?
) do
new_trace_address = [index | trace_address]
formatted_call =
%{
"type" => if(type in ~w(CALL CALLCODE DELEGATECALL STATICCALL), do: "call", else: String.downcase(type)),
"callType" => String.downcase(type),
"from" => from,
"to" => Map.get(call, "to", "0x"),
"createdContractAddressHash" => Map.get(call, "to", "0x"),
"value" => Map.get(call, "value", "0x0"),
"gas" => Map.get(call, "gas", "0x0"),
"gasUsed" => Map.get(call, "gasUsed", "0x0"),
"input" => Map.get(call, "input", "0x"),
"init" => Map.get(call, "input", "0x"),
"createdContractCode" => Map.get(call, "output", "0x"),
"traceAddress" => if(inner?, do: Enum.reverse(new_trace_address), else: []),
"error" => call["error"]
}
|> case do
%{"error" => nil} = ok_call ->
ok_call
|> Map.delete("error")
# to handle staticcall, all other cases handled by EthereumJSONRPC.Geth.Call.elixir_to_internal_transaction_params/1
|> Map.put("output", Map.get(call, "output", "0x"))
error_call ->
error_call
end
parse_call_tracer_calls(
Map.get(call, "calls", []),
[formatted_call | acc],
if(inner?, do: new_trace_address, else: [])
)
end
defp parse_call_tracer_calls(calls, acc, trace_address, _inner) when is_list(calls) do
calls
|> Stream.with_index()
|> Enum.reduce(acc, &parse_call_tracer_calls(&1, &2, trace_address))
end
defp reduce_internal_transactions_params(internal_transactions_params) when is_list(internal_transactions_params) do
internal_transactions_params
|> Enum.reduce({:ok, []}, &internal_transactions_params_reducer/2)

@ -11,6 +11,8 @@ defmodule EthereumJSONRPC.GethTest do
# Infura Mainnet does not support debug_traceTransaction, so this cannot be tested expect in Mox
setup do
EthereumJSONRPC.Case.Geth.Mox.setup()
initial_env = Application.get_all_env(:ethereum_jsonrpc)
on_exit(fn -> Application.put_all_env([{:ethereum_jsonrpc, initial_env}]) end)
end
setup :verify_on_exit!
@ -45,6 +47,8 @@ defmodule EthereumJSONRPC.GethTest do
]}
end)
Application.put_env(:ethereum_jsonrpc, Geth, tracer: "js")
assert {:ok,
[
%{
@ -75,6 +79,361 @@ defmodule EthereumJSONRPC.GethTest do
json_rpc_named_arguments
)
end
test "call_tracer contract calls results are the same as js tracer", %{
json_rpc_named_arguments: json_rpc_named_arguments
} do
transaction_hash = "0xb342cafc6ac552c3be2090561453204c8784caf025ac8267320834e4cd163d96"
block_number = 3_287_375
transaction_index = 13
transaction_params = %{
block_number: block_number,
transaction_index: transaction_index,
hash_data: transaction_hash
}
tracer = File.read!("priv/js/ethereum_jsonrpc/geth/debug_traceTransaction/tracer.js")
expect(EthereumJSONRPC.Mox, :json_rpc, 1, fn
[%{id: id, params: [^transaction_hash, %{tracer: "callTracer"}]}], _ ->
{:ok,
[
%{
id: id,
result: %{
"calls" => [
%{
"calls" => [
%{
"from" => "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"gas" => "0x12816",
"gasUsed" => "0x229e",
"input" =>
"0xa9059cbb0000000000000000000000009507c04b10486547584c37bcbd931b2a4fee9a4100000000000000000000000000000000000000000000000322a0aedb1fe2c7e6",
"output" => "0x",
"to" => "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"type" => "CALL",
"value" => "0x0"
},
%{
"calls" => [
%{
"from" => "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"gas" => "0xfbb8",
"gasUsed" => "0x211",
"input" => "0x70a0823100000000000000000000000088e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"output" => "0x",
"to" => "0xa2327a938febf5fec13bacfb16ae10ecbc4cbdcf",
"type" => "DELEGATECALL"
}
],
"from" => "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"gas" => "0x1029c",
"gasUsed" => "0x523",
"input" => "0x70a0823100000000000000000000000088e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"output" => "0x",
"to" => "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"type" => "STATICCALL"
},
%{
"calls" => [
%{
"calls" => [
%{
"from" => "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"gas" => "0xe3e3",
"gasUsed" => "0x259c",
"input" =>
"0xa9059cbb00000000000000000000000088e6a0c2ddd26feeb64f039a2c41296fcb3f564000000000000000000000000000000000000000000000000000000014e53ad37c",
"output" => "0x",
"to" => "0xa2327a938febf5fec13bacfb16ae10ecbc4cbdcf",
"type" => "DELEGATECALL"
}
],
"from" => "0x9507c04b10486547584c37bcbd931b2a4fee9a41",
"gas" => "0xea6a",
"gasUsed" => "0x28b1",
"input" =>
"0xa9059cbb00000000000000000000000088e6a0c2ddd26feeb64f039a2c41296fcb3f564000000000000000000000000000000000000000000000000000000014e53ad37c",
"output" => "0x",
"to" => "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"type" => "CALL",
"value" => "0x0"
}
],
"from" => "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"gas" => "0xfa71",
"gasUsed" => "0x3627",
"input" =>
"0xfa461e3300000000000000000000000000000000000000000000000000000014e53ad37cfffffffffffffffffffffffffffffffffffffffffffffffcdd5f5124e01d381a000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000000000001f400000000000000000000000000000000000000000000000000000014e53ad37c00000000000000000000000000000000000000000000000322a0aedb1fe2c7e600000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000",
"output" => "0x",
"to" => "0x9507c04b10486547584c37bcbd931b2a4fee9a41",
"type" => "CALL",
"value" => "0x0"
},
%{
"calls" => [
%{
"from" => "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"gas" => "0xbcc4",
"gasUsed" => "0x211",
"input" => "0x70a0823100000000000000000000000088e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"output" => "0x",
"to" => "0xa2327a938febf5fec13bacfb16ae10ecbc4cbdcf",
"type" => "DELEGATECALL"
}
],
"from" => "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"gas" => "0xc2a9",
"gasUsed" => "0x523",
"input" => "0x70a0823100000000000000000000000088e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"output" => "0x",
"to" => "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"type" => "STATICCALL"
}
],
"from" => "0x9507c04b10486547584c37bcbd931b2a4fee9a41",
"gas" => "0x185b2",
"gasUsed" => "0xd38e",
"input" =>
"0x128acb080000000000000000000000009507c04b10486547584c37bcbd931b2a4fee9a410000000000000000000000000000000000000000000000000000000000000001fffffffffffffffffffffffffffffffffffffffffffffffcdd5f5124e01d381a00000000000000000000000000000000000000000000000000000001000276a400000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000000000001f400000000000000000000000000000000000000000000000000000014e53ad37c00000000000000000000000000000000000000000000000322a0aedb1fe2c7e600000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000",
"output" => "0x",
"to" => "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"type" => "CALL",
"value" => "0x0"
}
],
"from" => "0x56d0c33e5e8cb6390cebd7369d2fe7e7870a04e0",
"gas" => "0x1a8c6",
"gasUsed" => "0xf1f6",
"input" =>
"0x33000000000000000014e53ad37c0000000322a0aedb1fe2c7e6010201f4ff010088e6a0c2ddd26feeb64f039a2c41296fcb3f5640a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48c02aaa39b223fe8d0a0e5c4f27ead9083c756cc203",
"output" => "0x",
"time" => "48.391824ms",
"to" => "0x9507c04b10486547584c37bcbd931b2a4fee9a41",
"type" => "CALL",
"value" => "0xfa72c6"
}
}
]}
end)
expect(EthereumJSONRPC.Mox, :json_rpc, 1, fn
[%{id: id, params: [^transaction_hash, %{tracer: ^tracer}]}], _ ->
{:ok,
[
%{
id: id,
result: [
%{
"callType" => "call",
"from" => "0x56d0c33e5e8cb6390cebd7369d2fe7e7870a04e0",
"gas" => "0x1a8c6",
"gasUsed" => "0xf1f6",
"input" =>
"0x33000000000000000014e53ad37c0000000322a0aedb1fe2c7e6010201f4ff010088e6a0c2ddd26feeb64f039a2c41296fcb3f5640a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48c02aaa39b223fe8d0a0e5c4f27ead9083c756cc203",
"output" => "0x",
"to" => "0x9507c04b10486547584c37bcbd931b2a4fee9a41",
"traceAddress" => [],
"type" => "call",
"value" => "0xfa72c6"
},
%{
"callType" => "call",
"from" => "0x9507c04b10486547584c37bcbd931b2a4fee9a41",
"gas" => "0x185b2",
"gasUsed" => "0xd38e",
"input" =>
"0x128acb080000000000000000000000009507c04b10486547584c37bcbd931b2a4fee9a410000000000000000000000000000000000000000000000000000000000000001fffffffffffffffffffffffffffffffffffffffffffffffcdd5f5124e01d381a00000000000000000000000000000000000000000000000000000001000276a400000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000000000001f400000000000000000000000000000000000000000000000000000014e53ad37c00000000000000000000000000000000000000000000000322a0aedb1fe2c7e600000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000",
"output" => "0x",
"to" => "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"traceAddress" => [0],
"type" => "call",
"value" => "0x0"
},
%{
"callType" => "call",
"from" => "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"gas" => "0x12816",
"gasUsed" => "0x229e",
"input" =>
"0xa9059cbb0000000000000000000000009507c04b10486547584c37bcbd931b2a4fee9a4100000000000000000000000000000000000000000000000322a0aedb1fe2c7e6",
"output" => "0x",
"to" => "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"traceAddress" => [0, 0],
"type" => "call",
"value" => "0x0"
},
%{
"callType" => "staticcall",
"from" => "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"gas" => "0x1029c",
"gasUsed" => "0x523",
"input" => "0x70a0823100000000000000000000000088e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"output" => "0x",
"to" => "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"traceAddress" => [0, 1],
"type" => "call",
"value" => "0x0"
},
%{
"callType" => "delegatecall",
"from" => "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"gas" => "0xfbb8",
"gasUsed" => "0x211",
"input" => "0x70a0823100000000000000000000000088e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"output" => "0x",
"to" => "0xa2327a938febf5fec13bacfb16ae10ecbc4cbdcf",
"traceAddress" => [0, 1, 0],
"type" => "call",
"value" => "0x0"
},
%{
"callType" => "call",
"from" => "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"gas" => "0xfa71",
"gasUsed" => "0x3627",
"input" =>
"0xfa461e3300000000000000000000000000000000000000000000000000000014e53ad37cfffffffffffffffffffffffffffffffffffffffffffffffcdd5f5124e01d381a000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000000000001f400000000000000000000000000000000000000000000000000000014e53ad37c00000000000000000000000000000000000000000000000322a0aedb1fe2c7e600000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000",
"output" => "0x",
"to" => "0x9507c04b10486547584c37bcbd931b2a4fee9a41",
"traceAddress" => [0, 2],
"type" => "call",
"value" => "0x0"
},
%{
"callType" => "call",
"from" => "0x9507c04b10486547584c37bcbd931b2a4fee9a41",
"gas" => "0xea6a",
"gasUsed" => "0x28b1",
"input" =>
"0xa9059cbb00000000000000000000000088e6a0c2ddd26feeb64f039a2c41296fcb3f564000000000000000000000000000000000000000000000000000000014e53ad37c",
"output" => "0x",
"to" => "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"traceAddress" => [0, 2, 0],
"type" => "call",
"value" => "0x0"
},
%{
"callType" => "delegatecall",
"from" => "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"gas" => "0xe3e3",
"gasUsed" => "0x259c",
"input" =>
"0xa9059cbb00000000000000000000000088e6a0c2ddd26feeb64f039a2c41296fcb3f564000000000000000000000000000000000000000000000000000000014e53ad37c",
"output" => "0x",
"to" => "0xa2327a938febf5fec13bacfb16ae10ecbc4cbdcf",
"traceAddress" => [0, 2, 0, 0],
"type" => "call",
"value" => "0x0"
},
%{
"callType" => "staticcall",
"from" => "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"gas" => "0xc2a9",
"gasUsed" => "0x523",
"input" => "0x70a0823100000000000000000000000088e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"output" => "0x",
"to" => "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"traceAddress" => [0, 3],
"type" => "call",
"value" => "0x0"
},
%{
"callType" => "delegatecall",
"from" => "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"gas" => "0xbcc4",
"gasUsed" => "0x211",
"input" => "0x70a0823100000000000000000000000088e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"output" => "0x",
"to" => "0xa2327a938febf5fec13bacfb16ae10ecbc4cbdcf",
"traceAddress" => [0, 3, 0],
"type" => "call",
"value" => "0x0"
}
]
}
]}
end)
call_tracer_internal_txs = Geth.fetch_internal_transactions([transaction_params], json_rpc_named_arguments)
Application.put_env(:ethereum_jsonrpc, Geth, tracer: "js")
assert call_tracer_internal_txs ==
Geth.fetch_internal_transactions([transaction_params], json_rpc_named_arguments)
end
test "call_tracer contract creation results are the same as js tracer", %{
json_rpc_named_arguments: json_rpc_named_arguments
} do
transaction_hash = "0xb342cafc6ac552c3be2090561453204c8784caf025ac8267320834e4cd163d96"
block_number = 3_287_375
transaction_index = 13
transaction_params = %{
block_number: block_number,
transaction_index: transaction_index,
hash_data: transaction_hash
}
tracer = File.read!("priv/js/ethereum_jsonrpc/geth/debug_traceTransaction/tracer.js")
expect(EthereumJSONRPC.Mox, :json_rpc, 1, fn
[%{id: id, params: [^transaction_hash, %{tracer: "callTracer"}]}], _ ->
{:ok,
[
%{
id: id,
result: %{
"type" => "CREATE",
"from" => "0x117b358218da5a4f647072ddb50ded038ed63d17",
"to" => "0x205a6b72ce16736c9d87172568a9c0cb9304de0d",
"value" => "0x0",
"gas" => "0x106f5",
"gasUsed" => "0x106f5",
"input" =>
"0x608060405234801561001057600080fd5b50610150806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80632e64cec11461003b5780636057361d14610059575b600080fd5b610043610075565b60405161005091906100d9565b60405180910390f35b610073600480360381019061006e919061009d565b61007e565b005b60008054905090565b8060008190555050565b60008135905061009781610103565b92915050565b6000602082840312156100b3576100b26100fe565b5b60006100c184828501610088565b91505092915050565b6100d3816100f4565b82525050565b60006020820190506100ee60008301846100ca565b92915050565b6000819050919050565b600080fd5b61010c816100f4565b811461011757600080fd5b5056fea26469706673582212209a159a4f3847890f10bfb87871a61eba91c5dbf5ee3cf6398207e292eee22a1664736f6c63430008070033",
"output" =>
"0x608060405234801561001057600080fd5b50600436106100365760003560e01c80632e64cec11461003b5780636057361d14610059575b600080fd5b610043610075565b60405161005091906100d9565b60405180910390f35b610073600480360381019061006e919061009d565b61007e565b005b60008054905090565b8060008190555050565b60008135905061009781610103565b92915050565b6000602082840312156100b3576100b26100fe565b5b60006100c184828501610088565b91505092915050565b6100d3816100f4565b82525050565b60006020820190506100ee60008301846100ca565b92915050565b6000819050919050565b600080fd5b61010c816100f4565b811461011757600080fd5b5056fea26469706673582212209a159a4f3847890f10bfb87871a61eba91c5dbf5ee3cf6398207e292eee22a1664736f6c63430008070033"
}
}
]}
end)
expect(EthereumJSONRPC.Mox, :json_rpc, 1, fn
[%{id: id, params: [^transaction_hash, %{tracer: ^tracer}]}], _ ->
{:ok,
[
%{
id: id,
result: [
%{
"type" => "create",
"from" => "0x117b358218da5a4f647072ddb50ded038ed63d17",
"init" =>
"0x608060405234801561001057600080fd5b50610150806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80632e64cec11461003b5780636057361d14610059575b600080fd5b610043610075565b60405161005091906100d9565b60405180910390f35b610073600480360381019061006e919061009d565b61007e565b005b60008054905090565b8060008190555050565b60008135905061009781610103565b92915050565b6000602082840312156100b3576100b26100fe565b5b60006100c184828501610088565b91505092915050565b6100d3816100f4565b82525050565b60006020820190506100ee60008301846100ca565b92915050565b6000819050919050565b600080fd5b61010c816100f4565b811461011757600080fd5b5056fea26469706673582212209a159a4f3847890f10bfb87871a61eba91c5dbf5ee3cf6398207e292eee22a1664736f6c63430008070033",
"createdContractAddressHash" => "0x205a6b72ce16736c9d87172568a9c0cb9304de0d",
"createdContractCode" =>
"0x608060405234801561001057600080fd5b50600436106100365760003560e01c80632e64cec11461003b5780636057361d14610059575b600080fd5b610043610075565b60405161005091906100d9565b60405180910390f35b610073600480360381019061006e919061009d565b61007e565b005b60008054905090565b8060008190555050565b60008135905061009781610103565b92915050565b6000602082840312156100b3576100b26100fe565b5b60006100c184828501610088565b91505092915050565b6100d3816100f4565b82525050565b60006020820190506100ee60008301846100ca565b92915050565b6000819050919050565b600080fd5b61010c816100f4565b811461011757600080fd5b5056fea26469706673582212209a159a4f3847890f10bfb87871a61eba91c5dbf5ee3cf6398207e292eee22a1664736f6c63430008070033",
"traceAddress" => [],
"value" => "0x0",
"gas" => "0x106f5",
"gasUsed" => "0x106f5"
}
]
}
]}
end)
call_tracer_internal_txs = Geth.fetch_internal_transactions([transaction_params], json_rpc_named_arguments)
Application.put_env(:ethereum_jsonrpc, Geth, tracer: "js")
assert call_tracer_internal_txs ==
Geth.fetch_internal_transactions([transaction_params], json_rpc_named_arguments)
end
end
describe "fetch_block_internal_transactions/1" do

@ -180,7 +180,10 @@ config :ethereum_jsonrpc,
disable_archive_balances?: System.get_env("ETHEREUM_JSONRPC_DISABLE_ARCHIVE_BALANCES", "false") == "true"
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 :ethereum_jsonrpc, EthereumJSONRPC.Geth,
debug_trace_transaction_timeout: debug_trace_transaction_timeout,
tracer: System.get_env("INDEXER_INTERNAL_TRANSACTIONS_TRACER_TYPE", "call_tracer")
config :ethereum_jsonrpc, EthereumJSONRPC.PendingTransaction,
type: System.get_env("ETHEREUM_JSONRPC_PENDING_TRANSACTIONS_TYPE", "default")

@ -93,6 +93,7 @@ INDEXER_DISABLE_INTERNAL_TRANSACTIONS_FETCHER=false
# TOKEN_ID_MIGRATION_FIRST_BLOCK=
# TOKEN_ID_MIGRATION_CONCURRENCY=
# TOKEN_ID_MIGRATION_BATCH_SIZE=
# INDEXER_INTERNAL_TRANSACTIONS_TRACER_TYPE=
# WEBAPP_URL=
# API_URL=
WOBSERVER_ENABLED=false

@ -475,6 +475,9 @@ endif
ifdef INDEXER_EMPTY_BLOCKS_SANITIZER_BATCH_SIZE
BLOCKSCOUT_CONTAINER_PARAMS += -e 'INDEXER_EMPTY_BLOCKS_SANITIZER_BATCH_SIZE=$(INDEXER_EMPTY_BLOCKS_SANITIZER_BATCH_SIZE)'
endif
ifdef INDEXER_INTERNAL_TRANSACTIONS_TRACER_TYPE
BLOCKSCOUT_CONTAINER_PARAMS += -e 'INDEXER_INTERNAL_TRANSACTIONS_TRACER_TYPE=$(INDEXER_INTERNAL_TRANSACTIONS_TRACER_TYPE)'
endif
ifdef TOKEN_ID_MIGRATION_FIRST_BLOCK
BLOCKSCOUT_CONTAINER_PARAMS += -e 'INDEXER_EMPTY_BLOCKS_SANITIZER_BATCH_SIZE=$(INDEXER_EMPTY_BLOCKS_SANITIZER_BATCH_SIZE)'
endif

Loading…
Cancel
Save