Skip to content

feat(payments): per-plan event rate limits and retention #921

Closed

Description

@Priyanshubhartistm

Is your feature request related to a problem? Please describe.
Rate limits (limits.event.rateLimits) and retention (limits.event.retention) are global, so a paying subscriber on a premium plan gets the same limits as everyone else. Tiered access (#673) needs these to depend on the sender's active plan.

Describe the solution you'd like

  • Plans can define their own event rate limits; EventMessageHandler.isRateLimited uses the plan's set for a subscriber and the global set otherwise, keyed the same way as today.
  • Plans can define their own retention (maxDays); the maintenance purge applies it per subscriber instead of one global value, keeping the existing kind/pubkey whitelists.
  • The plan lookup reuses the admission cache so no extra database read happens per event.
  • Documentation in CONFIGURATION.md and tests for both limit paths, including expiry falling back to the global limits.

Additional context

Activity

  1. added a commit that references this issue on Nov 2, 2026
    b6634b0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions