You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently filters like eth_newPendingTransactionFilter refresh interval is hardcoded to be 2 seconds with _pingDuration constant in filters.dart. Then a timer is used with this interval. While 2 seconds may be enough for frontrunners on Ethereum with their long block, it is not enough for blockchains with shorter blocks and for backrunning on any blockchains.
I suggest to:
Make an option to override this interval.
Instead of a timer, use a loop with await Future.delayed().
Particularly, a loop solution would allow to not wait between calls for extreme extreme solutions.
For the interface we have the following options:
Deprecate Web3Client.pendingTransactions and add a separate method with interval argument.
Breaking change: Add a required argument to Web3Client.pendingTransactions since it is a very convenient name.
Breaking change: Add an optional argument to Web3Client.pendingTransactions with the default of no waiting.
Add an option to Web3Client to set all filters' intervals.
From the interface design point of view, (3) is the best, but it would change the behavior without breaking builds. So I suggest the roadmap:
Do the Option 1 if we do this before the next breaking release.
In the next breaking release, remove pendingTransactions.
In yet the next breaking release do the Option 3.
Meanwhile another solution to refresh the filter at custom interval is to do
Currently filters like
eth_newPendingTransactionFilter
refresh interval is hardcoded to be 2 seconds with_pingDuration
constant infilters.dart
. Then a timer is used with this interval. While 2 seconds may be enough for frontrunners on Ethereum with their long block, it is not enough for blockchains with shorter blocks and for backrunning on any blockchains.I suggest to:
Particularly, a loop solution would allow to not wait between calls for extreme extreme solutions.
For the interface we have the following options:
Web3Client.pendingTransactions
and add a separate method with interval argument.Web3Client.pendingTransactions
since it is a very convenient name.Web3Client.pendingTransactions
with the default of no waiting.Web3Client
to set all filters' intervals.From the interface design point of view, (3) is the best, but it would change the behavior without breaking builds. So I suggest the roadmap:
pendingTransactions
.Meanwhile another solution to refresh the filter at custom interval is to do
The text was updated successfully, but these errors were encountered: