mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-08-25 15:31:16 +00:00
Filter subscribe never completed against a local wakunode2. It was not a filter
bug: `ffi_poll()` advances chronos by exactly ONE iteration, and the reference
demo pumped it with `setInterval(fn, 1)` — clamped to ~4ms and running the body
once, so ~250 polls/s. A libp2p handshake is thousands of small reads and writes,
each needing a poll, so identify alone took ~12.7s on localhost. The node then
timed out its `/vac/waku/metadata/1.0.0` request to the edge and disconnected
("waku metatdata request failed"), taking the in-flight subscribe down with it.
Bursting instead: identify ~1.0s, and the node logs "subscription added
correctly". Same wasm, same node, only the pump changed.
Documented rather than only fixed in the demo, because the constraint belongs to
every host that embeds this module -- the demo lives under the gitignored build/,
and web/ld-edge/ld-edge.js in lion-signet has the identical setInterval pump.
The recommended pump bursts only while a request is outstanding and idles on a
throttled timer, so an idle node isn't a spinner; the idle batch is still sized
to service timers and inbound filter pushes (verified holding a subscription
open for several minutes).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012qDYE5r2t2dMry5XpWWySu