Skip to content

Commit 98883ed

Browse files
fix(channels): default channels to unencrypted so messages flow
Channels encrypt on egress and decrypt on ingress through the Encrypt/ Decrypt request brokers. Nothing in the production/FFI path registered a provider, so every send failed at encryption before reaching the wire and every receive failed at decryption before reassembly. The net effect was that channel_send put nothing on the network and channel_message_received never fired. Install the pass-through noop provider in ReliableChannelManager.start(), the symmetric spot to MessagingClient.start() wiring MessagingSend, on the same FFI worker thread the channel handlers run on (the brokers are thread-local). setProvider refuses to overwrite, so an application that installs its own encryption before start keeps it; otherwise channels default to unencrypted payloads. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent ce918b0 commit 98883ed

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

logos_delivery/channels/reliable_channel_manager.nim

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import logos_delivery/api/reliable_channel_manager_api
1818
import logos_delivery/api/conf/channels_conf
1919

2020
import ./reliable_channel
21+
import ./encryption/noop_encryption
2122

2223
export reliable_channel, channels_conf
2324

@@ -40,10 +41,15 @@ proc new*(
4041
)
4142

4243
proc start*(self: ReliableChannelManager): Result[void, string] =
43-
## Placeholder: per-channel listeners are installed in `ReliableChannel.new`,
44-
## so the manager has nothing to start at this layer. Kept for symmetry
45-
## with the `Waku` mount/start lifecycle and as a hook for future state.
46-
discard
44+
## Per-channel listeners are installed in `ReliableChannel.new`, so the only
45+
## thing to wire up here is the encryption brokers. Channels encrypt on egress
46+
## and decrypt on ingress via the `Encrypt`/`Decrypt` request brokers; with no
47+
## provider registered every send and receive would fail, so `channel_send`
48+
## would never reach the wire and `ChannelMessageReceivedEvent` would never
49+
## fire. Install the pass-through noop so channels default to unencrypted
50+
## payloads. `setProvider` refuses to overwrite, so an application that
51+
## installed its own encryption before start keeps it.
52+
setNoopEncryption()
4753
ok()
4854

4955
proc stop*(self: ReliableChannelManager) {.async.} =

0 commit comments

Comments
 (0)