Skip to content

Commit

Permalink
Merge pull request blockscout#9560 from MASDXI/master
Browse files Browse the repository at this point in the history
Enabled fetch pending transactions for Hyperledger Besu client
  • Loading branch information
vbaranov authored Mar 10, 2024
2 parents cfdd5b6 + 3294e60 commit 0459615
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

- [#9572](https://github.com/blockscout/blockscout/pull/9572) - Fix Shibarium L1 fetcher
- [#9563](https://github.com/blockscout/blockscout/pull/9563) - Fix timestamp handler for unfinalized zkEVM batches
- [#9560](https://github.com/blockscout/blockscout/pull/9560) - Fix fetch pending transaction for hyperledger besu client
- [#9514](https://github.com/blockscout/blockscout/pull/9514) - Fix missing `0x` prefix for `blockNumber`, `logIndex`, `transactionIndex` and remove `transactionLogIndex` in `eth_getLogs` response.
- [#9512](https://github.com/blockscout/blockscout/pull/9512) - Docker-compose 2.24.6 compatibility
- [#9262](https://github.com/blockscout/blockscout/pull/9262) - Fix withdrawal status
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,17 @@ defmodule EthereumJSONRPC.PendingTransaction do
{:ok, [Transaction.params()]} | {:error, reason :: term}
def fetch_pending_transactions_besu(json_rpc_named_arguments) do
with {:ok, transactions} <-
%{id: 1, method: "txpool_besuTransactions", params: []}
# `txpool_besuPendingTransactions` required parameter `numResults` for number of maximum pending transaction to return.
#
# TODO: Remove fix value when hyperledger besu client change `numResults` from required to optional parameter.
# Current fix value set to `512` bonsai storage default value is 512.
# to handle pending transaction in Ethereum mainnet require more than 100000.
# reference:
# https://etherscan.io/chart/pendingtx
# https://besu.hyperledger.org/public-networks/reference/cli/options#bonsai-historical-block-limit
#
# https://besu.hyperledger.org/public-networks/reference/api#txpool_besupendingtransactions
%{id: 1, method: "txpool_besuPendingTransactions", params: [512]}
|> request()
|> json_rpc(json_rpc_named_arguments) do
transactions_params =
Expand Down
3 changes: 1 addition & 2 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -561,8 +561,7 @@ config :indexer, Indexer.Fetcher.TransactionAction,

config :indexer, Indexer.Fetcher.PendingTransaction.Supervisor,
disabled?:
System.get_env("ETHEREUM_JSONRPC_VARIANT") == "besu" ||
ConfigHelper.parse_bool_env_var("INDEXER_DISABLE_PENDING_TRANSACTIONS_FETCHER")
ConfigHelper.parse_bool_env_var("INDEXER_DISABLE_PENDING_TRANSACTIONS_FETCHER")

config :indexer, Indexer.Fetcher.Token, concurrency: ConfigHelper.parse_integer_env_var("INDEXER_TOKEN_CONCURRENCY", 10)

Expand Down

0 comments on commit 0459615

Please sign in to comment.