Skip to content

Add issuer-authorized blacklist size cap enforcement with BlacklistSizeLimitExceeded in blacklist_add #358

@thlpkee20-wq

Description

@thlpkee20-wq

Description

RevoraError::BlacklistSizeLimitExceeded exists but blacklist_add does not appear to enforce a per-offering cap, risking unbounded blacklist growth that degrades gas for get_blacklist and report_revenue (which snapshots the blacklist into events). Add a configurable per-offering maximum and enforce it in blacklist_add.

Requirements and context

  • Must be secure, tested, and documented
  • Should be efficient and easy to review
  • Relevant code: src/lib.rs (blacklist_add, get_blacklist, get_blacklist_size)
  • blacklist_add must remain idempotent and only callable by the current issuer

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b feat/blacklist-size-cap
  • Implement changes
    • Add a set_blacklist_size_limit issuer setter and a MAX_BLACKLIST_SIZE ceiling
    • Return BlacklistSizeLimitExceeded from blacklist_add when the cap is reached
    • Skip the count for re-adds (idempotent) so the cap is not falsely triggered
  • Validate security and correctness assumptions

Test and commit

  • Run tests
    • cargo test
  • Cover edge cases
    • Adding at cap, idempotent re-add at cap, removing then re-adding
  • Include test output and security notes

Example commit message

feat: enforce per-offering blacklist size cap in blacklist_add

Guidelines

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

Metadata

Metadata

Assignees

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