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
Typed clients attempt to fetch suggested params on every method invocation. When calling a large amount of methods, the algod node rate limits the request and the transaction factory fails. This is important when the sendParams is configured to skipSending
Solution
It would be nice to allow passing in of suggested params to AppClientCallCoreParams. It may be good to use a Mutex|Semaphore for the fetch call or it could even be as simple as caching the params with a low TTL.
Proposal
It would be possible to combine all three methods, not a requirement to resolve the issue. The solutions here are just illustrative and not prescriptive.
Moves the implementation details to the developer's project
Allows for fine grained control over fetching params and AbortControlers since the developer owns the fetch call
Cons of passing in suggestedParams
Suggested params could change during the duration of the execution
Less automagic then the other solutions, requires developer implementation
Pros of Mutex
Developer does not need to think of the amount of client calls
Developer does not need to configure the client to get this behavior
Cons of Mutex
Still can rate limit based on the response time and IO of the local machine. Only one request will be in-flight but still could send them at a high request per second
Generally it is not configurable (also a positive)
Pros of Caching
Simple implementation
Cons of Caching
Suggested params could change while the cache is not stale.
I think that as we move to AlgorandClient this problem will be solved.
In the meantime, the ability to pass in suggestedParams already exists, when you construct the app client you can pass them in and they will get used across all calls for that client. There is currently no way of overriding for a single call though.
Problem
Typed clients attempt to fetch suggested params on every method invocation. When calling a large amount of methods, the algod node rate limits the request and the transaction factory fails. This is important when the
sendParams
is configured toskipSending
Solution
It would be nice to allow passing in of suggested params to
AppClientCallCoreParams
. It may be good to use a Mutex|Semaphore for the fetch call or it could even be as simple as caching the params with a low TTL.Proposal
It would be possible to combine all three methods, not a requirement to resolve the issue. The solutions here are just illustrative and not prescriptive.
Passing in Params
Mutex|Semaphore for suggestedParams
Only allow one suggested params request in flight per any instance of the client.
Here is an example for pending transactions that could be adapted to the suggestedParams call.
Caching Params
Pros and Cons
Pros of passing in suggestedParams
fetch
callCons of passing in suggestedParams
Pros of Mutex
Cons of Mutex
Pros of Caching
Cons of Caching
Dependencies
No
Related Issues
The text was updated successfully, but these errors were encountered: