-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Iterate one storage map over blocks #9213
Comments
I agree, I think we should create 1 or 2 method on PrefixIterator.
|
@KiChjang maybe an interesting idea for you |
We already doing this in offchain worker and built an iterator for this purpose https://github.com/open-web3-stack/open-runtime-module-library/blob/443ee91bc2ca5f1fc155c0378eef6e89b67e2e97/utilities/src/iterator.rs#L102 |
Oh yes, this is definitely useful not just for pagination, but for multiblock consensus mechanisms as well. We should definitely do this. |
until a nicer abstraction is being built, you can simply store the last key in storage and use |
We have a storage map with huge amount of keys. Is it possible to iterate one storage map over blocks? I cannot store the PrefixIterator into the DB since it cannot be encoded. Meanwhile, fields of PrefixIterator are private. I cannot build a new PrefixIterator with a given previous_key.
The text was updated successfully, but these errors were encountered: