Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import streamr.protorpc.Errors;
import streamr.protorpc.RpcCommunicator;
import streamr.dht.RoutingRpcCommunicator;
import streamr.dht.Transport;
import streamr.logger.SLogger;

// Hoisted from the former header (file scope, NOT exported);
// fully qualified: relative namespace names resolve differently
Expand All @@ -29,8 +28,6 @@ using streamr::protorpc::RpcClientError;
// neighboring header before consolidation).
using streamr::protorpc::RpcCommunicatorOptions;

using streamr::logger::SLogger;

export namespace streamr::dht::transport {

using ::dht::PeerDescriptor;
Expand All @@ -44,8 +41,6 @@ private:
HandlerToken onDisconnectedHandlerToken;

public:
std::string instrServiceId; // INSTR

ListeningRpcCommunicator(
ServiceID&& serviceId,
Transport& transport,
Expand All @@ -60,11 +55,6 @@ public:
this->handleMessageFromPeer(message);
}),
transport(transport) {
this->instrServiceId = this->getOwnServiceId();
SLogger::info(
"INSTR ListeningRpcCommunicator ctor",
{{"serviceId", this->instrServiceId},
{"ptr", reinterpret_cast<uintptr_t>(this)}});
this->onMessageHandlerToken = transport.on<transportevents::Message>(
[this](const Message& message) { this->listener(message); });
this->onDisconnectedHandlerToken =
Expand All @@ -87,18 +77,7 @@ public:
});
}

~ListeningRpcCommunicator() {
SLogger::info(
"INSTR ~ListeningRpcCommunicator",
{{"serviceId", this->instrServiceId},
{"ptr", reinterpret_cast<uintptr_t>(this)}});
}

void destroy() {
SLogger::info(
"INSTR ListeningRpcCommunicator::destroy",
{{"serviceId", this->instrServiceId},
{"ptr", reinterpret_cast<uintptr_t>(this)}});
transport.off<transportevents::Message>(this->onMessageHandlerToken);
// Also detach the Disconnected listener: leaving it registered
// dangles `this` on the transport after destruction, and a live
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,6 @@ public:
// straggler request drained that late runs against destroyed members
// and a possibly-destroyed transport (observed as the Layer0
// end-to-end teardown SIGSEGV, macOS crash reports 2026-07-11).
[[nodiscard]] const ServiceID& getOwnServiceId() const {
return this->ownServiceId;
}

~RoutingRpcCommunicator() { this->drainAsyncTasks(); }

RoutingRpcCommunicator(const RoutingRpcCommunicator&) = delete;
Expand Down
24 changes: 24 additions & 0 deletions packages/streamr-trackerless-network/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ if(NOT IOS AND STREAMR_MODULES_SUPPORTED)
test/unit/ExternalNetworkRpcTest.cpp
test/unit/ProxyConnectionsTest.cpp
test/unit/ProxyAndFullNodeTest.cpp
test/unit/WebsocketFullNodeNetworkTest.cpp
test/unit/WebrtcFullNodeNetworkTest.cpp
test/unit/ContentDeliveryLayerNodeRealConnectionsTest.cpp
)

target_include_directories(streamr-trackerless-network-test-unit
Expand Down Expand Up @@ -222,6 +225,27 @@ if(NOT IOS AND STREAMR_MODULES_SUPPORTED)
add_executable(streamr-trackerless-network-test-integration
test/integration/ProxyClientTsIntegrationTest.cpp
)

# C++<->TS stream interop (milestone C exit criterion): drives the
# pinned @streamr/trackerless-network npm package in a child node
# process (test/ts-interop/fullNode.js). Skips when no node runtime
# >= 20 is available.
add_executable(streamr-trackerless-network-test-ts-interop
test/ts-interop/TsInteropStreamTest.cpp
)
target_compile_definitions(streamr-trackerless-network-test-ts-interop
PRIVATE TS_INTEROP_HARNESS_DIR="${CMAKE_CURRENT_SOURCE_DIR}/test/ts-interop"
)
streamr_enable_imports(streamr-trackerless-network-test-ts-interop)
target_link_libraries(streamr-trackerless-network-test-ts-interop
PUBLIC streamr-trackerless-network
PUBLIC streamr::streamr-dht
PUBLIC streamr::streamr-logger
PUBLIC streamr::streamr-utils
PUBLIC streamr::streamr-proto-rpc
PUBLIC GTest::gtest
PUBLIC streamr-trackerless-network-test-main
)
# The test imports modules, so its source needs module dependency
# scanning; imported modules are usable only by DIRECT consumers, so
# every directly-imported module is linked here.
Expand Down
11 changes: 9 additions & 2 deletions packages/streamr-trackerless-network/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,15 @@ fi
# unification false positives (generated protobuf setter and
# std::string member calls on own locals); the compiler builds and
# runs all three.
TESTFILES=$(find test -type f \( -name "*.hpp" -o -name "*.cpp" \) -not -path '*/ts-integration/*' | sort | uniq | tr '\n' ' ')
TIDY_TESTFILES=$(echo "$TESTFILES" | tr ' ' '\n' | grep -v 'test/unit/ContentDeliveryRpcRemoteTest.cpp' | grep -v 'test/unit/TemporaryConnectionRpcLocalTest.cpp' | grep -v 'test/unit/HandshakerTest.cpp' | grep -v 'test/unit/ContentDeliveryLayerNodeTest.cpp' | grep -v 'test/unit/ContentDeliveryManagerTest.cpp' | grep -v 'test/unit/NetworkNodeTest.cpp' | grep -v 'test/unit/ProxyAndFullNodeTest.cpp' | grep -v 'test/unit/ProxyConnectionsTest.cpp' | tr '\n' ' ')
# TsInteropStreamTest.cpp (phase C8) trips the same std-type
# unification false positives on its own std::string locals (like the
# dht package's TsInteropTest.cpp); the compiler builds and runs it.
# WebsocketFullNodeNetworkTest.cpp, WebrtcFullNodeNetworkTest.cpp and
# ContentDeliveryLayerNodeRealConnectionsTest.cpp (phase C8) trip the
# generated-protobuf-setter variant (set_content ->
# ArenaStringPtr::SetBytes); the compiler builds and runs all three.
TESTFILES=$(find test -type f \( -name "*.hpp" -o -name "*.cpp" \) -not -path '*/ts-integration/*' -not -path '*/node_modules/*' | sort | uniq | tr '\n' ' ')
TIDY_TESTFILES=$(echo "$TESTFILES" | tr ' ' '\n' | grep -v 'test/unit/ContentDeliveryRpcRemoteTest.cpp' | grep -v 'test/unit/TemporaryConnectionRpcLocalTest.cpp' | grep -v 'test/unit/HandshakerTest.cpp' | grep -v 'test/unit/ContentDeliveryLayerNodeTest.cpp' | grep -v 'test/unit/ContentDeliveryManagerTest.cpp' | grep -v 'test/unit/NetworkNodeTest.cpp' | grep -v 'test/unit/ProxyAndFullNodeTest.cpp' | grep -v 'test/unit/ProxyConnectionsTest.cpp' | grep -v 'test/ts-interop/TsInteropStreamTest.cpp' | grep -v 'test/unit/WebsocketFullNodeNetworkTest.cpp' | grep -v 'test/unit/WebrtcFullNodeNetworkTest.cpp' | grep -v 'test/unit/ContentDeliveryLayerNodeRealConnectionsTest.cpp' | tr '\n' ' ')
echo "Running clangd-tidy on $TIDY_TESTFILES"

clangd-tidy -p "$COMPILE_DB" $TIDY_TESTFILES < /dev/null
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
npm-install.log
driver-stderr.log
Loading
Loading