Limit fetchers init tasks

limit-fetchers-init-tasks
Qwerty5Uiop 1 year ago
parent 81c7fed16a
commit fd78aaf3ea
  1. 1
      CHANGELOG.md
  2. 83
      apps/explorer/lib/explorer/chain.ex
  3. 21
      apps/indexer/lib/indexer/buffered_task.ex
  4. 10
      apps/indexer/lib/indexer/fetcher/block_reward.ex
  5. 14
      apps/indexer/lib/indexer/fetcher/coin_balance.ex
  6. 3
      apps/indexer/lib/indexer/fetcher/contract_code.ex
  7. 11
      apps/indexer/lib/indexer/fetcher/internal_transaction.ex
  8. 3
      apps/indexer/lib/indexer/fetcher/replaced_transaction.ex
  9. 10
      apps/indexer/lib/indexer/fetcher/token.ex
  10. 14
      apps/indexer/lib/indexer/fetcher/token_balance.ex
  11. 11
      apps/indexer/lib/indexer/fetcher/token_instance/retry.ex
  12. 2
      apps/indexer/lib/indexer/fetcher/token_updater.ex
  13. 14
      apps/indexer/lib/indexer/fetcher/uncle_block.ex
  14. 7
      apps/indexer/lib/indexer/temporary/blocks_transactions_mismatch.ex
  15. 4
      apps/indexer/lib/indexer/temporary/uncles_without_index.ex
  16. 3
      apps/indexer/test/indexer/buffered_task_test.exs
  17. 3
      apps/indexer/test/support/indexer/fetcher/block_reward_supervisor_case.ex
  18. 3
      config/runtime.exs
  19. 1
      docker-compose/envs/common-blockscout.env
  20. 3
      docker/Makefile

@ -11,6 +11,7 @@
- [#7532](https://github.com/blockscout/blockscout/pull/7532) - Handle empty id in json rpc responses - [#7532](https://github.com/blockscout/blockscout/pull/7532) - Handle empty id in json rpc responses
- [#7544](https://github.com/blockscout/blockscout/pull/7544) - Add ERC-1155 signatures to uncataloged_token_transfer_block_numbers - [#7544](https://github.com/blockscout/blockscout/pull/7544) - Add ERC-1155 signatures to uncataloged_token_transfer_block_numbers
- [#7363](https://github.com/blockscout/blockscout/pull/7363) - CSV export filters - [#7363](https://github.com/blockscout/blockscout/pull/7363) - CSV export filters
- [#7697](https://github.com/blockscout/blockscout/pull/7697) - Limit fetchers init tasks
### Fixes ### Fixes

@ -2616,8 +2616,9 @@ defmodule Explorer.Chain do
@doc """ @doc """
Calls `reducer` on a stream of `t:Explorer.Chain.Block.t/0` without `t:Explorer.Chain.Block.Reward.t/0`. Calls `reducer` on a stream of `t:Explorer.Chain.Block.t/0` without `t:Explorer.Chain.Block.Reward.t/0`.
""" """
def stream_blocks_without_rewards(initial, reducer) when is_function(reducer, 2) do def stream_blocks_without_rewards(initial, reducer, limited? \\ false) when is_function(reducer, 2) do
Block.blocks_without_reward_query() Block.blocks_without_reward_query()
|> add_fetcher_limit(limited?)
|> Repo.stream_reduce(initial, reducer) |> Repo.stream_reduce(initial, reducer)
end end
@ -2827,10 +2828,11 @@ defmodule Explorer.Chain do
@spec stream_unfetched_balances( @spec stream_unfetched_balances(
initial :: accumulator, initial :: accumulator,
reducer :: reducer ::
(entry :: %{address_hash: Hash.Address.t(), block_number: Block.block_number()}, accumulator -> accumulator) (entry :: %{address_hash: Hash.Address.t(), block_number: Block.block_number()}, accumulator -> accumulator),
limited? :: boolean()
) :: {:ok, accumulator} ) :: {:ok, accumulator}
when accumulator: term() when accumulator: term()
def stream_unfetched_balances(initial, reducer) when is_function(reducer, 2) do def stream_unfetched_balances(initial, reducer, limited? \\ false) when is_function(reducer, 2) do
query = query =
from( from(
balance in CoinBalance, balance in CoinBalance,
@ -2838,7 +2840,9 @@ defmodule Explorer.Chain do
select: %{address_hash: balance.address_hash, block_number: balance.block_number} select: %{address_hash: balance.address_hash, block_number: balance.block_number}
) )
Repo.stream_reduce(query, initial, reducer) query
|> add_fetcher_limit(limited?)
|> Repo.stream_reduce(initial, reducer)
end end
@doc """ @doc """
@ -2846,11 +2850,13 @@ defmodule Explorer.Chain do
""" """
@spec stream_unfetched_token_balances( @spec stream_unfetched_token_balances(
initial :: accumulator, initial :: accumulator,
reducer :: (entry :: TokenBalance.t(), accumulator -> accumulator) reducer :: (entry :: TokenBalance.t(), accumulator -> accumulator),
limited? :: boolean()
) :: {:ok, accumulator} ) :: {:ok, accumulator}
when accumulator: term() when accumulator: term()
def stream_unfetched_token_balances(initial, reducer) when is_function(reducer, 2) do def stream_unfetched_token_balances(initial, reducer, limited? \\ false) when is_function(reducer, 2) do
TokenBalance.unfetched_token_balances() TokenBalance.unfetched_token_balances()
|> add_fetcher_limit(limited?)
|> Repo.stream_reduce(initial, reducer) |> Repo.stream_reduce(initial, reducer)
end end
@ -2872,10 +2878,12 @@ defmodule Explorer.Chain do
""" """
@spec stream_blocks_with_unfetched_internal_transactions( @spec stream_blocks_with_unfetched_internal_transactions(
initial :: accumulator, initial :: accumulator,
reducer :: (entry :: term(), accumulator -> accumulator) reducer :: (entry :: term(), accumulator -> accumulator),
limited? :: boolean()
) :: {:ok, accumulator} ) :: {:ok, accumulator}
when accumulator: term() when accumulator: term()
def stream_blocks_with_unfetched_internal_transactions(initial, reducer) when is_function(reducer, 2) do def stream_blocks_with_unfetched_internal_transactions(initial, reducer, limited? \\ false)
when is_function(reducer, 2) do
query = query =
from( from(
po in PendingBlockOperation, po in PendingBlockOperation,
@ -2883,7 +2891,9 @@ defmodule Explorer.Chain do
select: po.block_number select: po.block_number
) )
Repo.stream_reduce(query, initial, reducer) query
|> add_fetcher_limit(limited?)
|> Repo.stream_reduce(initial, reducer)
end end
def remove_nonconsensus_blocks_from_pending_ops(block_hashes) do def remove_nonconsensus_blocks_from_pending_ops(block_hashes) do
@ -2930,10 +2940,11 @@ defmodule Explorer.Chain do
| :value | :value
], ],
initial :: accumulator, initial :: accumulator,
reducer :: (entry :: term(), accumulator -> accumulator) reducer :: (entry :: term(), accumulator -> accumulator),
limited? :: boolean()
) :: {:ok, accumulator} ) :: {:ok, accumulator}
when accumulator: term() when accumulator: term()
def stream_transactions_with_unfetched_created_contract_codes(fields, initial, reducer) def stream_transactions_with_unfetched_created_contract_codes(fields, initial, reducer, limited? \\ false)
when is_function(reducer, 2) do when is_function(reducer, 2) do
query = query =
from(t in Transaction, from(t in Transaction,
@ -2943,7 +2954,9 @@ defmodule Explorer.Chain do
select: ^fields select: ^fields
) )
Repo.stream_reduce(query, initial, reducer) query
|> add_fetcher_limit(limited?)
|> Repo.stream_reduce(initial, reducer)
end end
@spec stream_mined_transactions( @spec stream_mined_transactions(
@ -2995,14 +3008,16 @@ defmodule Explorer.Chain do
| :value | :value
], ],
initial :: accumulator, initial :: accumulator,
reducer :: (entry :: term(), accumulator -> accumulator) reducer :: (entry :: term(), accumulator -> accumulator),
limited? :: boolean()
) :: {:ok, accumulator} ) :: {:ok, accumulator}
when accumulator: term() when accumulator: term()
def stream_pending_transactions(fields, initial, reducer) when is_function(reducer, 2) do def stream_pending_transactions(fields, initial, reducer, limited? \\ false) when is_function(reducer, 2) do
query = query =
Transaction Transaction
|> pending_transactions_query() |> pending_transactions_query()
|> select(^fields) |> select(^fields)
|> add_fetcher_limit(limited?)
Repo.stream_reduce(query, initial, reducer) Repo.stream_reduce(query, initial, reducer)
end end
@ -3017,17 +3032,20 @@ defmodule Explorer.Chain do
""" """
@spec stream_unfetched_uncles( @spec stream_unfetched_uncles(
initial :: accumulator, initial :: accumulator,
reducer :: (entry :: term(), accumulator -> accumulator) reducer :: (entry :: term(), accumulator -> accumulator),
limited? :: boolean()
) :: {:ok, accumulator} ) :: {:ok, accumulator}
when accumulator: term() when accumulator: term()
def stream_unfetched_uncles(initial, reducer) when is_function(reducer, 2) do def stream_unfetched_uncles(initial, reducer, limited? \\ false) when is_function(reducer, 2) do
query = query =
from(bsdr in Block.SecondDegreeRelation, from(bsdr in Block.SecondDegreeRelation,
where: is_nil(bsdr.uncle_fetched_at) and not is_nil(bsdr.index), where: is_nil(bsdr.uncle_fetched_at) and not is_nil(bsdr.index),
select: [:nephew_hash, :index] select: [:nephew_hash, :index]
) )
Repo.stream_reduce(query, initial, reducer) query
|> add_fetcher_limit(limited?)
|> Repo.stream_reduce(initial, reducer)
end end
@doc """ @doc """
@ -5017,10 +5035,12 @@ defmodule Explorer.Chain do
""" """
@spec stream_uncataloged_token_contract_address_hashes( @spec stream_uncataloged_token_contract_address_hashes(
initial :: accumulator, initial :: accumulator,
reducer :: (entry :: Hash.Address.t(), accumulator -> accumulator) reducer :: (entry :: Hash.Address.t(), accumulator -> accumulator),
limited? :: boolean()
) :: {:ok, accumulator} ) :: {:ok, accumulator}
when accumulator: term() when accumulator: term()
def stream_uncataloged_token_contract_address_hashes(initial, reducer) when is_function(reducer, 2) do def stream_uncataloged_token_contract_address_hashes(initial, reducer, limited? \\ false)
when is_function(reducer, 2) do
query = query =
from( from(
token in Token, token in Token,
@ -5028,7 +5048,9 @@ defmodule Explorer.Chain do
select: token.contract_address_hash select: token.contract_address_hash
) )
Repo.stream_reduce(query, initial, reducer) query
|> add_fetcher_limit(limited?)
|> Repo.stream_reduce(initial, reducer)
end end
@spec stream_unfetched_token_instances( @spec stream_unfetched_token_instances(
@ -5080,10 +5102,11 @@ defmodule Explorer.Chain do
@spec stream_token_instances_with_error( @spec stream_token_instances_with_error(
initial :: accumulator, initial :: accumulator,
reducer :: (entry :: map(), accumulator -> accumulator) reducer :: (entry :: map(), accumulator -> accumulator),
limited? :: boolean()
) :: {:ok, accumulator} ) :: {:ok, accumulator}
when accumulator: term() when accumulator: term()
def stream_token_instances_with_error(initial, reducer) when is_function(reducer, 2) do def stream_token_instances_with_error(initial, reducer, limited? \\ false) when is_function(reducer, 2) do
Instance Instance
|> where([instance], not is_nil(instance.error)) |> where([instance], not is_nil(instance.error))
|> select([instance], %{ |> select([instance], %{
@ -5091,6 +5114,7 @@ defmodule Explorer.Chain do
token_id: instance.token_id, token_id: instance.token_id,
updated_at: instance.updated_at updated_at: instance.updated_at
}) })
|> add_fetcher_limit(limited?)
|> Repo.stream_reduce(initial, reducer) |> Repo.stream_reduce(initial, reducer)
end end
@ -5099,13 +5123,16 @@ defmodule Explorer.Chain do
""" """
@spec stream_cataloged_token_contract_address_hashes( @spec stream_cataloged_token_contract_address_hashes(
initial :: accumulator, initial :: accumulator,
reducer :: (entry :: Hash.Address.t(), accumulator -> accumulator) reducer :: (entry :: Hash.Address.t(), accumulator -> accumulator),
some_time_ago_updated :: integer(),
limited? :: boolean()
) :: {:ok, accumulator} ) :: {:ok, accumulator}
when accumulator: term() when accumulator: term()
def stream_cataloged_token_contract_address_hashes(initial, reducer, some_time_ago_updated \\ 2880) def stream_cataloged_token_contract_address_hashes(initial, reducer, some_time_ago_updated \\ 2880, limited? \\ false)
when is_function(reducer, 2) do when is_function(reducer, 2) do
some_time_ago_updated some_time_ago_updated
|> Token.cataloged_tokens() |> Token.cataloged_tokens()
|> add_fetcher_limit(limited?)
|> order_by(asc: :updated_at) |> order_by(asc: :updated_at)
|> Repo.stream_reduce(initial, reducer) |> Repo.stream_reduce(initial, reducer)
end end
@ -6913,4 +6940,12 @@ defmodule Explorer.Chain do
def count_withdrawals_from_cache(options \\ []) do def count_withdrawals_from_cache(options \\ []) do
"withdrawals_count" |> get_last_fetched_counter(options) |> Decimal.add(1) "withdrawals_count" |> get_last_fetched_counter(options) |> Decimal.add(1)
end end
def add_fetcher_limit(query, false), do: query
def add_fetcher_limit(query, true) do
fetcher_limit = Application.get_env(:indexer, :fetcher_init_limit)
limit(query, ^fetcher_limit)
end
end end

@ -71,7 +71,7 @@ defmodule Indexer.BufferedTask do
flush_interval: nil, flush_interval: nil,
max_batch_size: nil, max_batch_size: nil,
max_concurrency: nil, max_concurrency: nil,
poll: false, poll: true,
metadata: [], metadata: [],
current_buffer: [], current_buffer: [],
bound_queue: %BoundQueue{}, bound_queue: %BoundQueue{},
@ -231,7 +231,7 @@ defmodule Indexer.BufferedTask do
state = %BufferedTask{ state = %BufferedTask{
callback_module: callback_module, callback_module: callback_module,
callback_module_state: Keyword.fetch!(opts, :state), callback_module_state: Keyword.fetch!(opts, :state),
poll: Keyword.get(opts, :poll, false), poll: Keyword.get(opts, :poll, true),
task_supervisor: Keyword.fetch!(opts, :task_supervisor), task_supervisor: Keyword.fetch!(opts, :task_supervisor),
flush_interval: Keyword.fetch!(opts, :flush_interval), flush_interval: Keyword.fetch!(opts, :flush_interval),
max_batch_size: Keyword.fetch!(opts, :max_batch_size), max_batch_size: Keyword.fetch!(opts, :max_batch_size),
@ -442,21 +442,8 @@ defmodule Indexer.BufferedTask do
end end
# get more work from `init/2` # get more work from `init/2`
defp schedule_next(%BufferedTask{poll: true, bound_queue: %BoundQueue{size: 0}} = state) do defp schedule_next(%BufferedTask{poll: true, bound_queue: %BoundQueue{size: 0}, task_ref_to_batch: tasks} = state)
do_initial_stream(state) when tasks == %{} do
end
# was shrunk and was out of work, get more work from `init/2`
defp schedule_next(%BufferedTask{bound_queue: %BoundQueue{size: 0, maximum_size: maximum_size}} = state)
when maximum_size != nil do
Logger.info(fn ->
[
"BufferedTask ",
process(self()),
" ran out of work, but work queue was shrunk to save memory, so restoring lost work from `c:init/2`."
]
end)
do_initial_stream(state) do_initial_stream(state)
end end

@ -62,9 +62,13 @@ defmodule Indexer.Fetcher.BlockReward do
@impl BufferedTask @impl BufferedTask
def init(initial, reducer, _) do def init(initial, reducer, _) do
{:ok, final} = {:ok, final} =
Chain.stream_blocks_without_rewards(initial, fn %{number: number}, acc -> Chain.stream_blocks_without_rewards(
reducer.(number, acc) initial,
end) fn %{number: number}, acc ->
reducer.(number, acc)
end,
true
)
final final
end end

@ -61,11 +61,15 @@ defmodule Indexer.Fetcher.CoinBalance do
@impl BufferedTask @impl BufferedTask
def init(initial, reducer, _) do def init(initial, reducer, _) do
{:ok, final} = {:ok, final} =
Chain.stream_unfetched_balances(initial, fn address_fields, acc -> Chain.stream_unfetched_balances(
address_fields initial,
|> entry() fn address_fields, acc ->
|> reducer.(acc) address_fields
end) |> entry()
|> reducer.(acc)
end,
true
)
final final
end end

@ -64,7 +64,8 @@ defmodule Indexer.Fetcher.ContractCode do
transaction_fields transaction_fields
|> entry() |> entry()
|> reducer.(acc) |> reducer.(acc)
end end,
true
) )
final final

@ -71,9 +71,13 @@ defmodule Indexer.Fetcher.InternalTransaction do
@impl BufferedTask @impl BufferedTask
def init(initial, reducer, _json_rpc_named_arguments) do def init(initial, reducer, _json_rpc_named_arguments) do
{:ok, final} = {:ok, final} =
Chain.stream_blocks_with_unfetched_internal_transactions(initial, fn block_number, acc -> Chain.stream_blocks_with_unfetched_internal_transactions(
reducer.(block_number, acc) initial,
end) fn block_number, acc ->
reducer.(block_number, acc)
end,
true
)
final final
end end
@ -349,7 +353,6 @@ defmodule Indexer.Fetcher.InternalTransaction do
flush_interval: :timer.seconds(3), flush_interval: :timer.seconds(3),
max_concurrency: Application.get_env(:indexer, __MODULE__)[:concurrency] || @default_max_concurrency, max_concurrency: Application.get_env(:indexer, __MODULE__)[:concurrency] || @default_max_concurrency,
max_batch_size: Application.get_env(:indexer, __MODULE__)[:batch_size] || @default_max_batch_size, max_batch_size: Application.get_env(:indexer, __MODULE__)[:batch_size] || @default_max_batch_size,
poll: true,
task_supervisor: Indexer.Fetcher.InternalTransaction.TaskSupervisor, task_supervisor: Indexer.Fetcher.InternalTransaction.TaskSupervisor,
metadata: [fetcher: :internal_transaction] metadata: [fetcher: :internal_transaction]
] ]

@ -61,7 +61,8 @@ defmodule Indexer.Fetcher.ReplacedTransaction do
transaction_fields transaction_fields
|> pending_entry() |> pending_entry()
|> reducer.(acc) |> reducer.(acc)
end end,
true
) )
final final

@ -42,9 +42,13 @@ defmodule Indexer.Fetcher.Token do
@impl BufferedTask @impl BufferedTask
def init(initial_acc, reducer, _) do def init(initial_acc, reducer, _) do
{:ok, acc} = {:ok, acc} =
Chain.stream_uncataloged_token_contract_address_hashes(initial_acc, fn address, acc -> Chain.stream_uncataloged_token_contract_address_hashes(
reducer.(address, acc) initial_acc,
end) fn address, acc ->
reducer.(address, acc)
end,
true
)
acc acc
end end

@ -69,11 +69,15 @@ defmodule Indexer.Fetcher.TokenBalance do
@impl BufferedTask @impl BufferedTask
def init(initial, reducer, _) do def init(initial, reducer, _) do
{:ok, final} = {:ok, final} =
Chain.stream_unfetched_token_balances(initial, fn token_balance, acc -> Chain.stream_unfetched_token_balances(
token_balance initial,
|> entry() fn token_balance, acc ->
|> reducer.(acc) token_balance
end) |> entry()
|> reducer.(acc)
end,
true
)
final final
end end

