iota.py icon indicating copy to clipboard operation
iota.py copied to clipboard

Support for "chunking" requests with size limit

Open todofixthis opened this issue 7 years ago • 1 comments

On the IRI, there is a (configurable) size limit for certain requests (https://github.com/iotaledger/iri/blob/v1.4.1.6/src/main/java/com/iota/iri/service/API.java#L111).

This can cause certain requests to fail if the application tries to call e.g., get_balances with too many addresses.

  • Create a new Wrapper (iota.adapters.wrappers) that enforces max request limit on certain requests. The default limit is 1000 (https://github.com/iotaledger/iri/blob/v1.4.1.6/src/main/java/com/iota/iri/conf/Configuration.java#L118).
  • Before sending requests for commands that have a size limit, check to see if the request will exceed this limit.
    • If any argument will exceed this limit, break the request into chunks.
      • For now, send the requests synchronously.
      • Compile into a single result before returning.

For safety, the wrapper should have a [mutable] whitelist of commands that it will operate on.

Bonus points: add support for the other limits as well (maxFindTx, maxGetTrytes, etc.).

todofixthis avatar Jan 13 '18 22:01 todofixthis

Related: https://github.com/iotaledger/iri/issues/496

todofixthis avatar Jan 22 '18 19:01 todofixthis