better way to one-shot query storage #6015
Labels
Feature
New functionality expanding SDK’s capabilities, adding tools or APIs for developers.
P4 - Needs Investigation
Requires analysis to determine cause or feasibility. Not fully understood, needs research first.
When querying storage for historical blocks, we need to decorate a whole
apitAt
object withawait 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 decoratingapi.*
.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 useapiAt(blockHash)
The text was updated successfully, but these errors were encountered: