Skip to content

Trackerless-network completion plan + phase 0.1: adopt TS 103.8 protos#52

Merged
ptesavol merged 2 commits into
mainfrom
claude/festive-jones-c7a4ec
Jul 6, 2026
Merged

Trackerless-network completion plan + phase 0.1: adopt TS 103.8 protos#52
ptesavol merged 2 commits into
mainfrom
claude/festive-jones-c7a4ec

Conversation

@ptesavol

@ptesavol ptesavol commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

First PR of the trackerless-network completion effort (see the new trackerless-network-completion-plan.md, committed here as well): make the C++ port of dht/trackerless-network feature-complete against TypeScript v103.8.0-rc.3 (af966cf03) so the shared library can join the streamr network directly in addition to the proxy path.

The plan document

  • Test-driven roadmap (port a TS test → port its dependencies → green → next), phased bottom-up: milestone 0 (protos, test utilities, from-scratch simulator), A (DHT core on simulator), B (connectivity: NAT/WebRTC/interop), C (trackerless full node), D (shared-library API + mobile), E (deferred: autocertifier, GeoIP, plumtree).
  • C++ wins on design deviations (endpoint state machine stays); TS wins on wire format, enforced by check-proto-sync.sh.
  • Plumtree verified safely optional against the pinned TS source (opt-in + try/catch fallback in PlumtreeManager), so it is deferred.

Phase 0.1 — protos adopted wholesale

  • DhtRpc.proto, NetworkRpc.proto, ProtoRpc.proto copied verbatim from the pin; all protobuf message code and RPC stub modules regenerated.
  • Code migrated to the wire-visible renames: versionprotocolVersion (+ new applicationVersion) in handshake/connectivity, UNSUPPORTED_PROTOCOL_VERSION, GroupKeyEncryptedGroupKey, SignatureType::ECDSA_SECP256K1_EVM in the proxy publish path.
  • New ConnectionLockRpc.setPrivate implemented like TS (private-connection tracking in ConnectionLockStates, gated by allowIncomingPrivateConnections, default false) with unit tests.
  • Plugin fix: be87ea9f had hand-patched #include <coroutine> into generated stubs without teaching the protoc plugin to emit it — regeneration would have broken the build. The plugin now emits the preamble; regeneration is byte-stable again.
  • check-proto-sync.sh (root) diffs the repo protos against the pinned TS reference (local checkout or raw.githubusercontent) and runs in validate.yml before lint.

Known quirk documented in-code

ConnectionLockStatesTest uses EXPECT_EQ(expr, true/false) instead of EXPECT_TRUE/FALSE: clangd 22 falsely flags every boolean-macro expansion in that TU (member_function_call_bad_type); the compiler accepts either form.

Not in this PR

Live TS interop verification of the renamed messages — the existing ts-integration harness is disabled (pre-existing; it builds a 2024 TS monorepo). The plan schedules its rebuild early in milestone B; the disabled test still compiles against the new protos.

Test plan

  • ./check-proto-sync.sh — all protos byte-identical to the pin
  • Full monorepo build (macOS arm64, Debug)
  • ./test.sh — 312/312 tests pass (includes new setPrivate/private-connection tests)
  • ./lint.sh — clean

🤖 Generated with Claude Code

ptesavol and others added 2 commits July 6, 2026 15:14
Test-driven roadmap for making the dht and trackerless-network ports
feature-complete against TS v103.8.0-rc.3 (af966cf03), so the shared
library can join the streamr network directly in addition to the proxy
path. C++ wins on design deviations, TS wins on wire format; simulator
gets built from scratch behind a TS-compatible API (milestone 0).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- DhtRpc.proto, NetworkRpc.proto, ProtoRpc.proto copied verbatim from
  streamr-dev/network@af966cf03; all stubs and message code regenerated.
- Handshake/connectivity migrated to renamed fields (version ->
  protocolVersion, new applicationVersion, UNSUPPORTED_PROTOCOL_VERSION);
  proxy publish path migrated to SignatureType::ECDSA_SECP256K1_EVM.
- ConnectionLockRpc.setPrivate implemented (remote private connections
  tracked in ConnectionLockStates, gated by new ConnectionManagerOptions
  allowIncomingPrivateConnections, default false like TS) with unit tests.
- protoc plugin now emits the '#include <coroutine>' preamble that
  be87ea9 had patched into the generated files by hand, so regeneration
  is byte-stable again.
- check-proto-sync.sh diffs repo protos against the pinned TS reference
  (local checkout or raw.githubusercontent), wired into validate.yml.

Note: ConnectionLockStatesTest writes boolean asserts as
EXPECT_EQ(expr, true/false) — clangd 22 falsely flags every
EXPECT_TRUE/EXPECT_FALSE expansion in that TU (the compiler is fine
with either form); see the comment in the test file.

Verified: full build, 312/312 tests, lint clean (macOS host).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 6, 2026

Copy link
Copy Markdown

Bugbot is not enabled for this team, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@github-actions github-actions Bot added ci Pull requests that update Continuous Integration build docs proto-rpc network dht labels Jul 6, 2026
@ptesavol ptesavol merged commit d692b02 into main Jul 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Pull requests that update Continuous Integration build dht docs network proto-rpc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant