build.rs only invalidated on the generated rust_bindings, so editing any
Nim source left the linked archive stale and the tests silently ran
against the previous build -- which cost an hour of debugging a channel
failure against instrumentation that was never in the binary.
Also corrects channel_message_reaches_peer's ignore reason. The message
is not lost in SDS: Persistency is a process-wide singleton that refuses
re-targeting, so two in-process nodes share one SDS job whose rows are
keyed by channel id alone. The receiver loads the sender's history and
SDS rightly calls the message a replay. The channels API is fine; the
test needs two processes.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The channel test only checked that create/send/close returned values, so
it passed while every send failed downstream: channel_send returns a
request id immediately and reports the outcome asynchronously, and with
no listener on onChannelMessageError there was nothing to notice. Asking
the question properly -- two nodes, one channel, does the payload arrive
-- surfaced three things, none of them caused by the nim-ffi migration.
Encryption was never installed, so no segment could ever be sent; that is
fixed in the vendor by naming the mechanism at channel creation.
Autosharding could not be switched on from here at all. A channel's shard
is derived from its content topic, so without it the send cannot even
auto-subscribe. num-shards-in-network exists on the kernel conf but
WakuNodeConfig never exposed it, so it is added here.
Ingress is still dropped below this layer, so channel_message_reaches_peer
is #[ignore]d with the evidence in its doc comment rather than deleted or
weakened into a test that cannot fail. The single-node test keeps its
narrow scope and now says why it asserts nothing about arrival.
The error listeners stay: a send that fails silently is exactly how this
went unnoticed, and they turn a timeout into a diagnosis.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The select arm discarded test_echo_messages' Result, so the test passed
whenever that future finished -- including the path where the message
never arrived and it returned Err. Only the 1000s timeout could fail it,
which made the assertion close to vacuous for the case it exists to
cover.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The generated crate already provides what this tier existed to build:
CBOR marshalling, the callback dance, and a typed method per proc. So
macros.rs (trampoline, handle_ffi_call) and libwaku_response.rs
(RET_OK/RET_ERR, LibwakuResponse) are deleted rather than ported, and
node/events.rs goes with them -- its WakuEvent enum is now one generated
payload struct per event, which is what the typed listeners hand back.
What survives is what the generated crate does not give us: the domain
layer (WakuMessage, WakuContentTopic, MessageHash, pubsubtopic) and
WakuNodeConfig, which still serialises to the JSON create_node takes --
that JSON is unchanged, only its transport moved to CBOR.
BREAKING CHANGE: WakuNodeHandle and its Initialized/Running typestate,
waku_new, and waku_destroy are gone; callers use LogosDeliveryCtx::create
and let Drop tear the node down. set_event_callback is gone too: events
are per-name now, so a whole-stream callback has no equivalent -- use the
typed add_on_*_listener methods, which deliver a payload struct instead
of a JSON string to match on.
Tests and the example move with the API. The event handling gets shorter
rather than longer: no from_str, no matching five variants, no panicking
on Unrecognized -- a listener only receives the event it registered for.
Callers now base64-decode payloads themselves, since that was WakuMessage's
serde doing it before.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Exposes the reliable-channel surface: channel_create / channel_send /
channel_close on WakuNodeHandle, backed by the logosdelivery_channel_*
FFI calls. Channel state is persisted, so re-creating a closed channel
resumes it rather than starting fresh, and send payloads travel
base64-encoded.
Adds the three channel lifecycle events (received / sent / error) to
WakuEvent, plus the messaging events (sent, error, propagated, received)
and connection status change, so callers can observe delivery rather
than only firing and hoping.
build.rs resolves the nimble package dirs and librln by scanning rather
than hardcoding, since their names carry versions and hashes that move
whenever nimble.lock does. It also checks make's exit status: a failed
build previously passed silently and the crate linked a stale library
from an earlier run.
Bumps the vendor submodule to master.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* bump nwaku to the current master branch ( commit: 625c8ee5 )
* make the waku crate to behave tokio-asynchronously
* use of store
* use of lightpush and filter
* add waku-bindings/src/general/messagehash.rs
* add waku-bindings/src/general/time.rs
* add waku-bindings/src/general/waku_decode.rs
* add WakuEvent management (WakuMessage, ConnectionChange, TopicHealthChange.)
* add waku-bindings/src/macros.rs
* update nwaku vendor to v0.33.1
* build.rs: add negentropy dependency and cmdCount cmdLine dependencies
* fix: call waku_setup when instantiating waku_new
* Properly decode a Vec<Multiaddr>
* First commit tic-tac-toe
* adding some simple game logic to coordinate the turns a little
* some logic to panic if a proper event callback hasn't been set
* restoring back the type state pattern introduced by Richard
* new PubsubTopic type
* fix clippy issues
---------
Co-authored-by: Richard Ramos <info@richardramos.me>
- removes encoding functions from relay and lightpush
- adds `encode_symmetric` and `encode_asymmetric` to `WakuMessage`
- don't panic when unserializing json
* Fix for codecov branch names
* Codecov with all tests included
* Add tokio to node tests
* Run echo tests as seperate processes
* Add token to evade GH limiter
* Discv5 and default test for node