Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Expose STORAGE_KEYS_PAGED_MAX_COUNT for usage in clients #12236

Open
2 tasks done
kylezs opened this issue Sep 12, 2022 · 3 comments
Open
2 tasks done

Expose STORAGE_KEYS_PAGED_MAX_COUNT for usage in clients #12236

kylezs opened this issue Sep 12, 2022 · 3 comments
Labels
J0-enhancement An additional feature request.

Comments

@kylezs
Copy link

kylezs commented Sep 12, 2022

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Stack Exchange first?

  • This is not a support question.

Description of bug

If a client wants to get storage keys, it makes sense for the client to know the maximum page size for a query without:
a) having to read the node source code and then hardcoding the value or
b) getting a query failure on the first query.

Steps to reproduce

No response

@github-actions github-actions bot added the J2-unconfirmed Issue might be valid, but it’s not yet known. label Sep 12, 2022
@bkchr
Copy link
Member

bkchr commented Sep 12, 2022

WDYT of removing the error and making the STORAGE_KEYS_PAGED_MAX_COUNT implicit. Aka if you request more than that, you will automatically in max STORAGE_KEYS_PAGED_MAX_COUNT

@kylezs
Copy link
Author

kylezs commented Sep 12, 2022

Hmm, when reading the client code removing the error would be a bit misleading. e.g. if for some application the developer knows they can only have a max of 3000 items in their storage so they do two two queries of 1500, it reads as though they will get all 3000, but in reality, it'll "fail" silently after getting 2000. So I'm probably in favour of keeping the error.

I think either exporting the const and/or having a "max_keys_per_page_count" rpc to query for the max would make client code a little nicer/more explicit.

@ggwpez
Copy link
Member

ggwpez commented Sep 14, 2022

Could we actually make this a CLI flag? That would help with the try-runtime runner when scrapping the whole state from a local node.

@liamaharon liamaharon added J0-enhancement An additional feature request. and removed J2-unconfirmed Issue might be valid, but it’s not yet known. labels May 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
J0-enhancement An additional feature request.
Projects
None yet
Development

No branches or pull requests

4 participants