Skip to content
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

Implement lazy loading of initial storage values #41

Closed
dimitrispaxinos opened this issue Sep 8, 2022 · 0 comments · Fixed by #42
Closed

Implement lazy loading of initial storage values #41

dimitrispaxinos opened this issue Sep 8, 2022 · 0 comments · Fixed by #42

Comments

@dimitrispaxinos
Copy link
Contributor

Currently, we load all storages with their initial values during the Service Layer Startup using the GetPairs RPC method that is unsafe to be called externally.

A solution would be to replace GetPairs with GetKeysPaged.to get all keys and then GetStorageAsync for each value (as tried in #36). But even if we did that, the time needed in order initially load all storages would be significantly long. The GetKeysPaged method alone is throttled to one request per second on Kusama.

Therefore, as a first step, we will allow the lazy loading of the storage values, meaning, we will add a flag/setting that allows to deactivate the initial storage key/value loading.

darkfriend77 pushed a commit that referenced this issue Sep 29, 2022
* Cleanups and Renamings

* Documentation Additions

* Documentation Improvements

* Added IsLazyLoadingEnabled

* Property initialization for Typed and TypedMapStorage

* Storage Lazy Loading Implementation

* Update Startup.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant