Skip to content

rsk_getStorageNodes has no cap on slots per call; its sibling caps at 64 #382

Open

Description

@SDL-A1

From the external review of #374. Verified here.

crates/rpc/src/proof.rs:

  • rsk_get_storage_nodes (line 245) — no cap on slots per call
  • rsk_get_state_nodes (line 348) — caps at MAX_STATE_KEYS = 64 (line 329),
    enforced at line 359 with "At most 64 keys at a time"

Two sibling methods, one guard. The uncapped one is new and public, and it runs
on the async worker, so a single large request occupies a worker for as long as
it takes.

This is the same shape as rsk_lastAccountChange: a method whose cost is
invisible at the call site is a poor thing to expose by default. That one was
given a config gate and a bounded range for exactly this reason.

What would settle it

Apply the same MAX_STATE_KEYS bound, or state why storage slots are cheaper per
unit than state keys and pick a bound from that.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions