chore: Run shrink internal transactions migration for indexer instance only (#10631)

vb-exclude-system-transactions-from-replaced-txs-indexer
Qwerty5Uiop 3 months ago committed by GitHub
parent 6789774764
commit 2ddac132d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 10
      apps/explorer/lib/explorer/application.ex
  2. 5
      config/config_helper.exs
  3. 1
      config/runtime.exs

@ -143,7 +143,7 @@ defmodule Explorer.Application do
configure(Explorer.Migrator.TokenTransferBlockConsensus), configure(Explorer.Migrator.TokenTransferBlockConsensus),
configure(Explorer.Migrator.RestoreOmittedWETHTransfers), configure(Explorer.Migrator.RestoreOmittedWETHTransfers),
configure_chain_type_dependent_process(Explorer.Chain.Cache.StabilityValidatorsCounters, :stability), configure_chain_type_dependent_process(Explorer.Chain.Cache.StabilityValidatorsCounters, :stability),
configure(Explorer.Migrator.ShrinkInternalTransactions) configure_mode_dependent_process(Explorer.Migrator.ShrinkInternalTransactions, :indexer)
] ]
|> List.flatten() |> List.flatten()
@ -209,6 +209,14 @@ defmodule Explorer.Application do
end end
end end
defp configure_mode_dependent_process(process, mode) do
if Application.get_env(:explorer, :mode) in [mode, :all] do
process
else
[]
end
end
defp sc_microservice_configure(process) do defp sc_microservice_configure(process) do
if Application.get_env(:explorer, Explorer.SmartContract.RustVerifierInterfaceBehaviour)[:eth_bytecode_db?] do if Application.get_env(:explorer, Explorer.SmartContract.RustVerifierInterfaceBehaviour)[:eth_bytecode_db?] do
process process

@ -322,6 +322,11 @@ defmodule ConfigHelper do
@spec chain_type() :: atom() | nil @spec chain_type() :: atom() | nil
def chain_type, do: parse_catalog_value("CHAIN_TYPE", @supported_chain_types, true, "default") def chain_type, do: parse_catalog_value("CHAIN_TYPE", @supported_chain_types, true, "default")
@supported_modes ["all", "indexer", "api"]
@spec mode :: atom()
def mode, do: parse_catalog_value("MODE", @supported_modes, true, "all")
@spec eth_call_url(String.t() | nil) :: String.t() | nil @spec eth_call_url(String.t() | nil) :: String.t() | nil
def eth_call_url(default \\ nil) do def eth_call_url(default \\ nil) do
System.get_env("ETHEREUM_JSONRPC_ETH_CALL_URL") || System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || default System.get_env("ETHEREUM_JSONRPC_ETH_CALL_URL") || System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || default

@ -218,6 +218,7 @@ checksum_function = System.get_env("CHECKSUM_FUNCTION")
exchange_rates_coin = System.get_env("EXCHANGE_RATES_COIN") exchange_rates_coin = System.get_env("EXCHANGE_RATES_COIN")
config :explorer, config :explorer,
mode: ConfigHelper.mode(),
coin: System.get_env("COIN") || exchange_rates_coin || "ETH", coin: System.get_env("COIN") || exchange_rates_coin || "ETH",
coin_name: System.get_env("COIN_NAME") || exchange_rates_coin || "ETH", coin_name: System.get_env("COIN_NAME") || exchange_rates_coin || "ETH",
allowed_solidity_evm_versions: allowed_solidity_evm_versions:

Loading…
Cancel
Save