Skip to content

Implement lazy loading of initial storage values #41

@dimitrispaxinos

Description

@dimitrispaxinos

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions