Repository navigation
fix(id): surface failed block-list lookups separately from unblocked - #8761
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Caution Review failedThe pull request is closed.
Warning Some tools did not complete. Review the errors below.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 93ff717950
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| /// that cannot report failures answers only the definite outcomes; | ||
| /// the store implementations override it with their real errors, | ||
| /// and log the failure for the operator when it happens. | ||
| fn lookup(&self, kind: BlockKind, value: &[u8]) -> BlockLookup { |
There was a problem hiding this comment.
Add the required design record for the block-lookup API
This introduces a public BlockList::lookup interface and explicit indeterminate-result policies across enforcement seams, but lacks the required dated design record. A repository-wide search of the target commit's documentation for 8750, BlockLookup, block-lookup terms, and fail-open policies found no record covering this change. pkgs/id/AGENTS.md explicitly requires documenting interface changes before implementation; add the prescribed document covering the intent, approach, and policy rationale rather than leaving that record only in Rust comments and the commit message.
AGENTS.md reference: pkgs/id/AGENTS.md:L159-L168
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 93ff717..HEAD: added the prescribed dated design record at pkgs/id/docs/2026-11-11T19-15-00Z_design_block_lookup/2026-11-11T19-15-00Z_design_block_lookup.md (through the docs symlink: doc/2026-11-11T19-15-00Z_design_block_lookup/), covering the intent, the BlockLookup approach, the failure-category/no-storage-leak decision, and the per-surface fail-open policy rationale. The design itself was settled in the #8750 issue and task packet before implementation; the record formalizes it in the protocol location and says so in its closing update section.
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Fixes #8750.
BlockList::is_blockedreturned onlybool, and both store implementations erased lookup failures tofalse(unwrap_or(false)in id-events, plus a second erasure for poisoned locks in id-store). Enforcement consumers treated thatfalseas a successful "not blocked", so a corrupt block row, a transient storage failure, or a poisoned lock silently allowed connections and pulls with no diagnostic anywhere.Change:
block_list: newBlockLookup—Blocked/Unblocked/Indeterminate(BlockLookupFailure)with failure categoriesCorrupt/Storage/Unavailable(categories only; no storage details can leak to a peer). The trait gainslookup()pluspeer_lookup/topic_tag_lookup/ip_lookup; the default derives fromis_blockedso other implementations keep working, and the bool seam keeps its documented fail-open meaning.EventStore(id-events) andSharedEventStore(id-store) overridelookup()with their real results, mappingStoreError::CorrupttoCorrupt, other store errors toStorage, and a poisoned lock toUnavailable, and emit atracing::warn!operator diagnostic at the failure. Theiris_blockednow delegates tolookup() == Blocked, so the two seams can never diverge.tracing::warn!diagnostic:AbuseEvaluator::open_connection_inner(peer + IP),PullGate::admitsplus newPullGate::peer_lookup/topic_tag_lookupaccessors,blob_gate::decide_with_blocks, and thelog_synctopic-tag check. Only a definiteBlockedrefuses.LocalEvents::lookup_blockexposes the distinguishing answer to operator surfaces.Tests (oracle: a failed lookup must be distinguishable from an ordinary unblocked result):
Indeterminate(Corrupt)while a healthy row yieldsBlockedand an absent oneUnblocked; bool seam still fails open.SharedEventStorelookup distinguishesBlocked/Unblocked, and a poisoned lock yieldsIndeterminate(Unavailable).Some(Indeterminate(Storage)), bool seam false,admitstrue under the stated policy.Verified on the laptop: id-core abuse 30/30, id-events block 10/10 + pull 13/13, id-store store_traits block/poison tests pass, id-groups blob 10/10,
cargo checkclean for id-core/id-store/id-events/id-groups/id-sync. Pre-existing on main, not caused here:cargo test -p id-sync --libdoes not compile standalone (id_core::connectivity::silentfeature) — filed as #8760; id-core's frames byte_refusal test failure is #8620.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.