Skip to content

feat: filter excessive numbers of storage map key queries earlier#1530

Merged
drahnr merged 2 commits intonextfrom
bernhard-1514-again
Jan 19, 2026
Merged

feat: filter excessive numbers of storage map key queries earlier#1530
drahnr merged 2 commits intonextfrom
bernhard-1514-again

Conversation

@drahnr
Copy link
Contributor

@drahnr drahnr commented Jan 19, 2026

Follow up to #1517 to filter the requests earlier.

Closes #1514

@drahnr drahnr added the no changelog This PR does not require an entry in the `CHANGELOG.md` file label Jan 19, 2026
@drahnr drahnr merged commit 66f7410 into next Jan 19, 2026
7 checks passed
@drahnr drahnr deleted the bernhard-1514-again branch January 19, 2026 14:31
impl QueryParamLimiter for QueryParamStorageMapKeyLimit {
const PARAM_NAME: &str = "storage_map_key";
const LIMIT: usize = 16;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This is fine for now, but let's create an issue to impose a limit on the total number of storage keys in a request. The thinking is that if an account has 20 maps, we'd be allowing 20*16 keys in a single request. But for accounts with 1 map, we'd be allowing only 16 keys.

Doing this on per-map bases makes it so that we either have to have the number of keys too low for a single map, or it will be too high in the worst case.

Again, not a priority - but let's create an issue (may be a "good first issue").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog This PR does not require an entry in the `CHANGELOG.md` file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Limit number of SmtProofs in get_account API

3 participants