Phase C5: ContentDeliveryManager and the control-layer facade#87
Merged
Conversation
Ports packages/trackerless-network/src/ContentDeliveryManager.ts and
src/control-layer/ControlLayerNode.ts (TS pin af966cf03, v103.8.0-rc.3):
- ContentDeliveryManager: per-stream-part join/leave/broadcast
orchestration; builds the discovery-layer node, content-delivery
node, entry-point store manager, split avoidance and reconnect per
joined stream part, and the ProxyClient for proxied stream parts.
The TS fire-and-forget setImmediate() join runs as a bounded
GuardedAsyncScope task.
- ControlLayerNode: the layer-0 facade (pure virtual); asTransport()
replaces the TS structural "extends ITransport".
- DhtNodeControlLayer: adapter presenting a DhtNode as a
ControlLayerNode (mirrors DhtNodeDiscoveryLayer).
- createStreamPartDiscoveryLayerNode: the TS inline layer-1 DhtNode
construction as its own module; the manager takes it as an injected
factory because composing the DhtNode module graph inside
ContentDeliveryManager.cppm exhausts clang's per-TU source
locations.
- DhtNode::deleteDataFromDht (was still missing; TS parity).
- Source-location relief across the package: 23 modules stop
textually including DhtRpc.pb.h/NetworkRpc.pb.h in their global
module fragments and rely on streamr.dht.protos /
streamr.trackerlessnetwork.protos imports instead, with the std
headers they actually use spelled out. Without this the new
manager test TU cannot compile ("ran out of source locations").
- ContentDeliveryManagerTest: 6 tests over 2 managers on layer-0
DhtNodes over the simulator (join, pub/sub after neighbors,
multi-stream, leave, RTT collection in getNodeInfo). Suite exits
cleanly (no leaked executor keep-alives).
- lint.sh: ContentDeliveryManagerTest.cpp joins the clangd-tidy
std-type false-positive exclusion list (generated protobuf setter;
the compiler builds and runs it).
Deviations documented in the module header: TS metrics/diagnostics
not ported (consistent with earlier phases), ConnectionManager
private-client mode is a follow-up, plumtree options are milestone E.
The TS proxy e2e tests target the C6 NetworkNode API and move there.
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.
Summary
Ports the trackerless-network ContentDeliveryManager and the control-layer facade from the pinned TypeScript (
af966cf03, v103.8.0-rc.3), continuing Milestone C oftrackerless-network-completion-plan.md.New modules
ContentDeliveryManager— per-stream-part join/leave/broadcast orchestration: builds the layer-1 discovery node, the content-delivery node, the entry-point store manager (PeerDescriptorStoreManager), split avoidance and reconnect for every joined stream part, and theProxyClientfor proxied stream parts. The TS fire-and-forgetsetImmediate()join runs as a boundedGuardedAsyncScopetask on a serial executor.ControlLayerNode— the layer-0 facade (pure virtual).asTransport()stands in nominally for the TS structuralextends ITransport.DhtNodeControlLayer— adapter presenting aDhtNodeas aControlLayerNode(mirrorsDhtNodeDiscoveryLayer).createStreamPartDiscoveryLayerNode— the TS inline layer-1DhtNodeconstruction as its own module. The manager takes it as an injected factory (ContentDeliveryManagerOptions::createDiscoveryLayerNode): composing theDhtNodemodule graph insideContentDeliveryManager.cppmexhausts clang's per-TU source locations, so the seam is structural.NetworkStack(C6) and the tests supply this factory.DhtNode
deleteDataFromDht(key, waitForCompletion)(TS parity; was still missing).Source-location relief (enables the new test TU)
23 package modules stop textually including
DhtRpc.pb.h/NetworkRpc.pb.hin their global module fragments and rely on thestreamr.dht.protos/streamr.trackerlessnetwork.protosmodule exports instead (the PR #66 pattern), with the std headers each module actually uses spelled out explicitly. Without this, the manager test TU (manager graph +DhtNode+ simulator) fails with clang's "ran out of source locations". Generated stubs undermodules/gen/stay textual by design.Tests
ContentDeliveryManagerTest(6 tests, port of the TS integration test): two managers over layer-0DhtNodes on the simulator — starts, joining, publishing after waiting for neighbors, multi-stream pub/sub, leaving, RTT collection forgetNodeInfo. Green in ~2.3 s with clean process exit (no leaked executor keep-alives).Validation
lint.shgreen.ContentDeliveryManagerTest.cppjoins the documented clangd-tidy std-type false-positive exclusion list (trips inside the generated protobuf setter; the compiler builds and runs it).Deviations / follow-ups (documented in the module header)
MetricsContext/RateMetric) andgetDiagnosticInfonot ported (consistent with earlier phases).ProxyClient::setProxiesstays synchronous (shared-library API); the manager calls it directly where TS awaits.proxy-connections.test.ts,proxy-and-full-node.test.ts) are written against the C6NetworkNodeAPI and move to C6.createDiscoveryLayerNodepassesperiodicallyPingNeighbors/periodicallyPingRingContacts; the C++DhtNodeOptionslacks these flags — omitted with a comment.🤖 Generated with Claude Code