code
Clone this repository
https://tangled.org/gdiazlo.tngl.sh/swim
git@tangled.org:gdiazlo.tngl.sh/swim
For self-hosted knots, clone URLs may differ based on your setup.
- Add TCP buffer pools to Protocol.t (64KB recv, 128KB decompress)
- Update LZW to work directly with Cstruct (zero-copy decompression)
- Add decompress_to_buffer and decompress_cstruct functions to LZW
- Add Cstruct-based codec functions (decode_compress_from_cstruct,
decode_push_pull_msg_cstruct)
- Update handle_tcp_connection to use buffer pools instead of per-
connection allocation
- Eliminate Cstruct.to_string conversions in hot path
Closes: swim-hrd
- Implement pure OCaml LZW decompression (LSB order, litWidth=8)
- Handle Compress_msg (type 9) in TCP connection handler
- Re-enable compression in Go memberlist (default behavior)
- Add LZW unit tests verifying Go-compatible decompression
This enables full interoperability with memberlist's default
compressed pushPull messages during Join().
- Add TCP listener creation in transport.ml and protocol.ml
- Implement pushPull message handling for TCP state sync
- Add push_pull_header and push_node_state types to Wire module
- Add encode/decode functions for pushPull messages in codec.ml
- Wire up TCP listener fiber in swim.ml Cluster.start
- Disable compression in Go interop test (memberlist uses LZ4)
This enables Go memberlist nodes to Join() to our OCaml SWIM cluster
via TCP pushPull state exchange.
- Use encryption version 1 (no PKCS7 padding) for outgoing messages
- Support decrypting both version 0 (with PKCS7) and version 1
- Add --encrypt flag to interop_test for encrypted testing
- Add test_interop_encrypted.sh for encrypted interop testing
Verified: OCaml SWIM ↔ Go memberlist encrypted ping/ack works.
- Refactor encode/decode functions to use Cstruct buffers directly
- Add *_to_cstruct and *_from_cstruct variants for all codec functions
- Fix compound message encoding bug: create fresh buffer per message
- Add backward-compatible string wrappers for tests
All tests pass including codec roundtrip property tests and Go interop.