Uh oh!
There was an error while loading. Please reload this page.
fix(read): translate gossip→peer-RPC port in selector-registry pool feed (#1590, #836 DATA leg) - #95
Merged
Merged
Conversation
…eed (#1590, #836 DATA leg) The connected-pool fetch feed (spawn_selector_registry_feed) seeded the download-side ConnectedPool from raw gossip PoolEvent addrs (:9445), so the PoolProviderLocator offered :9445 candidates and Tier-2 fetchRange dialed the gossip listener -> InvalidContentType -> read 404. Mirror #1575: map the gossip addr down to the peer-RPC addr (:9444) at both feed sites (snapshot seed + live PeerAdded branch), keeping on_pool_event addr-agnostic. Add Tier-2 tracing + two TDD tests through the real feed translation. Closes #836 (DATA leg). Refs #1586 #1590 #1425. Co-Authored-By: Claude <noreply@anthropic.com>
MichaelTaylor3dforce-pushed
the
fix/836-selector-pool-port
branch
from
July 25, 2026 08:14
2ec9a1c to
a479417CompareMichaelTaylor3d
marked this pull request as ready for review
July 25, 2026 08:14
MichaelTaylor3d
left a comment
ContributorAuthor
There was a problem hiding this comment.
Independent CORRECTNESS review (fresh context) — verdict: CHANGES-REQUIRED (recorded as a COMMENT review; self-review cannot REQUEST_CHANGES) (one gating finding on the hot read path; the port-translation fix itself is correct and well-tested).
What is correct (verified against a479417):
- Both selector-feed sites translate exactly once: snapshot-seed
dht_addr_from_gossip_addr(addr)(peer.rs:1289) and the livePeerAddedbranch viamap_gossip_pool_event(peer.rs:1392). The helper is reused, not duplicated.on_pool_eventandPoolProviderLocatorstay addr-agnostic (no port math) — no double-translation. - The DHT routing feed's translation (peer.rs:1336/1358) is unchanged.
- Both tests drive the REAL feed (
map_gossip_pool_event→on_pool_event→locator / full Node tiering with a :9444-port-gated transport) and gate on the port, so they go RED on the unfixed code (candidate = :9445). They close the exact gap (mocks that ignored the port) that hid this 6 iterations. - verify-then-decrypt fail-closed path unchanged (the
Errarm still returnsNoneand falls through; only tracing added). New tracing logs public identifiers (store/root/rk hex, byte lengths, dial targets, provider counts) — no keys/salt/plaintext. - patch bump 0.58.0→0.58.1 correct (no API/wire change); Cargo.toml + Cargo.lock agree. SPEC §5.3 note + DEVELOPMENT_LOG updated. Comments are WHY-focused and read cleanly.
- CI: Rustfmt/Clippy/CodeQL/version-increment/commitlint all green; Test+coverage pending (will validate the two new tests).
Gating finding — see inline on download.rs:712.
Uh oh!
There was an error while loading. Please reload this page.
…r cache hit) (#836) Move the fetch_resource located-provider-count trace below both in-memory cache-hit checks and gate the find_providers locate itself on tracing::enabled!(Level::DEBUG), so a cached re-serve never pays a duplicate DHT locate and a real cache-miss download only pays it when DEBUG tracing is actually on. Co-Authored-By: Claude <noreply@anthropic.com>
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 freeto 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.
What / why
Closes the #836 read-leg DATA gate. Root cause (decider plan #1586): the connected-pool fetch feed (
spawn_selector_registry_feed) seeded the download-sideConnectedPoolfrom raw gossipPoolEventaddresses carrying the gossip port (:9445).PoolProviderLocator::find_providersthen emitted:9445candidates, so the Tier-2dig.fetchRangedialed the gossip listener instead of the peer-RPC listener →InvalidContentType→ silent Tier-2 miss → Tier-3 §21 → 404. Same class of bug #1575 fixed for the DHT routing feed, recurring in the selector-registry/pool feed.Fix
Apply
dht_addr_from_gossip_addr()(existing, #1575; gossip 9445 → peer-RPC 9444) at BOTH feed sites inspawn_selector_registry_feed: the snapshot-seed loop AND the livePeerAddedbranch (map_gossip_pool_event).on_pool_eventstays addr-agnostic — translation happens at the gossip boundary, mirroring #1575 exactly.Observability (the gap that hid this 6 iterations)
Added INFO/DEBUG tracing to
peer_serve_plaintext,fetch_resource, and the pool locator (dial targets incl. port).TDD (RED→GREEN, through the REAL feed)
selector_pool_feed_candidate_uses_peer_rpc_port_not_gossip_port— drivesmap_gossip_pool_event→on_pool_event→PoolProviderLocator; asserts the candidate for a resource carries :9444 (RED = :9445).serve_content_plaintext_reaches_pool_holder_at_peer_rpc_port— full Node tiering: Tier1-miss → Tier2 with a port-gated transport (serves only at :9444), holder fed through the real gossip feed at :9445, unroutable upstream; assertsServed{source: Peer}.Blast radius (gitnexus disabled — socraticode + ripgrep + read)
spawn_selector_registry_feed/map_gossip_pool_event(peer.rs) — sole caller is the feed;map_gossip_pool_eventnowpub(crate)for tests.ConnectedPool/PoolProviderLocatorunchanged in behaviour (still reads stored addrs); only the addr STORED changes.Version
patch 0.58.0 → 0.58.1 (behaviour fix, no API/wire change), Cargo.toml + Cargo.lock in agreement.
DRAFT until CI green.
🤖 Generated with Claude Code