Skip to content

Add stable pagination cursor to get_blacklist via get_blacklist_page hardening #365

@thlpkee20-wq

Description

@thlpkee20-wq

Description

get_blacklist returns the entire blacklist for a token in one call, which can exceed gas limits for large lists and is also embedded into report_revenue events. Promote get_blacklist_page as the primary read path with a documented deterministic cursor and a hard cap, and have internal snapshots use a bounded form.

Requirements and context

  • Must be secure, tested, and documented
  • Should be efficient and easy to review
  • Relevant code: src/lib.rs (get_blacklist, get_blacklist_page, get_blacklist_size, report_revenue)
  • Ordering must remain insertion order and deterministic

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b feat/blacklist-pagination-hardening
  • Implement changes
    • Cap get_blacklist_page limit at MAX_PAGE_LIMIT and return next_cursor
    • Document that get_blacklist is bounded/legacy and prefer the paged form off-chain
    • Ensure report_revenue snapshot uses a bounded read to avoid unbounded event payloads
  • Validate security and correctness assumptions

Test and commit

  • Run tests
    • cargo test
  • Cover edge cases
    • Empty blacklist, single page, multi-page, cursor exhaustion, over-cap limit
  • Include test output and security notes

Example commit message

feat: harden blacklist pagination and bound event snapshots

Guidelines

  • Minimum 95 percent test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions