Skip to content

Commit

Permalink
refactor: Remove hardcoded numResults from fetch_pending_transactions…
Browse files Browse the repository at this point in the history
…_besu (blockscout#10117)

* update remove fixed value

* refactor fetch_pending_transactions_besu

* add PR number and revised CHANGLOG.md

* remove change in CHANGELOG.md
  • Loading branch information
MASDXI authored May 30, 2024
1 parent e269294 commit 016881a
Showing 1 changed file with 1 addition and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,8 @@ defmodule EthereumJSONRPC.PendingTransaction do
@spec fetch_pending_transactions_besu(EthereumJSONRPC.json_rpc_named_arguments()) ::
{:ok, [Transaction.params()]} | {:error, reason :: term}
def fetch_pending_transactions_besu(json_rpc_named_arguments) do
# `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
with {:ok, transactions} <-
%{id: 1, method: "txpool_besuPendingTransactions", params: [512]}
%{id: 1, method: "txpool_besuPendingTransactions", params: []}
|> request()
|> json_rpc(json_rpc_named_arguments) do
transactions_params =
Expand Down

0 comments on commit 016881a

Please sign in to comment.