Bumps vendor to the typed SendRequest / ChannelSendRequest procs and
updates the channels test to fill the typed struct instead of building a
JSON string. send_async now takes SendRequest, channel_send_async takes
(channel_id, ChannelSendRequest); both structs are re-exported from the
generated crate.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Picks up the two logos-delivery commits: the generated C header
replacing the stale hand-written ones, and the cbor_serialization lock
corrected to 0.4.0. Neither touches the generated Rust bindings; the full
suite still passes.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Cargo runs test binaries in parallel and serial_test only serialises
within one, so the channels and node suites were sharing ./data — two
processes over one on-disk persistency root. Nothing here proves that
caused harm, but shared mutable state across concurrent processes is not
worth leaving in place.
local_storage_path is added to WakuNodeConfig to make this expressible.
The field is worth having regardless: it was simply missing, and its
docs record that the persistency singleton refuses re-targeting, so a
second node in the same process must use the same path or fail to start.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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>
examples/ is its own cargo workspace and only examples/basic is a member
of the root one, so nothing built from the repo root ever compiled these
two. They still used waku_new, set_event_callback, WakuEvent and the
WakuNodeHandle typestate, none of which exist any more.
Both collapse their App<State> typestate: the node no longer carries one,
so neither can the app wrapping it. Event handling shrinks to a single
add_on_received_message_listener -- the filter on content topic stays,
but the enum match, the JSON parse and the panics on unexpected variants
go, since a listener only receives what it registered for. Payloads are
base64-decoded by the caller now.
The store DTOs (StoreQueryRequest, StoreResponse, StoreWakuMessageResponse)
come back as general/store.rs: they are plain serde shapes, and deleting
node/store.rs took them out along with the FFI call they sat next to.
toy-chat needs them to build the store query JSON and read the response.
CI gains a check over examples/Cargo.toml. Without it these rot silently
on the next API change, which is exactly how they got here.
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>
nim-ffi 0.2.0 generates the Rust bindings from the Nim source, so
bindgen over the hand-written headers is no longer the source of truth
-- and could not be, since those headers describe the pre-CBOR ABI.
The generated sources are referenced in place under vendor rather than
copied, so regenerating them in logos-delivery flows straight through
with nothing to keep in sync. They stay sibling modules because api.rs
resolves its neighbours through `super::`.
build.rs keeps driving the build: it runs the vendor's make target,
scans for the version-and-hash-named nimble package dirs and librln, and
emits the miniupnpc / natpmp / c++ link flags. The generated build.rs
does none of that (it runs a bare `nim c --mm:orc` against a path that
does not resolve here), so only the bindgen half is dropped.
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>
* build.rs: initialize submodules the first time cargo build is invoked in waku-sys
* messagehash.rs only contains a String as the hex representation of msg hash
* events.rs adapt test to parse message event containing msg-hash in hex string format
* bump nwaku to v0.35.0
* waku-sys/build.rs use STATIC=1 instead of STATIC=true
* 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>