Add NIP-11 limitation field to relay info document - #102
Open
KTibow wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The relay's NIP-11 response was missing the
limitationblock entirely.Since this is a Web-of-Trust relay that rejects events from untrusted pubkeys, it should use this standard format to communicate that it's locked down.
Change
Added a
Limitationfield to theRelayInformationDocumentinmain.go:Evidence
restricted_writes: trueOnce the trust network is built, only pubkeys in it may write events:
max_message_length: 512000Khatru's
NewRelay()setsMaxMessageSize: 512000, which is applied viaws.conn.SetReadLimit(rl.MaxMessageSize). The wot-relay never overrides it.max_limit: 500UseEventstoreis called with500:In khatru,
maxQueryLimitis passed toQueryStoredasmaxLimit:In the LMDB query engine,
maxLimitcaps the emitted count:default_limit: 500When a filter has no
limit,GetTheoreticalLimit()returnsmath.MaxInt, somaxQueryLimit(500) is the effective cap.auth_required: falseNo auth policy is installed:
payment_required: falseNo payment infrastructure:
Fields deliberately omitted
None of these have code-enforced limits — using
omitemptyto leave them absent is correct:max_subscriptionsaddListener()appends to[]listenerSpecwith no capacity checkmax_subid_lengthmax_event_tagsPreventTooManyIndexableTagsexists in khatru but is not wired inmain.gomax_content_lengthPreventLargeContentexists in khatru but is not wired inmain.gomin_pow_difficultyomitemptydrops the zero valuecreated_at_lower_limitPreventTimestampsInThePastis not wired;deleteOldNotes()is post-hoc cleanupcreated_at_upper_limitPreventTimestampsInTheFutureis not wiredConfirmed via: