Summary
The relay enforces createdAt.maxPositiveDelta (default 900s) and createdAt.maxNegativeDelta (default 0 = unlimited) from settings to reject events with implausible timestamps. There are no integration tests covering this enforcement.
What to test
- Event with
created_at exactly at the current time → accepted
- Event with
created_at 900 seconds in the future (at the limit) → accepted
- Event with
created_at 901 seconds in the future (over the limit) → rejected with invalid:
- When
maxNegativeDelta is configured, events older than the limit → rejected
- Events within the negative delta limit → accepted
Relevant code
resources/default-settings.yaml — limits.event.createdAt
src/@types/settings.ts
src/handlers/event-message-handler.ts
Suggested location
test/integration/features/nip-22/nip-22.feature
Summary
The relay enforces
createdAt.maxPositiveDelta(default 900s) andcreatedAt.maxNegativeDelta(default 0 = unlimited) from settings to reject events with implausible timestamps. There are no integration tests covering this enforcement.What to test
created_atexactly at the current time → acceptedcreated_at900 seconds in the future (at the limit) → acceptedcreated_at901 seconds in the future (over the limit) → rejected withinvalid:maxNegativeDeltais configured, events older than the limit → rejectedRelevant code
resources/default-settings.yaml—limits.event.createdAtsrc/@types/settings.tssrc/handlers/event-message-handler.tsSuggested location
test/integration/features/nip-22/nip-22.feature