Internal transaction fetcher envs

pull/6450/head
Qwerty5Uiop 2 years ago
parent 40cd801270
commit bfd8e9df8b
  1. 1
      CHANGELOG.md
  2. 25
      apps/indexer/lib/indexer/fetcher/internal_transaction.ex
  3. 10
      config/runtime.exs
  4. 2
      docker-compose/envs/common-blockscout.env
  5. 6
      docker/Makefile

@ -17,6 +17,7 @@
- [#6257](https://github.com/blockscout/blockscout/pull/6257), [#6276](https://github.com/blockscout/blockscout/pull/6276) - DISABLE_TOKEN_INSTANCE_FETCHER env variable
- [#6391](https://github.com/blockscout/blockscout/pull/6391), [#6427](https://github.com/blockscout/blockscout/pull/6427) - TokenTransfer token_id -> token_ids migration
- [#6443](https://github.com/blockscout/blockscout/pull/6443) - Drop internal transactions order index
- [#6450](https://github.com/blockscout/blockscout/pull/6450) - INDEXER_INTERNAL_TRANSACTIONS_BATCH_SIZE and INDEXER_INTERNAL_TRANSACTIONS_CONCURRENCY env variables
### Fixes

@ -21,16 +21,8 @@ defmodule Indexer.Fetcher.InternalTransaction do
@behaviour BufferedTask
@max_batch_size 10
@max_concurrency 4
@defaults [
flush_interval: :timer.seconds(3),
max_concurrency: @max_concurrency,
max_batch_size: @max_batch_size,
poll: true,
task_supervisor: Indexer.Fetcher.InternalTransaction.TaskSupervisor,
metadata: [fetcher: :internal_transaction]
]
@default_max_batch_size 10
@default_max_concurrency 4
@doc """
Asynchronously fetches internal transactions.
@ -68,7 +60,7 @@ defmodule Indexer.Fetcher.InternalTransaction do
end
merged_init_opts =
@defaults
defaults()
|> Keyword.merge(mergeable_init_options)
|> Keyword.put(:state, state)
@ -273,4 +265,15 @@ defmodule Indexer.Fetcher.InternalTransaction do
end
end)
end
defp defaults do
[
flush_interval: :timer.seconds(3),
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,
poll: true,
task_supervisor: Indexer.Fetcher.InternalTransaction.TaskSupervisor,
metadata: [fetcher: :internal_transaction]
]
end
end

@ -467,6 +467,16 @@ config :indexer, Indexer.Block.Catchup.Fetcher,
batch_size: blocks_catchup_fetcher_batch_size,
concurrency: blocks_catchup_fetcher_concurrency
{internal_transaction_fetcher_batch_size, _} =
Integer.parse(System.get_env("INDEXER_INTERNAL_TRANSACTIONS_BATCH_SIZE", "10"))
{internal_transaction_fetcher_concurrency, _} =
Integer.parse(System.get_env("INDEXER_INTERNAL_TRANSACTIONS_CONCURRENCY", "4"))
config :indexer, Indexer.Fetcher.InternalTransaction,
batch_size: internal_transaction_fetcher_batch_size,
concurrency: internal_transaction_fetcher_concurrency
Code.require_file("#{config_env()}.exs", "config/runtime")
for config <- "../apps/*/config/runtime/#{config_env()}.exs" |> Path.expand(__DIR__) |> Path.wildcard() do

@ -84,6 +84,8 @@ INDEXER_DISABLE_PENDING_TRANSACTIONS_FETCHER=false
INDEXER_DISABLE_INTERNAL_TRANSACTIONS_FETCHER=false
# INDEXER_CATCHUP_BLOCKS_BATCH_SIZE=
# INDEXER_CATCHUP_BLOCKS_CONCURRENCY=
# INDEXER_INTERNAL_TRANSACTIONS_BATCH_SIZE=
# INDEXER_INTERNAL_TRANSACTIONS_CONCURRENCY=
# TOKEN_ID_MIGRATION_FIRST_BLOCK=
# TOKEN_ID_MIGRATION_CONCURRENCY=
# TOKEN_ID_MIGRATION_BATCH_SIZE=

@ -454,6 +454,12 @@ endif
ifdef INDEXER_CATCHUP_BLOCKS_CONCURRENCY
BLOCKSCOUT_CONTAINER_PARAMS += -e 'INDEXER_CATCHUP_BLOCKS_CONCURRENCY=$(INDEXER_CATCHUP_BLOCKS_CONCURRENCY)'
endif
ifdef INDEXER_INTERNAL_TRANSACTIONS_BATCH_SIZE
BLOCKSCOUT_CONTAINER_PARAMS += -e 'INDEXER_INTERNAL_TRANSACTIONS_BATCH_SIZE=$(INDEXER_INTERNAL_TRANSACTIONS_BATCH_SIZE)'
endif
ifdef INDEXER_INTERNAL_TRANSACTIONS_CONCURRENCY
BLOCKSCOUT_CONTAINER_PARAMS += -e 'INDEXER_INTERNAL_TRANSACTIONS_CONCURRENCY=$(INDEXER_INTERNAL_TRANSACTIONS_CONCURRENCY)'
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

Loading…
Cancel
Save