Add EIP_1559_ELASTICITY_MULTIPLIER env

np-move-elasticity-multiplier-to-envs
Nikita Pozdniakov 2 years ago
parent 3633b7d273
commit 49403df531
No known key found for this signature in database
GPG Key ID: F344106F9804FE5F
  1. 2
      apps/block_scout_web/lib/block_scout_web/views/api/v2/block_view.ex
  2. 3
      config/runtime.exs
  3. 1
      docker-compose/envs/common-blockscout.env
  4. 3
      docker/Makefile

@ -84,7 +84,7 @@ defmodule BlockScoutWeb.API.V2.BlockView do
end end
def gas_target(block) do def gas_target(block) do
elasticity_multiplier = 2 elasticity_multiplier = Application.get_env(:explorer, :elasticity_multiplier)
ratio = Decimal.div(block.gas_used, Decimal.div(block.gas_limit, elasticity_multiplier)) ratio = Decimal.div(block.gas_used, Decimal.div(block.gas_limit, elasticity_multiplier))
ratio |> Decimal.sub(1) |> Decimal.mult(100) |> Decimal.to_float() ratio |> Decimal.sub(1) |> Decimal.mult(100) |> Decimal.to_float()
end end

@ -176,7 +176,8 @@ config :explorer,
implementation_data_fetching_timeout: :timer.seconds(2), implementation_data_fetching_timeout: :timer.seconds(2),
restricted_list: System.get_env("RESTRICTED_LIST"), restricted_list: System.get_env("RESTRICTED_LIST"),
restricted_list_key: System.get_env("RESTRICTED_LIST_KEY"), restricted_list_key: System.get_env("RESTRICTED_LIST_KEY"),
checksum_function: System.get_env("CHECKSUM_FUNCTION") && String.to_atom(System.get_env("CHECKSUM_FUNCTION")) checksum_function: System.get_env("CHECKSUM_FUNCTION") && String.to_atom(System.get_env("CHECKSUM_FUNCTION")),
elasticity_multiplier: ConfigHelper.parse_integer_env_var("EIP_1559_ELASTICITY_MULTIPLIER", 2)
config :explorer, Explorer.Chain.Events.Listener, config :explorer, Explorer.Chain.Events.Listener,
enabled: enabled:

@ -183,3 +183,4 @@ ACCOUNT_REDIS_URL=redis://redis_db:6379
# MIXPANEL_URL= # MIXPANEL_URL=
# AMPLITUDE_API_KEY= # AMPLITUDE_API_KEY=
# AMPLITUDE_URL= # AMPLITUDE_URL=
EIP_1559_ELASTICITY_MULTIPLIER=2

@ -657,6 +657,9 @@ endif
ifdef CONTRACT_DISABLE_INTERACTION ifdef CONTRACT_DISABLE_INTERACTION
BLOCKSCOUT_CONTAINER_PARAMS += -e 'CONTRACT_DISABLE_INTERACTION=$(CONTRACT_DISABLE_INTERACTION)' BLOCKSCOUT_CONTAINER_PARAMS += -e 'CONTRACT_DISABLE_INTERACTION=$(CONTRACT_DISABLE_INTERACTION)'
endif endif
ifdef EIP_1559_ELASTICITY_MULTIPLIER
BLOCKSCOUT_CONTAINER_PARAMS += -e 'EIP_1559_ELASTICITY_MULTIPLIER=$(EIP_1559_ELASTICITY_MULTIPLIER)'
endif
HAS_BLOCKSCOUT_IMAGE := $(shell docker images | grep -sw "${BS_CONTAINER_IMAGE} ") HAS_BLOCKSCOUT_IMAGE := $(shell docker images | grep -sw "${BS_CONTAINER_IMAGE} ")
build: build:

Loading…
Cancel
Save