Skip to content
This repository has been archived by the owner on Feb 24, 2025. It is now read-only.

Commit

Permalink
Fix container init warnings (#722)
Browse files Browse the repository at this point in the history
* Manage indexer memory limit

Co-authored-by: Viktor Baranov <[email protected]>
  • Loading branch information
carterqw2 and vbaranov authored Aug 23, 2022
1 parent e338f75 commit 0e61052
Show file tree
Hide file tree
Showing 63 changed files with 99 additions and 81 deletions.
2 changes: 1 addition & 1 deletion .dialyzer-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ lib/explorer/smart_contract/reader.ex:478

lib/indexer/buffered_task.ex:402
lib/indexer/buffered_task.ex:451
lib/indexer/memory/monitor.ex:161
lib/indexer/memory/monitor.ex:160
lib/indexer/fetcher/internal_transaction.ex:235
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
- [#4582](https://github.com/blockscout/blockscout/pull/4582) - Fix NaN input on write contract page

### Chore
- [#5369](https://github.com/blockscout/blockscout/pull/5369) - Manage indexer memory limit
- [#4707](https://github.com/blockscout/blockscout/pull/4707) - Top navigation: Move Accounts tab to Tokens
- [#4704](https://github.com/blockscout/blockscout/pull/4704) - Update to Erlang/OTP 24
- [#4682](https://github.com/blockscout/blockscout/pull/4682) - Update all possible outdated mix dependencies
Expand Down Expand Up @@ -1456,4 +1457,4 @@ Reverting of synchronous block counter, implemented in #1848
### Chore
- [https://github.com/blockscout/blockscout/pull/1532](https://github.com/blockscout/blockscout/pull/1532) - Upgrade elixir to 1.8.1
- [https://github.com/blockscout/blockscout/pull/1553](https://github.com/blockscout/blockscout/pull/1553) - Dockerfile: remove 1.7.1 version pin FROM bitwalker/alpine-elixir-phoenix
- [https://github.com/blockscout/blockscout/pull/1465](https://github.com/blockscout/blockscout/pull/1465) - Resolve lodash security alert
- [https://github.com/blockscout/blockscout/pull/1465](https://github.com/blockscout/blockscout/pull/1465) - Resolve lodash security alert
10 changes: 5 additions & 5 deletions apps/block_scout_web/config/config.exs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# This file is responsible for configuring your application
# and its dependencies with the aid of the Mix.Config module.
# and its dependencies with the aid of the Config module.
#
# This configuration file is loaded before any dependency and
# is restricted to this project.
use Mix.Config
import Config

alias BlockScoutWeb.LoggerBackend

Expand Down Expand Up @@ -166,8 +166,8 @@ config :block_scout_web, BlockScoutWeb.ApiRouter,

config :block_scout_web, BlockScoutWeb.WebRouter, enabled: System.get_env("DISABLE_WEBAPP") != "true"

config :prometheus, BlockScoutWeb.Prometheus.Exporter, path: "/metrics/web"

# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
import_config "#{Mix.env()}.exs"

config :prometheus, BlockScoutWeb.Prometheus.Exporter, path: "/metrics/web"
import_config "#{config_env()}.exs"
2 changes: 1 addition & 1 deletion apps/block_scout_web/config/dev.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

# For development, we disable any cache and enable
# debugging and code reloading.
Expand Down
2 changes: 1 addition & 1 deletion apps/block_scout_web/config/prod.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

# For production, we often load configuration from external
# sources, such as your system environment. For this reason,
Expand Down
2 changes: 1 addition & 1 deletion apps/block_scout_web/config/test.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :block_scout_web, :sql_sandbox, true

Expand Down
4 changes: 2 additions & 2 deletions apps/ethereum_jsonrpc/config/config.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :ethereum_jsonrpc, EthereumJSONRPC.RequestCoordinator,
rolling_window_opts: [
Expand Down Expand Up @@ -46,4 +46,4 @@ config :ethereum_jsonrpc, :internal_transaction_timeout, "900s"

# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
import_config "#{Mix.env()}.exs"
import_config "#{config_env()}.exs"
2 changes: 1 addition & 1 deletion apps/ethereum_jsonrpc/config/dev.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :ethereum_jsonrpc, EthereumJSONRPC.Tracer, env: "dev", disabled?: true

Expand Down
2 changes: 1 addition & 1 deletion apps/ethereum_jsonrpc/config/prod.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :ethereum_jsonrpc, EthereumJSONRPC.Tracer, env: "production", disabled?: true

Expand Down
2 changes: 1 addition & 1 deletion apps/ethereum_jsonrpc/config/test.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :ethereum_jsonrpc, EthereumJSONRPC.RequestCoordinator,
rolling_window_opts: [
Expand Down
6 changes: 3 additions & 3 deletions apps/explorer/config/config.exs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# This file is responsible for configuring your application
# and its dependencies with the aid of the Mix.Config module.
# and its dependencies with the aid of the Config module.
#
# This configuration file is loaded before any dependency and
# is restricted to this project.
use Mix.Config
import Config

# General application configuration
config :explorer,
Expand Down Expand Up @@ -293,4 +293,4 @@ config :explorer, Explorer.ThirdPartyIntegrations.Sourcify,

# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
import_config "#{Mix.env()}.exs"
import_config "#{config_env()}.exs"
2 changes: 1 addition & 1 deletion apps/explorer/config/dev.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

database = if System.get_env("DATABASE_URL"), do: nil, else: "explorer_dev"
hostname = if System.get_env("DATABASE_URL"), do: nil, else: "localhost"
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/config/dev/arbitrum.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :explorer,
json_rpc_named_arguments: [
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/config/dev/besu.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :explorer,
json_rpc_named_arguments: [
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/config/dev/ganache.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :explorer,
json_rpc_named_arguments: [
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/config/dev/geth.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :explorer,
json_rpc_named_arguments: [
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/config/dev/parity.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :explorer,
json_rpc_named_arguments: [
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/config/dev/rsk.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :explorer,
json_rpc_named_arguments: [
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/config/prod.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

# Configures the database
config :explorer, Explorer.Repo,
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/config/prod/arbitrum.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :explorer,
json_rpc_named_arguments: [
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/config/prod/besu.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :explorer,
json_rpc_named_arguments: [
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/config/prod/ganache.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :explorer,
json_rpc_named_arguments: [
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/config/prod/geth.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :explorer,
json_rpc_named_arguments: [
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/config/prod/parity.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :explorer,
json_rpc_named_arguments: [
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/config/prod/rsk.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :explorer,
json_rpc_named_arguments: [
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/config/test.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

# Lower hashing rounds for faster tests
config :bcrypt_elixir, log_rounds: 4
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/config/test/arbitrum.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :explorer,
json_rpc_named_arguments: [
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/config/test/besu.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :explorer,
transport: EthereumJSONRPC.HTTP,
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/config/test/ganache.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :explorer,
json_rpc_named_arguments: [
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/config/test/geth.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :explorer,
json_rpc_named_arguments: [
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/config/test/parity.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :explorer,
transport: EthereumJSONRPC.HTTP,
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/config/test/rsk.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :explorer,
transport: EthereumJSONRPC.HTTP,
Expand Down
16 changes: 6 additions & 10 deletions apps/indexer/config/config.exs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# This file is responsible for configuring your application
# and its dependencies with the aid of the Mix.Config module.
use Mix.Config

import Bitwise
# and its dependencies with the aid of the Config module.
import Config

alias Indexer.LoggerBackend

Expand Down Expand Up @@ -43,8 +41,6 @@ config :indexer,
ecto_repos: [Explorer.Repo],
metadata_updater_seconds_interval:
String.to_integer(System.get_env("TOKEN_METADATA_UPDATE_INTERVAL") || "#{10 * 60 * 60}"),
# bytes
memory_limit: 1 <<< 30,
health_check_port: port || 4001,
first_block: System.get_env("FIRST_BLOCK") || "",
last_block: System.get_env("LAST_BLOCK") || "",
Expand Down Expand Up @@ -98,10 +94,6 @@ config :indexer, Indexer.Block.Fetcher, enable_gold_token: true
config :indexer, Indexer.Prometheus.MetricsCron, metrics_fetcher_blocks_count: 1000
config :indexer, Indexer.Prometheus.MetricsCron, metrics_cron_interval: System.get_env("METRICS_CRON_INTERVAL") || "2"

# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
import_config "#{Mix.env()}.exs"

config :prometheus, Indexer.Prometheus.Exporter,
path: "/metrics/indexer",
format: :text,
Expand All @@ -121,3 +113,7 @@ config :indexer, Indexer.Fetcher.EmptyBlocksSanitizer.Supervisor,
disabled?: System.get_env("INDEXER_DISABLE_EMPTY_BLOCK_SANITIZER", "false") == "true"

config :indexer, Indexer.Fetcher.EmptyBlocksSanitizer, batch_size: indexer_empty_blocks_sanitizer_batch_size

# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
import_config "#{config_env()}.exs"
2 changes: 1 addition & 1 deletion apps/indexer/config/dev.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :indexer, Indexer.Tracer, env: "dev", disabled?: true

Expand Down
2 changes: 1 addition & 1 deletion apps/indexer/config/dev/arbitrum.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :indexer,
block_interval: :timer.seconds(5),
Expand Down
2 changes: 1 addition & 1 deletion apps/indexer/config/dev/besu.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :indexer,
block_interval: :timer.seconds(5),
Expand Down
2 changes: 1 addition & 1 deletion apps/indexer/config/dev/ganache.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :indexer,
block_interval: :timer.seconds(5),
Expand Down
2 changes: 1 addition & 1 deletion apps/indexer/config/dev/geth.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :indexer,
block_interval: :timer.seconds(5),
Expand Down
2 changes: 1 addition & 1 deletion apps/indexer/config/dev/parity.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :indexer,
block_interval: :timer.seconds(5),
Expand Down
2 changes: 1 addition & 1 deletion apps/indexer/config/dev/rsk.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :indexer,
block_interval: :timer.seconds(5),
Expand Down
2 changes: 1 addition & 1 deletion apps/indexer/config/prod.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :indexer, Indexer.Tracer, env: "production", disabled?: true

Expand Down
2 changes: 1 addition & 1 deletion apps/indexer/config/prod/arbitrum.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :indexer,
block_interval: :timer.seconds(5),
Expand Down
2 changes: 1 addition & 1 deletion apps/indexer/config/prod/besu.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :indexer,
block_interval: :timer.seconds(5),
Expand Down
2 changes: 1 addition & 1 deletion apps/indexer/config/prod/ganache.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :indexer,
block_interval: :timer.seconds(5),
Expand Down
2 changes: 1 addition & 1 deletion apps/indexer/config/prod/geth.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :indexer,
block_interval: :timer.seconds(5),
Expand Down
2 changes: 1 addition & 1 deletion apps/indexer/config/prod/parity.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :indexer,
block_interval: :timer.seconds(5),
Expand Down
2 changes: 1 addition & 1 deletion apps/indexer/config/prod/rsk.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :indexer,
block_interval: :timer.seconds(5),
Expand Down
2 changes: 1 addition & 1 deletion apps/indexer/config/test.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :indexer, Indexer.Tracer, disabled?: false

Expand Down
2 changes: 1 addition & 1 deletion apps/indexer/config/test/arbitrum.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :indexer,
json_rpc_named_arguments: [
Expand Down
2 changes: 1 addition & 1 deletion apps/indexer/config/test/besu.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :indexer,
json_rpc_named_arguments: [
Expand Down
2 changes: 1 addition & 1 deletion apps/indexer/config/test/ganache.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :indexer,
json_rpc_named_arguments: [
Expand Down
2 changes: 1 addition & 1 deletion apps/indexer/config/test/geth.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :indexer,
json_rpc_named_arguments: [
Expand Down
2 changes: 1 addition & 1 deletion apps/indexer/config/test/parity.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :indexer,
json_rpc_named_arguments: [
Expand Down
Loading

0 comments on commit 0e61052

Please sign in to comment.