Skip to content

fix: Bound the number of storage slots in get_account requests#2284

Open
sergerad wants to merge 1 commit into
nextfrom
sergerad-bound-storage-map-request
Open

fix: Bound the number of storage slots in get_account requests#2284
sergerad wants to merge 1 commit into
nextfrom
sergerad-bound-storage-map-request

Conversation

@sergerad

@sergerad sergerad commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

As part of the get_account RPC endpoint, callers can supply a list of storage map slots to fetch, which was previously unbounded. This PR caps that list at AccountStorage::MAX_NUM_STORAGE_SLOTS (and rejects duplicate slots) to bound per-request work.

Changelog

[[entry]]
scope = "rpc"
impact = "fixed"
description = "GetAccount requests are now limited to 255 storage slots, matching the protocol limit."

@sergerad sergerad requested a review from kkovaacs June 25, 2026 01:13
@sergerad sergerad changed the title Add bound validation for storage map request fix: Bound the number of storage slots in get_account requests Jun 25, 2026

@kkovaacs kkovaacs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me % the param name comment I've added.

/// [`QueryParamStorageMapKeyTotalLimit`] and could be repeated without bound.
pub struct QueryParamStorageMapSlotLimit;
impl QueryParamLimiter for QueryParamStorageMapSlotLimit {
const PARAM_NAME: &str = "storage_map_slot";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this field called storage_maps in the Protobuf message? I think there's no storage_map_slot field at all.

We should probably review other field name references as well as I'm fairly sure those are outdated as wel... :(

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 this pull request may close these issues.

2 participants