Skip to content

better way to one-shot query storage #6015

@shunjizhan

Description

@shunjizhan
  • I'm submitting a ...
  • Bug report
  • Feature request
  • Support request
  • Other
  • What is the current behavior and expected behavior?

When querying storage for historical blocks, we need to decorate a whole apitAt object with await api.at(blockHash). However, if we only need to one-shot query for storage for a certain block, there will be a lot of wasted resources decorating api.*.

As a result, if we need to query storage for a lot of blocks (not simultaneously, but at high frequency), this will cause significant performance issue.

Can we have a more efficient way to query one-shot storage, such as await api.queryAt(blockHash).section.method()? In this way, we know it's only querying storage so can skip other unnecessary decoration.

For multiple queries among api.* for the same block, we can still use apiAt(blockHash)

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureNew functionality expanding SDK’s capabilities, adding tools or APIs for developers.P4 - Needs InvestigationRequires analysis to determine cause or feasibility. Not fully understood, needs research first.

    Type

    No type

    Projects

    Status

    P4 - Needs Investigation

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions