Skip to main content

Module limiter

Module limiter 

Source
Expand description

Limits for RPC and store parameters and payload sizes.

§Rationale

  • Parameter limits are kept across all multi-value RPC parameters. This caps worst-case SQL IN clauses and keeps responses comfortably under the 4 MiB payload budget enforced in the store.
  • Limits are enforced both at the RPC boundary and inside the store to prevent bypasses and to avoid expensive queries even if validation is skipped earlier in the stack.
  • MAX_PAGINATED_PAYLOAD_BYTES is set to 4 MiB (e.g. 1000 nullifier rows at ~36 B each, 1000 transactions summaries streamed in chunks).

Add new limits here so callers share the same values and rationale.

Structs§

QueryLimitError
QueryParamAccountIdLimit
Used for the following RPC endpoints
QueryParamBlockLimit
Only used internally, not exposed via public RPC.
QueryParamNoteCommitmentLimit
Used for internal queries retrieving note inclusion proofs by commitment.
QueryParamNoteIdLimit
Used for the following RPC endpoints select_notes_by_id
QueryParamNoteTagLimit
Used for the following RPC endpoints
QueryParamNullifierLimit
Used for the following RPC endpoints
QueryParamNullifierPrefixLimit
Used for the following RPC endpoints
QueryParamStorageMapKeyTotalLimit
Used for the following RPC endpoints

Constants§

GENERAL_REQUEST_LIMIT
Basic request limit.
MAX_RESPONSE_PAYLOAD_BYTES
Maximum payload size (in bytes) for paginated responses returned by the store.

Traits§

QueryParamLimiter
Checks limits against the desired query parameters, per query parameter and bails if they exceed a defined value.