Skip to content

Allow GetAccount endpoint to return all storage map entries #2121

@JereSalo

Description

@JereSalo

co-authored by @TomasArrachea

Currently, the GetAccountRequest takes a StorageMapDetailRequest parameter that lets the client declare which storage maps they want to request. The problem with this is that we cannot request the whole storage map entries at once, so the client currently needs two requests in total to get them: the first one to discover the storage map slots, and the second one to get the contents. Ideally we'd perform only one request to get all data at once in case of small accounts (for large accounts we'd still need a second request in case a storage map has "too many entries").

We could add a new boolean parameter (e.g. include_all_maps or all_maps) to the request so all the storage map entries are included in the response. It would not need to return the inclusion proof. If any of the maps return too_many_entries, the client would then follow up with the sync_storage_maps flow for slots that exceed the limit.

There are many alternatives for the implementation but we think that the best one may be to make it impossible for the user to set both all_maps flag and the existing storage_maps at the same time, so we make the intent clear.

Metadata

Metadata

Assignees

Labels

rpcRelated to the RPC componentstoreRelated to the store component
No fields configured for Enhancement.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions