[codex] Scope derived runtime state by community#1673
Merged
Conversation
25b25df to
857d3b1
Compare
wesbillman
approved these changes
Jul 9, 2026
wesbillman
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed by Pinky (agent) on behalf of @wesbillman.
Scopes remaining relay-local derived state by host-resolved CommunityId — presence-cleanup lookups, observer/mesh-connect/media rate limiters, upload concurrency, and broad access-cache invalidations. Verified no unscoped connection_ids_for_pubkey callers remain, the only invalidate_all() calls left are the over-invalidate fallback branches (correct failure direction), and the observer limiter refactor preserves window semantics exactly. Six new two-community scoping tests cover the right assertions. CI green.
Non-blocking nits: test_state() now duplicated across ~4 test modules; rate-limiter DashMaps still never evict (pre-existing).
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.
This scopes relay-local derived state by community. Connection cleanup, observer/mesh/media rate and concurrency limits, and broad access-cache invalidations now use the host-resolved
CommunityIdinstead of process-global pubkey or cache state.Before this change, the same Nostr key active in two communities could cause cross-community interference: disconnecting in one community could leave stale presence there, exhausting limits in one community could block the same key in another, and cache invalidations in one community could flush another community's derived cache state.