@ -29,9 +29,13 @@ defmodule Indexer.Fetcher.TokenInstance.Retry do
@impl BufferedTask @impl BufferedTask
def init(initial_acc, reducer, _) do def init(initial_acc, reducer, _) do
{:ok, acc} = {:ok, acc} =
Chain.stream_token_instances_with_error(initial_acc, fn data, acc -> Chain.stream_token_instances_with_error(
reducer.(data, acc) initial_acc,
end) fn data, acc ->
reducer.(data, acc)
end,
true
)
acc acc
end end
@ -54,7 +58,6 @@ defmodule Indexer.Fetcher.TokenInstance.Retry do
flush_interval: :timer.minutes(10), flush_interval: :timer.minutes(10),
max_concurrency: Application.get_env(:indexer, __MODULE__)[:concurrency] || @default_max_concurrency, max_concurrency: Application.get_env(:indexer, __MODULE__)[:concurrency] || @default_max_concurrency,
max_batch_size: @default_max_batch_size, max_batch_size: @default_max_batch_size,
poll: true,
task_supervisor: __MODULE__.TaskSupervisor task_supervisor: __MODULE__.TaskSupervisor
] ]
end end

@ -52,7 +52,7 @@ defmodule Indexer.Fetcher.TokenUpdater do
|> Duration.to_minutes() |> Duration.to_minutes()
|> trunc() |> trunc()
{:ok, tokens} = Chain.stream_cataloged_token_contract_address_hashes(initial, reducer, interval_in_minutes) {:ok, tokens} = Chain.stream_cataloged_token_contract_address_hashes(initial, reducer, interval_in_minutes, true)
tokens tokens
end end

