2

The docs just mention "If the results of a query are too large, the response will be truncated."

What's the max data size of the query that can be returned? I understand I can do b64+zstd and fetch just pubkeys with dataSlice:0, but even with all that, what's the maximum data that I could fetch?

1 Answer 1

3

The maximum return is gated by the RPC provider. As per the cookbook documentation

Despite its usefulness, getProgramAccounts is often misunderstood due to its current constraints. Many of the queries supported by getProgramAccounts require RPC nodes to scan large sets of data. These scans are both memory and resource intensive. As a result, calls that are too frequent or too large in scope can result in connection timeouts. Furthermore, at the time of this writing, the getProgramAccounts endpoint does not support pagination. If the results of a query are too large, the response will be truncated.

2
  • Possible follow up question is do the RPC providers vary this value from day to day or based on external factors like congestion? For a given RPC provider, can you assume the max size of the response will be the same from day to day?
    – Whiteseal
    Commented Nov 14, 2022 at 20:19
  • My subjective thought would be they probably gate it with a constant. If it were me, I would want a deterministic static model for consistency. With program storage knowledge, it's probably a good idea to model discriminators in the data and use filter or memcmp.
    – Frank C.
    Commented Nov 14, 2022 at 20:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.