diff --git a/CHANGELOG.md b/CHANGELOG.md index 83423c34d7..4001e6126d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - [#7393](https://github.com/blockscout/blockscout/pull/7393) - Realtime fetcher max gap - [#7436](https://github.com/blockscout/blockscout/pull/7436) - TokenBalanceOnDemand ERC-1155 support - [#7469](https://github.com/blockscout/blockscout/pull/7469), [#7485](https://github.com/blockscout/blockscout/pull/7485) - Clear missing block ranges after every success import +- [#7489](https://github.com/blockscout/blockscout/pull/7489) - INDEXER_CATCHUP_BLOCK_INTERVAL env var ### Fixes diff --git a/apps/indexer/config/dev/arbitrum.exs b/apps/indexer/config/dev/arbitrum.exs index 8fbea1bc95..18125586af 100644 --- a/apps/indexer/config/dev/arbitrum.exs +++ b/apps/indexer/config/dev/arbitrum.exs @@ -8,7 +8,7 @@ hackney_opts = ConfigHelper.hackney_options() timeout = ConfigHelper.timeout(1) config :indexer, - block_interval: :timer.seconds(5), + block_interval: ConfigHelper.parse_time_env_var("INDEXER_CATCHUP_BLOCK_INTERVAL", "5s"), json_rpc_named_arguments: [ transport: if(System.get_env("ETHEREUM_JSONRPC_TRANSPORT", "http") == "http", diff --git a/apps/indexer/config/dev/besu.exs b/apps/indexer/config/dev/besu.exs index 45f7a1a34a..9e615bd8ec 100644 --- a/apps/indexer/config/dev/besu.exs +++ b/apps/indexer/config/dev/besu.exs @@ -8,7 +8,7 @@ hackney_opts = ConfigHelper.hackney_options() timeout = ConfigHelper.timeout(10) config :indexer, - block_interval: :timer.seconds(5), + block_interval: ConfigHelper.parse_time_env_var("INDEXER_CATCHUP_BLOCK_INTERVAL", "5s"), json_rpc_named_arguments: [ transport: if(System.get_env("ETHEREUM_JSONRPC_TRANSPORT", "http") == "http", diff --git a/apps/indexer/config/dev/erigon.exs b/apps/indexer/config/dev/erigon.exs index f9d0507a8e..e764ad6666 100644 --- a/apps/indexer/config/dev/erigon.exs +++ b/apps/indexer/config/dev/erigon.exs @@ -8,7 +8,7 @@ hackney_opts = ConfigHelper.hackney_options() timeout = ConfigHelper.timeout(10) config :indexer, - block_interval: :timer.seconds(5), + block_interval: ConfigHelper.parse_time_env_var("INDEXER_CATCHUP_BLOCK_INTERVAL", "5s"), json_rpc_named_arguments: [ transport: if(System.get_env("ETHEREUM_JSONRPC_TRANSPORT", "http") == "http", diff --git a/apps/indexer/config/dev/ganache.exs b/apps/indexer/config/dev/ganache.exs index 4480c411da..be2cd745b1 100644 --- a/apps/indexer/config/dev/ganache.exs +++ b/apps/indexer/config/dev/ganache.exs @@ -8,7 +8,7 @@ hackney_opts = ConfigHelper.hackney_options() timeout = ConfigHelper.timeout(1) config :indexer, - block_interval: :timer.seconds(5), + block_interval: ConfigHelper.parse_time_env_var("INDEXER_CATCHUP_BLOCK_INTERVAL", "5s"), json_rpc_named_arguments: [ transport: if(System.get_env("ETHEREUM_JSONRPC_TRANSPORT", "http") == "http", diff --git a/apps/indexer/config/dev/geth.exs b/apps/indexer/config/dev/geth.exs index c5f0b997e6..87b9dbe906 100644 --- a/apps/indexer/config/dev/geth.exs +++ b/apps/indexer/config/dev/geth.exs @@ -8,7 +8,7 @@ hackney_opts = ConfigHelper.hackney_options() timeout = ConfigHelper.timeout(1) config :indexer, - block_interval: :timer.seconds(5), + block_interval: ConfigHelper.parse_time_env_var("INDEXER_CATCHUP_BLOCK_INTERVAL", "5s"), json_rpc_named_arguments: [ transport: if(System.get_env("ETHEREUM_JSONRPC_TRANSPORT", "http") == "http", diff --git a/apps/indexer/config/dev/nethermind.exs b/apps/indexer/config/dev/nethermind.exs index a5d4f9df8f..aae43f57d8 100644 --- a/apps/indexer/config/dev/nethermind.exs +++ b/apps/indexer/config/dev/nethermind.exs @@ -8,7 +8,7 @@ hackney_opts = ConfigHelper.hackney_options() timeout = ConfigHelper.timeout(10) config :indexer, - block_interval: :timer.seconds(5), + block_interval: ConfigHelper.parse_time_env_var("INDEXER_CATCHUP_BLOCK_INTERVAL", "5s"), json_rpc_named_arguments: [ transport: if(System.get_env("ETHEREUM_JSONRPC_TRANSPORT", "http") == "http", diff --git a/apps/indexer/config/dev/rsk.exs b/apps/indexer/config/dev/rsk.exs index ce0e8b4803..6e9697be05 100644 --- a/apps/indexer/config/dev/rsk.exs +++ b/apps/indexer/config/dev/rsk.exs @@ -8,7 +8,7 @@ hackney_opts = ConfigHelper.hackney_options() timeout = ConfigHelper.timeout(10) config :indexer, - block_interval: :timer.seconds(5), + block_interval: ConfigHelper.parse_time_env_var("INDEXER_CATCHUP_BLOCK_INTERVAL", "5s"), blocks_concurrency: 1, receipts_concurrency: 1, json_rpc_named_arguments: [ diff --git a/apps/indexer/config/prod/arbitrum.exs b/apps/indexer/config/prod/arbitrum.exs index 5d4d2fa1ee..cef49883b4 100644 --- a/apps/indexer/config/prod/arbitrum.exs +++ b/apps/indexer/config/prod/arbitrum.exs @@ -8,7 +8,7 @@ hackney_opts = ConfigHelper.hackney_options() timeout = ConfigHelper.timeout(5) config :indexer, - block_interval: :timer.seconds(5), + block_interval: ConfigHelper.parse_time_env_var("INDEXER_CATCHUP_BLOCK_INTERVAL", "5s"), json_rpc_named_arguments: [ transport: if(System.get_env("ETHEREUM_JSONRPC_TRANSPORT", "http") == "http", diff --git a/apps/indexer/config/prod/besu.exs b/apps/indexer/config/prod/besu.exs index 0e8834962b..184f80b408 100644 --- a/apps/indexer/config/prod/besu.exs +++ b/apps/indexer/config/prod/besu.exs @@ -8,7 +8,7 @@ hackney_opts = ConfigHelper.hackney_options() timeout = ConfigHelper.timeout(10) config :indexer, - block_interval: :timer.seconds(5), + block_interval: ConfigHelper.parse_time_env_var("INDEXER_CATCHUP_BLOCK_INTERVAL", "5s"), json_rpc_named_arguments: [ transport: if(System.get_env("ETHEREUM_JSONRPC_TRANSPORT", "http") == "http", diff --git a/apps/indexer/config/prod/erigon.exs b/apps/indexer/config/prod/erigon.exs index eb5a9c4bf3..b608c36cd1 100644 --- a/apps/indexer/config/prod/erigon.exs +++ b/apps/indexer/config/prod/erigon.exs @@ -8,7 +8,7 @@ hackney_opts = ConfigHelper.hackney_options() timeout = ConfigHelper.timeout(10) config :indexer, - block_interval: :timer.seconds(5), + block_interval: ConfigHelper.parse_time_env_var("INDEXER_CATCHUP_BLOCK_INTERVAL", "5s"), json_rpc_named_arguments: [ transport: if(System.get_env("ETHEREUM_JSONRPC_TRANSPORT", "http") == "http", diff --git a/apps/indexer/config/prod/ganache.exs b/apps/indexer/config/prod/ganache.exs index 4480c411da..be2cd745b1 100644 --- a/apps/indexer/config/prod/ganache.exs +++ b/apps/indexer/config/prod/ganache.exs @@ -8,7 +8,7 @@ hackney_opts = ConfigHelper.hackney_options() timeout = ConfigHelper.timeout(1) config :indexer, - block_interval: :timer.seconds(5), + block_interval: ConfigHelper.parse_time_env_var("INDEXER_CATCHUP_BLOCK_INTERVAL", "5s"), json_rpc_named_arguments: [ transport: if(System.get_env("ETHEREUM_JSONRPC_TRANSPORT", "http") == "http", diff --git a/apps/indexer/config/prod/geth.exs b/apps/indexer/config/prod/geth.exs index 5baff8a66b..f0b57f9b90 100644 --- a/apps/indexer/config/prod/geth.exs +++ b/apps/indexer/config/prod/geth.exs @@ -8,7 +8,7 @@ hackney_opts = ConfigHelper.hackney_options() timeout = ConfigHelper.timeout(10) config :indexer, - block_interval: :timer.seconds(5), + block_interval: ConfigHelper.parse_time_env_var("INDEXER_CATCHUP_BLOCK_INTERVAL", "5s"), json_rpc_named_arguments: [ transport: if(System.get_env("ETHEREUM_JSONRPC_TRANSPORT", "http") == "http", diff --git a/apps/indexer/config/prod/nethermind.exs b/apps/indexer/config/prod/nethermind.exs index ba0bb739fc..04ff07c88d 100644 --- a/apps/indexer/config/prod/nethermind.exs +++ b/apps/indexer/config/prod/nethermind.exs @@ -8,7 +8,7 @@ hackney_opts = ConfigHelper.hackney_options() timeout = ConfigHelper.timeout() config :indexer, - block_interval: :timer.seconds(5), + block_interval: ConfigHelper.parse_time_env_var("INDEXER_CATCHUP_BLOCK_INTERVAL", "5s"), json_rpc_named_arguments: [ transport: if(System.get_env("ETHEREUM_JSONRPC_TRANSPORT", "http") == "http", diff --git a/apps/indexer/config/prod/rsk.exs b/apps/indexer/config/prod/rsk.exs index e4fb20670c..4b0a388ddb 100644 --- a/apps/indexer/config/prod/rsk.exs +++ b/apps/indexer/config/prod/rsk.exs @@ -8,7 +8,7 @@ hackney_opts = ConfigHelper.hackney_options() timeout = ConfigHelper.timeout(10) config :indexer, - block_interval: :timer.seconds(5), + block_interval: ConfigHelper.parse_time_env_var("INDEXER_CATCHUP_BLOCK_INTERVAL", "5s"), blocks_concurrency: 1, receipts_concurrency: 1, json_rpc_named_arguments: [ diff --git a/docker-compose/envs/common-blockscout.env b/docker-compose/envs/common-blockscout.env index 8ae691f040..5f67ecace9 100644 --- a/docker-compose/envs/common-blockscout.env +++ b/docker-compose/envs/common-blockscout.env @@ -98,6 +98,7 @@ INDEXER_DISABLE_PENDING_TRANSACTIONS_FETCHER=false INDEXER_DISABLE_INTERNAL_TRANSACTIONS_FETCHER=false # INDEXER_CATCHUP_BLOCKS_BATCH_SIZE= # INDEXER_CATCHUP_BLOCKS_CONCURRENCY= +# INDEXER_CATCHUP_BLOCK_INTERVAL= # INDEXER_INTERNAL_TRANSACTIONS_BATCH_SIZE= # INDEXER_INTERNAL_TRANSACTIONS_CONCURRENCY= # INDEXER_BLOCK_REWARD_BATCH_SIZE= diff --git a/docker/Makefile b/docker/Makefile index b387955076..38ec63358e 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -513,6 +513,9 @@ endif ifdef INDEXER_CATCHUP_BLOCKS_CONCURRENCY BLOCKSCOUT_CONTAINER_PARAMS += -e 'INDEXER_CATCHUP_BLOCKS_CONCURRENCY=$(INDEXER_CATCHUP_BLOCKS_CONCURRENCY)' endif +ifdef INDEXER_CATCHUP_BLOCK_INTERVAL + BLOCKSCOUT_CONTAINER_PARAMS += -e 'INDEXER_CATCHUP_BLOCK_INTERVAL=$(INDEXER_CATCHUP_BLOCK_INTERVAL)' +endif ifdef INDEXER_INTERNAL_TRANSACTIONS_BATCH_SIZE BLOCKSCOUT_CONTAINER_PARAMS += -e 'INDEXER_INTERNAL_TRANSACTIONS_BATCH_SIZE=$(INDEXER_INTERNAL_TRANSACTIONS_BATCH_SIZE)' endif