@ -65,11 +65,15 @@ defmodule Indexer.Fetcher.UncleBlock do
@impl BufferedTask @impl BufferedTask
def init(initial, reducer, _) do def init(initial, reducer, _) do
{:ok, final} = {:ok, final} =
Chain.stream_unfetched_uncles(initial, fn uncle, acc -> Chain.stream_unfetched_uncles(
uncle initial,
|> entry() fn uncle, acc ->
|> reducer.(acc) uncle
end) |> entry()
|> reducer.(acc)
end,
true
)
final final
end end

@ -14,8 +14,8 @@ defmodule Indexer.Temporary.BlocksTransactionsMismatch do
import Ecto.Query import Ecto.Query
alias EthereumJSONRPC.Blocks alias EthereumJSONRPC.Blocks
alias Explorer.{Chain, Repo}
alias Explorer.Chain.Block alias Explorer.Chain.Block
alias Explorer.Repo
alias Explorer.Utility.MissingRangesManipulator alias Explorer.Utility.MissingRangesManipulator
alias Indexer.BufferedTask alias Indexer.BufferedTask
@ -58,7 +58,10 @@ defmodule Indexer.Temporary.BlocksTransactionsMismatch do
select: {block.hash, count(transactions.hash)} select: {block.hash, count(transactions.hash)}
) )
{:ok, final} = Repo.stream_reduce(query, initial, &reducer.(&1, &2)) {:ok, final} =
query
|> Chain.add_fetcher_limit(true)
|> Repo.stream_reduce(initial, &reducer.(&1, &2))
final final
end end

@ -58,7 +58,9 @@ defmodule Indexer.Temporary.UnclesWithoutIndex do
) )
{:ok, final} = {:ok, final} =
Repo.stream_reduce(query, initial, fn nephew_hash, acc -> query
|> Chain.add_fetcher_limit(true)
|> Repo.stream_reduce(initial, fn nephew_hash, acc ->
nephew_hash nephew_hash
|> to_string() |> to_string()
|> reducer.(acc) |> reducer.(acc)

@ -28,7 +28,8 @@ defmodule Indexer.BufferedTaskTest do
task_supervisor: BufferedTaskSup, task_supervisor: BufferedTaskSup,
flush_interval: @flush_interval, flush_interval: @flush_interval,
max_batch_size: max_batch_size, max_batch_size: max_batch_size,
max_concurrency: 2} max_concurrency: 2,
poll: false}
]} ]}
) )
end end

@ -7,7 +7,8 @@ defmodule Indexer.Fetcher.BlockReward.Supervisor.Case do
fetcher_arguments, fetcher_arguments,
flush_interval: 50, flush_interval: 50,
max_batch_size: 1, max_batch_size: 1,
max_concurrency: 1 max_concurrency: 1,
poll: false
) )
[merged_fetcher_arguments] [merged_fetcher_arguments]

