sl-messages
Message transport and encoding primitives for MPC-style protocols.
This crate provides:
message: deterministic message IDs (MsgId), tags, headers, and message allocation.relay: async relay abstraction (Relay) with in-memory, buffered, and optional mux/websocket backends.signed: typed signed message verification helpers.encrypted: encryption scheme abstractions and message builders.setup(feature-gated): protocol participant setup, round tracking, and abort-message validation. Includessetup::keyswith no-op key/signature types for trusted transports.
Features
Default features: fast-ws, mux, setup.
setup: protocol-round helpers insl_messages::setup.mux: relay multiplexer (relay::mux) for fan-in/fan-out message routing.fast-ws: websocket relay (ws::FastRelay) based onfastwebsockets.simple-relay: marker feature used by downstream integrations.
Basic usage
Build a message ID and message bytes:
use Duration;
use ;
let instance = from;
let sender = ;
let id = broadcast;
let msg = allocate_message;
assert!;
Use the in-memory relay:
use Duration;
use ;
#
# async
Notes
BufferedMsgRelayadds local buffering and predicate-based waiting (wait_for,wait_for_limited).- Cancel safety of buffered waits depends on the cancel-safety guarantees of the wrapped relay implementation.
License
See LICENSE.