Skip to content

Limit get_accounts_by_authorizers results - #2418

Closed
pur3miish wants to merge 1 commit into
AntelopeIO:mainfrom
pur3miish:agent/get-accounts-authorizers-limit
Closed

Limit get_accounts_by_authorizers results#2418
pur3miish wants to merge 1 commit into
AntelopeIO:mainfrom
pur3miish:agent/get-accounts-authorizers-limit

Conversation

@pur3miish

Copy link
Copy Markdown

Summary

  • add a caller-supplied limit to get_accounts_by_authorizers
  • enforce a node-side maximum of 1,000 results regardless of the requested limit
  • stop traversing the account-query indices as soon as the effective limit is reached
  • return more: true when matching authorities were truncated
  • document the request and response fields in the Chain API schema
  • add focused coverage for limited and complete result sets

Why

A public key can be assigned to an unusually large number of account permissions. The endpoint currently traverses and serializes every match, so a pathological or attacker-influenced authority set can consume significant CPU, memory, HTTP worker time, and bandwidth.

Applying a limit downstream does not protect nodeos because the complete response has already been generated. This change enforces the bound while iterating the node's authority index.

This addresses the node-side result-limit portion of #2417. Cursor pagination and cancellation-aware deadlines can be considered separately.

Validation

  • git diff --check
  • Chain API Swagger YAML parsed successfully with Ruby/Psych
  • added get_accounts_by_authorizers_limit_test for truncated and complete results

The focused C++ test was not executed locally because this clean checkout does not include Leap's initialized submodules and pinned build toolchain; CI should compile and run it.

@pur3miish

Copy link
Copy Markdown
Author

Superseded by the maintained Spring implementation: AntelopeIO/spring#1894. The corresponding Spring issue is AntelopeIO/spring#1893. Closing this draft because Leap is no longer supported.

@pur3miish pur3miish closed this Jul 21, 2026
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.

1 participant