Description:
Implement rate limiting to prevent spam or DoS attacks by limiting how many sessions a single address can create within a time window.
Acceptance Criteria:
set_rate_limit(max_sessions: u32, window_ledgers: u32) admin function.
Track UserSessionCount(address, timestamp_window) in temporary storage.
lock_funds checks if buyer has exceeded limit in current window.
Rate limit resets after window_ledgers passes.
Emits RateLimitHit event when limit exceeded (for monitoring).
Admin can whitelist specific addresses (no rate limit).
Labels: security, rate-limiting, anti-dos
Description:
Implement rate limiting to prevent spam or DoS attacks by limiting how many sessions a single address can create within a time window.
Acceptance Criteria:
set_rate_limit(max_sessions: u32, window_ledgers: u32) admin function.
Track UserSessionCount(address, timestamp_window) in temporary storage.
lock_funds checks if buyer has exceeded limit in current window.
Rate limit resets after window_ledgers passes.
Emits RateLimitHit event when limit exceeded (for monitoring).
Admin can whitelist specific addresses (no rate limit).
Labels: security, rate-limiting, anti-dos