-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fetch more storage keys than the maximum limit set by substrate #602
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not quite sure if it makes sense to have get_all_storage_keys_paged_up_to_count
as a separate function. It can do everything that get_storage_keys_paged
can, so for me it should become the new get_storage_keys_paged
and get_storage_keys_paged
could become an internal helper method.
We provide both methods. See: #588 (comment) |
…f keys, independantly of substrate limit
c4973d0
to
8444dfc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks a lot!
/// If `start_key` is passed, return next keys in storage in lexicographic order. | ||
/// | ||
/// `at_block`: the state is queried at this block, set to `None` to get the state from the latest known block. | ||
// See https://github.com/paritytech/substrate/blob/9f6fecfeea15345c983629af275b1f1702a50004/client/rpc/src/state/mod.rs#L54 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
Add get_all_storage_keys_paged_up_to_count to fetch required number of keys, independantly of substrate limit:
The default call, get_storage_keys_paged performs according to substrate: if required number of keys> 1000, an error is thrown. The documentation warns the user.
This does not completely fix #588. To fetch all pages, you need to know how many keys are stored. Currently,
count
is mandatory instate_getKeysPaged
and substrate doesn't support the feature for obtaining all keys.