docs: fix ARCHITECTURE.md drift — rate limiting, limits, pipeline, counts - #4336
Open
iroiro147 wants to merge 1 commit into
Open
docs: fix ARCHITECTURE.md drift — rate limiting, limits, pipeline, counts#4336iroiro147 wants to merge 1 commit into
iroiro147 wants to merge 1 commit into
Conversation
…unts Addresses block#4210. Four categories of drift corrected: 1. Rate limiting claim inverted: doc said "no rate limiter exists" but code has RedisRateLimiter wired and enforced on WS connect, per-message, and HTTP bridge (buzz-pubsub + buzz-relay). 2. Stale client-facing limits: MAX_FRAME_BYTES is 524,288 (512 KiB) not 65,536; DEFAULT_MAX_PAGE_LIMIT is 1,000 not 500. Clarified that NIP-11 max_content_len (65,536) is a separate value. 3. Search pipeline description stale: search_index_tx mpsc no longer exists — FTS is a generated search_tsv column populated by the DB insert itself. Updated pipeline steps and state struct. Privacy exclusion list now documents both the original 0001 exclusion (1059, 30300, 30622, 44100, 44101) and the 0008 fresh-install positive allowlist (0, 9, 40002, 45001, 45003). 4. Stale counts: ALL_KINDS is 129 not 127; buzz-acp LOC table ~2x off (main.rs is now a 3-line shim, logic in lib.rs); e2e tests moved to buzz-test-client crate with different counts. Signed-off-by: Sarthak Singh <sarthak.singh@juspay.in>
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.
Summary
Fixes multiple categories of documentation drift in
ARCHITECTURE.mdidentified in #4210. Every claim was verified against the current codebase before editing.Changes
1. Rate limiting — doc stated the opposite of the code
The doc claimed "No Redis-backed rate limiter exists anywhere in the codebase — rate limiting is not currently enforced." The code has a Redis-backed limiter wired and enforced:
crates/buzz-pubsub/src/rate_limiter.rs—RedisRateLimitercrates/buzz-relay/src/state.rs:584,713— wired asadmission_rate_limitercrates/buzz-relay/src/connection.rs:615,638— enforced on WS connect + per-messagecrates/buzz-relay/src/api/bridge.rs:30— enforced on the HTTP bridgeFixed: Updated the
buzz-auth"Does NOT" section, thebuzz-pubsubsection, and Known Limitations row #2 to accurately describe the enforcement surface.2. Client-facing limits were stale
MAX_FRAME_BYTESDEFAULT_MAX_PAGE_LIMITmax_content_lenFixed: All three occurrences in the doc (summary line, env var table, security table) plus the historical query cap description.
3. Search pipeline description stale
search_index_txbounded worker queue no longer exists — FTS is a generatedsearch_tsvcolumn populated by the DB insert itself (comment atcrates/buzz-relay/src/handlers/event.rs:502-506).migrations/0001had 5 kinds (1059, 30300, 30622, 44100, 44101);migrations/0008_fresh_install_search_allowlist.sqlflips fresh installs to a positive allowlist (kind IN (0, 9, 40002, 45001, 45003)).dispatch_persistent_event).Fixed: Updated pipeline step 10, the fire-and-forget description, the state struct snippet, and the privacy exclusion description.
4. Stale counts
ALL_KINDS(§2)ALL_KINDS(§6)relay.rsLOCmain.rsLOClib.rs~6,700)e2e_relay.rstestsbuzz-test-client)Fixed: Updated all counts; added approximate qualifier and note about
main.rs → lib.rssplit and e2e file relocation. Per the reporter's suggestion, exact LOC/test numbers are now marked approximate.Verification
main(28ae6cd).Closes #4210.