Modules don't self-report versions — Logos Core is the authority: the
version lives in the module's embedded metadata.json and is served by
the core's module registry (core_service.getModuleInfo). version() also
hardcoded a stale "1.1.0" module version, and its liblogosdelivery
suffix duplicated getNodeInfo("Version").
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* feat: expose Store queries via storeQuery
A Logos Core module integrating paid Store retrieval (lez-payment-streams)
needs to issue Store queries through delivery_module, but the plugin surface
only covered lifecycle, send, subscribe and node info. liblogosdelivery already
ships waku_store_query in its kernel tier, so forward to it: storeQuery(
jsonQuery, peerAddr, timeoutMs) hands the query JSON through verbatim and
returns the response JSON, waiting past the query's own timeout so the FFI
error (not a callback timeout) is what the caller sees.
The kernel tier is explicitly unstable; the include is scoped to this one
symbol and the method documents that its JSON contract follows it.
Resolveslogos-co/logos-delivery-module#30
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* docs: add use-at-your-own-risk warning on storeQuery
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* chore: bump logos-delivery to master 8ad99f1
Brings in the Reliable Channels FFI API (logosdelivery_channel_create/
_exists/_send/_close) and channel_message_* events. The create_node
config gained the layered {mode, preset, messagingOverrides,
channelsOverrides} shape; legacy flat JSON remains accepted, so the
existing flat configs and applyPortDefaults keep working.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* test: sync liblogosdelivery.h stub with logos-delivery master 8ad99f1
Replace the hand-condensed stub with the real header surface so the
unit-test ABI matches exactly: adds the four Reliable Channels
functions, RET_MISSING_CALLBACK, and the FFICallBack typedef name used
by the real header.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat: add Reliable Channels API to delivery module
Expose the new logos-delivery channel FFI surface:
- channelCreate(channelId, contentTopic, senderId) -> channel id
- channelExists(channelId) -> "true"/"false" (verbatim FFI string)
- channelSend(channelId, payload) -> requestId, payload base64-encoded
into { payload, ephemeral:false } like send()
- channelClose(channelId)
Route the new event types through event_callback as typed events:
channel_message_received (payload base64-decoded), channel_message_sent,
channel_message_error.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* test: mock channel FFI functions and add channel-api unit tests
Mock the four logosdelivery_channel_* functions (invokeOk pattern),
stub the three new channel event bodies, and cover
channelCreate/channelExists/channelSend/channelClose with the same
no-context / mocked-value / call-count assertions as the existing API.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* test: add reliable-channel integration tests
Cover the full channel lifecycle against the real library: exists=false
for unknown ids, create returns the channel id, exists flips true/false
across create/close, close of an unknown channel errors, and
channelSend returns a request id on an open channel and fails on an
unknown one.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor: extract shared decodePayloadField for event payloads
Both message_received and channel_message_received now decode their
payload field through one helper that accepts either wire shape: a JSON
array of numbers (generic Nim seq[byte] serialization) or a base64
string (hand-built events).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix: make event_callback exception-safe across the FFI boundary
Address PR review: event_callback is a C callback invoked from the Nim
runtime, so a C++ exception escaping it would unwind into Nim frames
and terminate the process.
- decodePayloadField: validate array elements are integers in 0..255
instead of a throwing get<int>(); malformed payloads decode to empty.
- Wrap the whole parse + field-extraction + dispatch in one try/catch
on nlohmann::json::exception — .value()/.get() type mismatches were
equally able to escape, not just the payload conversion.
- Stub header: note that upstream's onChannelMessage* comment refers to
internal listener labels, while the delivered eventType strings are
channel_message_*; the mirrored body stays verbatim with upstream.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor: split the event payload decoder per event type
message_received carries a JSON byte array, channel_message_received a
base64 string. One parser sniffing both shapes let either event silently
accept the other's encoding; each now decodes only its own.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Igor Sirotin <sirotin@status.im>
* test: add Python e2e suite driving delivery_module over RPC
Adds tests/e2e/: a pytest suite that boots logoscore daemons in docker, loads delivery_module, and drives it over RPC — exercising the plugin-load + codegen + RPC + two-node network-delivery paths the in-process C++ tests can't. Reuses logos-integration-test-framework / logoscore, pinned to chat-module's known-good SHAs.
Single-daemon: load/createNode/start/stop lifecycle, createNode-twice rejection, and query + subscribe/unsubscribe round-trips. Two-daemon (direct staticnodes peering, relay-only single shard): sender-side messagePropagated is the hard gate; messageReceived is xfail until the receive path and event-payload shape are confirmed on a green run.
CI: new e2e-tests job (needs build-and-test, ubuntu-latest) building .#install-portable plus the logoscore smoke image and CLI, with a cachix pre-warm step added to build-and-test.
* test(e2e): add RPC-reply-wedge diagnostic probes
Opt-in (E2E_PROBES=1) probe suite that isolates which factor wedges a
delivery node's RPC reply channel after a watched send: event emission
alone, the watcher subscription alone, messagePropagated transmission, or
the loopback messageReceived (vector<uint8_t>). Each probe runs on a fresh
two-node pair so a wedge can't pollute later probes. Enabled in the e2e CI
job; set E2E_QT_DEBUG=1 to also capture Qt RemoteObjects transport logs.
* update(README): clarify module packaging and add build reproducibility note
* Revert "update(README): clarify module packaging and add build reproducibility note"
This reverts commit 5aed6447a9.
* Revert "test(e2e): add RPC-reply-wedge diagnostic probes"
This reverts commit ef1f541358.
* test(e2e): mark propagation and messageReceived tests xfail due to known issues (#59)
* ci: make e2e-tests non-gating while build bug #58 is open
The module build is reproducible per source tree but some trees produce a
plugin whose start() never returns (#58), which fails the solo lifecycle
tests at start. xfail can't cover that (it hits setup), so allow the e2e
job to fail without blocking the PR until #58 is fixed.
* test(e2e),ci: drop narrative/decorative comments per repo style
Remove explanatory comment blocks, section-banner comments, and redundant
inline rationale across the e2e suite and the CI workflow; keep only linter
directives and a single footgun one-liner. No behaviour change.
* test(e2e): refactor node interaction to use LogosDelivery API
Refactor message delivery tests and helpers for clarity using the new `LogosDelivery` class. Replaced low-level RPC calls with higher-level methods (`subscribe`, `send`, `watch`, etc.), streamlining node interaction and removing redundant logic. Updated lifecycle tests for consistency. No behavior change.
* ci(e2e): capture gdb thread backtraces when start wedges (#58)
Non-gating diagnostic in the e2e-tests job: boot a solo logoscore daemon,
call start on a background thread, and if it wedges attach gdb to every
container process for thread backtraces, /proc maps and kernel stacks.
Uploaded with the e2e-test-logs artifact.
* ci(e2e): fix#58 wedge detection so gdb actually fires
The client RPC errors (exit 4) ~20s before the daemon-side start() releases
its 30s semaphore, so a populated result no longer means success. Classify any
non-success outcome as wedged, poll to detect it early, and attach gdb to every
container process in parallel to freeze them before the semaphore releases.
* debug(#58): log start callback path and capture daemon log past 30s
Add fprintf in callApiRetVoid at callback entry, after invoke, and on the
semaphore timeout to show whether liblogosdelivery ever invokes our completion
callback (upstream) vs a userData/map miss (adapter). Keep the wedge probe
daemon alive past the 30s CALLBACK_TIMEOUT so the start outcome is captured.
* debug(#58): add pre-invoke positive control and inspect loaded plugin
Log unconditionally right before invoke() so a bad build distinguishes
'start_node did not return' from 'the loaded plugin lacks the instrumentation'.
On a wedge the probe now strings/sha256 the loaded delivery_module_plugin.so
for the instrumentation literals and ldd's the bundled libs.
* debug(#58): force stderr unbuffered so start-path logs are reliable
Prior run showed the 'about to invoke' line (which provably executed — the node
started right after) missing from the captured log, making log-line absence
useless as evidence. setvbuf(_IONBF) at module init + fflush after each
instrumented fprintf so the next bad build's log is trustworthy.
* debug(#58): probe RPC channel after a start wedge
start() returns and no thread is stuck (kernel stacks), so the wedge is a lost
RPC reply, not a hang. On a wedge, issue follow-up version/getAvailableConfigs
calls: if they also time out the whole QtRO reply channel is dead (matches the
sync-reply-wedge bug); if they succeed only start's reply was lost.
* debug(#58): revert useless stderr instrumentation
The fprintf/setvbuf tracing added to localize #58 is dead weight — logoscore's
stderr capture drops adapter log lines during the node-startup flood, so the
log-based method never worked. Revert it (src/ is now net-zero vs master) and
drop the diagnostic's now-moot instrumentation-strings check. The gdb + kernel
stacks + RPC-channel probe in wedge_gdb.py are what actually localized the bug
and stay.
* ci(e2e): bump logoscore daemon+CLI past the QtRO reply-wedge fix (#58)
Root-caused #58/#59 to the pre-fix ModuleProxy in the e2e daemon's SDK: it
emits module events directly on the caller's (module FFI) thread, racing QtRO
source serialization against an in-flight reply and permanently wedging the
sync-reply channel. Fixed upstream in logos-cpp-sdk d77c3dd (marshal events
onto the source thread) + logos-protocol #7 (defer async completion off the
QtRO read stack). Our daemon was pinned 6 commits before it.
Bump the smoke-image daemon (logoscore-py aa45db52 -> 71e00381) and the CLI
(logoscore-cli 5a1cf746 -> a9e18455) to a post-split closure carrying both
fixes. The Python client already floats logoscore@master, so no requirements
change is needed.
* test(e2e): un-xfail two-node delivery tests; drop the #58 wedge diagnostic
The daemon-pin bump (901c525) fixed the QtRO reply-wedge behind #58/#59, so the
three two-node delivery tests now pass (propagation both directions + receive).
Un-xfail them and delete the temporary gdb wedge diagnostic + its CI step; revert
the artifact upload to failure-only. Keep continue-on-error on e2e-tests for now
to gather a flake baseline on the real cross-node delivery before it gates.
* test(e2e): rename lifecycle test for clarity
---------
Co-authored-by: Egor Rachkovskii <egorrachkovskii@status.im>
* feat: expose node metrics via collectOpenMetricsText() for openmetrics
liblogosdelivery already aggregates Prometheus metrics in its global
registry and renders them as exposition text behind the "Metrics"
node-info attribute. Implement the openmetrics module's new
collectOpenMetricsText() convention (logos-co/openmetrics-module#5) by
handing that text back verbatim — the scraper parses it, injects a
module="delivery_module" label, and merges it with other modules.
No in-module parsing/reshaping: the module is a pure passthrough.
Select it with {"name":"delivery_module","format":"text"} in the
openmetrics start config.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* test: add real-node integration test for collectOpenMetricsText()
Asserts the live liblogosdelivery "Metrics" node-info path returns
non-empty Prometheus/OpenMetrics exposition text — the document the
openmetrics module's text source consumes.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
add doctest
update config
test for kadmelia; remove kadmelia option from doctests; add another hang test
test for kadmelia
remove kadmelia option from doctests; add another hang test
test lib directly
increase timeout
make start call non-blocking and generate an event instead
remove poc test
remove poc test
send() now accepts QByteArray directly (base64 still applied internally
for the FFI JSON). messageReceived emits payload as QByteArray instead
of a base64-encoded QString, matching logos-delivery behaviour.
Closes#27
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>