Describe the bug
In src/utils/event.ts, getEventExpiration() validates the NIP-40 expiration tag with a Math.log10() bounds check:
if (Number.isSafeInteger(expirationTime) && Math.log10(expirationTime) < 10) {
return expirationTime
}
To Reproduce
Steps to reproduce the behavior:
- Publish an event with an expiration tag of 0, e.g. ["expiration", "0"].
- Observe the relay treats it as a validing/ignoring it.
- Publish an event with an expiration tag > 9999999999, e.g. ["expiration", "10000000000"].
- Observe the expiration is silently drores.
Screenshots
N/A
System
- OS: Linux
- Platform: Docker
- Version: 3.0.0
Logs
N/A — no error is logged; the timestamp ided.
Additional context
getEventExpiration() is at src/utils/evenis at src/utils/event.ts:256). Its result feeds addExpirationMetadata() in src/handlers/event-message-handler.ts, so discard-far-future cases affect real event expiry behavior.
Describe the bug
In
src/utils/event.ts,getEventExpiration()validates the NIP-40expirationtag with aMath.log10()bounds check:To Reproduce
Steps to reproduce the behavior:
Screenshots
N/A
System
Logs
N/A — no error is logged; the timestamp ided.
Additional context
getEventExpiration() is at src/utils/evenis at src/utils/event.ts:256). Its result feeds addExpirationMetadata() in src/handlers/event-message-handler.ts, so discard-far-future cases affect real event expiry behavior.