Skip to content

Commit

Permalink
Merge pull request blockscout#8292 from blockscout/add-ethereum-json-…
Browse files Browse the repository at this point in the history
…rpc-wait-per-timeout-env-var

Add ETHEREUM_JSONRPC_WAIT_PER_TIMEOUT env var
  • Loading branch information
vbaranov authored Aug 24, 2023
2 parents 54a0777 + 0c9c61c commit 70e1cc3
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- [#8181](https://github.com/blockscout/blockscout/pull/8181) - Insert current token balances placeholders along with historical
- [#8210](https://github.com/blockscout/blockscout/pull/8210) - Drop address foreign keys
- [#8292](https://github.com/blockscout/blockscout/pull/8292) - Add ETHEREUM_JSONRPC_WAIT_PER_TIMEOUT env var

### Fixes

Expand Down
1 change: 0 additions & 1 deletion apps/ethereum_jsonrpc/config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ config :ethereum_jsonrpc, EthereumJSONRPC.RequestCoordinator,
duration: :timer.minutes(1),
table: EthereumJSONRPC.RequestCoordinator.TimeoutCounter
],
wait_per_timeout: :timer.seconds(20),
max_jitter: :timer.seconds(2)

# Add this configuration to add global RPC request throttling.
Expand Down
2 changes: 2 additions & 0 deletions apps/ethereum_jsonrpc/config/runtime/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import Config

alias EthereumJSONRPC.Variant

config :ethereum_jsonrpc, EthereumJSONRPC.RequestCoordinator, wait_per_timeout: 2

variant = Variant.get()

Code.require_file("#{variant}.exs", "#{__DIR__}/../../../explorer/config/test")
Expand Down
1 change: 0 additions & 1 deletion apps/ethereum_jsonrpc/config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ config :ethereum_jsonrpc, EthereumJSONRPC.RequestCoordinator,
duration: :timer.seconds(6),
table: EthereumJSONRPC.RequestCoordinator.TimeoutCounter
],
wait_per_timeout: 2,
max_jitter: 1,
# This should not actually limit anything in tests, but it is here to enable the relevant code for testing
throttle_rate_limit: 10_000,
Expand Down
3 changes: 3 additions & 0 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ config :ethereum_jsonrpc, EthereumJSONRPC.Geth,
config :ethereum_jsonrpc, EthereumJSONRPC.PendingTransaction,
type: System.get_env("ETHEREUM_JSONRPC_PENDING_TRANSACTIONS_TYPE", "default")

config :ethereum_jsonrpc, EthereumJSONRPC.RequestCoordinator,
wait_per_timeout: ConfigHelper.parse_time_env_var("ETHEREUM_JSONRPC_WAIT_PER_TIMEOUT", "20s")

################
### Explorer ###
################
Expand Down
1 change: 1 addition & 0 deletions docker-compose/envs/common-blockscout.env
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ LOGO=/images/blockscout_logo.svg
ETHEREUM_JSONRPC_TRANSPORT=http
ETHEREUM_JSONRPC_DISABLE_ARCHIVE_BALANCES=false
# ETHEREUM_JSONRPC_HTTP_HEADERS=
# ETHEREUM_JSONRPC_WAIT_PER_TIMEOUT=
IPC_PATH=
NETWORK_PATH=/
BLOCKSCOUT_HOST=
Expand Down
3 changes: 3 additions & 0 deletions docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ endif
ifdef ETHEREUM_JSONRPC_HTTP_HEADERS
BLOCKSCOUT_CONTAINER_PARAMS += -e 'ETHEREUM_JSONRPC_HTTP_HEADERS=$(ETHEREUM_JSONRPC_HTTP_HEADERS)'
endif
ifdef ETHEREUM_JSONRPC_WAIT_PER_TIMEOUT
BLOCKSCOUT_CONTAINER_PARAMS += -e 'ETHEREUM_JSONRPC_WAIT_PER_TIMEOUT=$(ETHEREUM_JSONRPC_WAIT_PER_TIMEOUT)'
endif
ifdef IPC_PATH
BLOCKSCOUT_CONTAINER_PARAMS += -e 'IPC_PATH=$(IPC_PATH)'
endif
Expand Down

0 comments on commit 70e1cc3

Please sign in to comment.