@ -409,7 +409,8 @@ config :indexer,
memory_limit: ConfigHelper.indexer_memory_limit(), memory_limit: ConfigHelper.indexer_memory_limit(),
receipts_batch_size: ConfigHelper.parse_integer_env_var("INDEXER_RECEIPTS_BATCH_SIZE", 250), receipts_batch_size: ConfigHelper.parse_integer_env_var("INDEXER_RECEIPTS_BATCH_SIZE", 250),
receipts_concurrency: ConfigHelper.parse_integer_env_var("INDEXER_RECEIPTS_CONCURRENCY", 10), receipts_concurrency: ConfigHelper.parse_integer_env_var("INDEXER_RECEIPTS_CONCURRENCY", 10),
hide_indexing_progress_alert: ConfigHelper.parse_bool_env_var("INDEXER_HIDE_INDEXING_PROGRESS_ALERT") hide_indexing_progress_alert: ConfigHelper.parse_bool_env_var("INDEXER_HIDE_INDEXING_PROGRESS_ALERT"),
fetcher_init_limit: ConfigHelper.parse_integer_env_var("INDEXER_FETCHER_INIT_QUERY_LIMIT", 100)
config :indexer, Indexer.Supervisor, enabled: !ConfigHelper.parse_bool_env_var("DISABLE_INDEXER") config :indexer, Indexer.Supervisor, enabled: !ConfigHelper.parse_bool_env_var("DISABLE_INDEXER")

@ -120,6 +120,7 @@ INDEXER_DISABLE_INTERNAL_TRANSACTIONS_FETCHER=false
# INDEXER_TX_ACTIONS_REINDEX_PROTOCOLS= # INDEXER_TX_ACTIONS_REINDEX_PROTOCOLS=
# INDEXER_TX_ACTIONS_AAVE_V3_POOL_CONTRACT= # INDEXER_TX_ACTIONS_AAVE_V3_POOL_CONTRACT=
# INDEXER_REALTIME_FETCHER_MAX_GAP= # INDEXER_REALTIME_FETCHER_MAX_GAP=
# INDEXER_FETCHER_INIT_QUERY_LIMIT=
# INDEXER_DISABLE_WITHDRAWALS_FETCHER= # INDEXER_DISABLE_WITHDRAWALS_FETCHER=
# WITHDRAWALS_FIRST_BLOCK= # WITHDRAWALS_FIRST_BLOCK=
# TOKEN_ID_MIGRATION_FIRST_BLOCK= # TOKEN_ID_MIGRATION_FIRST_BLOCK=

@ -561,6 +561,9 @@ endif
ifdef INDEXER_REALTIME_FETCHER_MAX_GAP ifdef INDEXER_REALTIME_FETCHER_MAX_GAP
BLOCKSCOUT_CONTAINER_PARAMS += -e 'INDEXER_REALTIME_FETCHER_MAX_GAP=$(INDEXER_REALTIME_FETCHER_MAX_GAP)' BLOCKSCOUT_CONTAINER_PARAMS += -e 'INDEXER_REALTIME_FETCHER_MAX_GAP=$(INDEXER_REALTIME_FETCHER_MAX_GAP)'
endif endif
ifdef INDEXER_FETCHER_INIT_QUERY_LIMIT
BLOCKSCOUT_CONTAINER_PARAMS += -e 'INDEXER_FETCHER_INIT_QUERY_LIMIT=$(INDEXER_FETCHER_INIT_QUERY_LIMIT)'
endif
ifdef INDEXER_INTERNAL_TRANSACTIONS_TRACER_TYPE ifdef INDEXER_INTERNAL_TRANSACTIONS_TRACER_TYPE
BLOCKSCOUT_CONTAINER_PARAMS += -e 'INDEXER_INTERNAL_TRANSACTIONS_TRACER_TYPE=$(INDEXER_INTERNAL_TRANSACTIONS_TRACER_TYPE)' BLOCKSCOUT_CONTAINER_PARAMS += -e 'INDEXER_INTERNAL_TRANSACTIONS_TRACER_TYPE=$(INDEXER_INTERNAL_TRANSACTIONS_TRACER_TYPE)'
endif endif

Loading…
Cancel
Save