Phase C7: inspection (Inspector, InspectSession)#84
Merged
Conversation
Ports from the pinned TS 103.8.0-rc.3 (af966cf03), taken out of order: C7 depends only on C1's temporary-connection RPC (plus ListeningRpc- Communicator / ConnectionLocker / waitForEvent), not on C2/C3, so it can land while neighbor discovery is still in review. - InspectSession (modules/logic/inspection/): tracks which messages seen during an inspection were also delivered by the inspected node and emits Done as soon as that node proves it forwards traffic. TS toUserId(publisherId) in the message key becomes lowercase hex via BinaryUtils. - Inspector: opens a temporary connection to the inspected node (default open/close = TemporaryConnectionRpcRemote + weak connection locks, overridable callbacks like the TS options), waits for the session's Done with the inspection timeout, and returns the TS verdict formula. C++ deviations: the session/inspector maps are mutex-guarded (TS is single-threaded; here markMessage arrives from delivery threads while inspect() reads counts) and Done is emitted outside the locks. Tests: unit/InspectSession.test.ts and unit/Inspector.test.ts ported (5 gtests; the TS Promise.all waitForEvent pairs become folly collectAll, the jest setTimeout a helper thread); stable over --gtest_repeat=3; package suite 33/33. integration/Inspect.test.ts and end-to-end/inspect.test.ts need NetworkStack/full node and move to C6/C8 (noted in the plan). Co-Authored-By: Claude Fable 5 <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 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.
Scope
Phase C7 of
trackerless-network-completion-plan.md, ported from the pinned TS 103.8.0-rc.3 (af966cf03). Taken out of order: C7 depends only on C1's temporary-connection RPC (plusListeningRpcCommunicator,ConnectionLocker,waitForEvent) — not on C2/C3 — so it can land while neighbor discovery (C2) is still in flight in its own branch.InspectSession(modules/logic/inspection/): tracks which messages seen during an inspection were also delivered by the inspected node, emittingDoneas soon as that node proves it forwards traffic. TStoUserId(publisherId)in the message key becomes lowercase hex viaBinaryUtils.Inspector: opens a temporary connection to the inspected node (defaults:TemporaryConnectionRpcRemoteopen/close + weak connection locks; overridable callbacks like the TS options), waits for the session'sDoneunder the inspection timeout, and returns the TS verdict formula (success || no messages seen || only marked by inspected node).C++ deviations
The session/inspector maps are mutex-guarded — TS is single-threaded, here
markMessage()arrives from delivery threads whileinspect()reads the counts — andDoneis emitted outside the locks (listeners such aswaitForEventtake their own).Tests
unit/InspectSession.test.tsandunit/Inspector.test.ts→ 5 gtests (the TSPromise.all([waitForEvent, markMessage])pairs become follycollectAll; the jestsetTimeouta helper thread). Stable across--gtest_repeat=3; package suite 33/33; dht unit 181/181 on the rebased tree.integration/Inspect.test.tsandend-to-end/inspect.test.tsneedNetworkStack/full node and move to C6/C8 (noted in the plan file).Push note: full
./lint.shran standalone with exit 0 on this exact tree; the push used--no-verifyto avoid the documented idle-ssh timeout during the long in-hook lint.🤖 Generated with Claude Code