Home / Input Output / ouroboros-leios
Mar 18, 7-8 PM (0)
Mar 18, 8-9 PM (0)
Mar 18, 9-10 PM (0)
Mar 18, 10-11 PM (0)
Mar 18, 11-12 AM (0)
Mar 19, 12-1 AM (0)
Mar 19, 1-2 AM (0)
Mar 19, 2-3 AM (0)
Mar 19, 3-4 AM (0)
Mar 19, 4-5 AM (0)
Mar 19, 5-6 AM (0)
Mar 19, 6-7 AM (0)
Mar 19, 7-8 AM (1)
Mar 19, 8-9 AM (0)
Mar 19, 9-10 AM (1)
Mar 19, 10-11 AM (0)
Mar 19, 11-12 PM (1)
Mar 19, 12-1 PM (0)
Mar 19, 1-2 PM (0)
Mar 19, 2-3 PM (0)
Mar 19, 3-4 PM (0)
Mar 19, 4-5 PM (0)
Mar 19, 5-6 PM (0)
Mar 19, 6-7 PM (0)
Mar 19, 7-8 PM (0)
Mar 19, 8-9 PM (0)
Mar 19, 9-10 PM (0)
Mar 19, 10-11 PM (0)
Mar 19, 11-12 AM (0)
Mar 20, 12-1 AM (0)
Mar 20, 1-2 AM (0)
Mar 20, 2-3 AM (0)
Mar 20, 3-4 AM (0)
Mar 20, 4-5 AM (0)
Mar 20, 5-6 AM (0)
Mar 20, 6-7 AM (0)
Mar 20, 7-8 AM (1)
Mar 20, 8-9 AM (2)
Mar 20, 9-10 AM (1)
Mar 20, 10-11 AM (0)
Mar 20, 11-12 PM (0)
Mar 20, 12-1 PM (1)
Mar 20, 1-2 PM (0)
Mar 20, 2-3 PM (1)
Mar 20, 3-4 PM (0)
Mar 20, 4-5 PM (0)
Mar 20, 5-6 PM (0)
Mar 20, 6-7 PM (0)
Mar 20, 7-8 PM (1)
Mar 20, 8-9 PM (1)
Mar 20, 9-10 PM (0)
Mar 20, 10-11 PM (0)
Mar 20, 11-12 AM (0)
Mar 21, 12-1 AM (0)
Mar 21, 1-2 AM (0)
Mar 21, 2-3 AM (0)
Mar 21, 3-4 AM (0)
Mar 21, 4-5 AM (0)
Mar 21, 5-6 AM (0)
Mar 21, 6-7 AM (0)
Mar 21, 7-8 AM (0)
Mar 21, 8-9 AM (0)
Mar 21, 9-10 AM (0)
Mar 21, 10-11 AM (0)
Mar 21, 11-12 PM (0)
Mar 21, 12-1 PM (0)
Mar 21, 1-2 PM (0)
Mar 21, 2-3 PM (0)
Mar 21, 3-4 PM (0)
Mar 21, 4-5 PM (0)
Mar 21, 5-6 PM (0)
Mar 21, 6-7 PM (0)
Mar 21, 7-8 PM (0)
Mar 21, 8-9 PM (0)
Mar 21, 9-10 PM (0)
Mar 21, 10-11 PM (0)
Mar 21, 11-12 AM (0)
Mar 22, 12-1 AM (0)
Mar 22, 1-2 AM (0)
Mar 22, 2-3 AM (0)
Mar 22, 3-4 AM (0)
Mar 22, 4-5 AM (0)
Mar 22, 5-6 AM (0)
Mar 22, 6-7 AM (0)
Mar 22, 7-8 AM (0)
Mar 22, 8-9 AM (0)
Mar 22, 9-10 AM (0)
Mar 22, 10-11 AM (0)
Mar 22, 11-12 PM (0)
Mar 22, 12-1 PM (0)
Mar 22, 1-2 PM (0)
Mar 22, 2-3 PM (0)
Mar 22, 3-4 PM (0)
Mar 22, 4-5 PM (0)
Mar 22, 5-6 PM (11)
Mar 22, 6-7 PM (0)
Mar 22, 7-8 PM (0)
Mar 22, 8-9 PM (0)
Mar 22, 9-10 PM (0)
Mar 22, 10-11 PM (0)
Mar 22, 11-12 AM (0)
Mar 23, 12-1 AM (0)
Mar 23, 1-2 AM (0)
Mar 23, 2-3 AM (0)
Mar 23, 3-4 AM (0)
Mar 23, 4-5 AM (0)
Mar 23, 5-6 AM (0)
Mar 23, 6-7 AM (0)
Mar 23, 7-8 AM (0)
Mar 23, 8-9 AM (0)
Mar 23, 9-10 AM (0)
Mar 23, 10-11 AM (0)
Mar 23, 11-12 PM (1)
Mar 23, 12-1 PM (3)
Mar 23, 1-2 PM (4)
Mar 23, 2-3 PM (4)
Mar 23, 3-4 PM (1)
Mar 23, 4-5 PM (2)
Mar 23, 5-6 PM (1)
Mar 23, 6-7 PM (0)
Mar 23, 7-8 PM (0)
Mar 23, 8-9 PM (0)
Mar 23, 9-10 PM (0)
Mar 23, 10-11 PM (0)
Mar 23, 11-12 AM (0)
Mar 24, 12-1 AM (0)
Mar 24, 1-2 AM (0)
Mar 24, 2-3 AM (0)
Mar 24, 3-4 AM (0)
Mar 24, 4-5 AM (0)
Mar 24, 5-6 AM (0)
Mar 24, 6-7 AM (0)
Mar 24, 7-8 AM (0)
Mar 24, 8-9 AM (1)
Mar 24, 9-10 AM (4)
Mar 24, 10-11 AM (1)
Mar 24, 11-12 PM (2)
Mar 24, 12-1 PM (2)
Mar 24, 1-2 PM (3)
Mar 24, 2-3 PM (1)
Mar 24, 3-4 PM (1)
Mar 24, 4-5 PM (5)
Mar 24, 5-6 PM (0)
Mar 24, 6-7 PM (0)
Mar 24, 7-8 PM (0)
Mar 24, 8-9 PM (0)
Mar 24, 9-10 PM (0)
Mar 24, 10-11 PM (0)
Mar 24, 11-12 AM (0)
Mar 25, 12-1 AM (0)
Mar 25, 1-2 AM (0)
Mar 25, 2-3 AM (0)
Mar 25, 3-4 AM (0)
Mar 25, 4-5 AM (0)
Mar 25, 5-6 AM (0)
Mar 25, 6-7 AM (0)
Mar 25, 7-8 AM (1)
Mar 25, 8-9 AM (0)
Mar 25, 9-10 AM (1)
Mar 25, 10-11 AM (1)
Mar 25, 11-12 PM (3)
Mar 25, 12-1 PM (16)
Mar 25, 1-2 PM (0)
Mar 25, 2-3 PM (1)
Mar 25, 3-4 PM (0)
Mar 25, 4-5 PM (0)
Mar 25, 5-6 PM (0)
Mar 25, 6-7 PM (0)
Mar 25, 7-8 PM (0)
81 commits this week Mar 18, 2026 - Mar 25, 2026
net-rs: move codec.rs to mux/ and protocol.rs to protocols/
codec.rs wraps mux channels with CBOR framing — belongs in mux/.
protocol.rs defines the protocol state machine framework — belongs
in protocols/. Re-export from parent modules so imports become
crate::mux::{CodecSend,CodecRecv} and crate::protocols::{Protocol,
Runner,Agency,Role,ProtocolError}. Update all ~40 import sites.
238 tests pass.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: add Leios per-peer task integration (Phase 4d)
Wire LeiosNotify (ID 18) and LeiosFetch (ID 19) into the per-peer task
architecture behind a `leios_enabled` config flag (default false).

- LeiosStore: content-addressed blob store for EBs/votes (separate from
  ChainStore since Leios data is keyed by (slot, hash), not a linear chain)
- Client tasks: spawn_leios_notify (continuous request_next loop),
  spawn_leios_fetch (command-driven, like BlockFetch)
- Server handlers: serve_leios_notify (from LeiosStore + subscribe),
  serve_leios_fetch (block/txs/vote lookups)
- Types: 6 PeerEvent, 2 PeerCommand, 5 NetworkEvent, 3 NetworkCommand variants
- Coordinator: stub-forwards Leios events, populates LeiosStore on fetch
- Wiring: peer_task, responder_task, duplex_task all conditionally register
  and spawn Leios protocol sub-tasks
- CLI: --leios flag on serve (synthetic EB/vote generation) and multi-follow
  (logs Leios notifications) for local end-to-end testing

247 total tests (9 new). Locally tested: serve --leios -> multi-follow --leios.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: add TxSubmission protocol (Phase 3, step 1)
Implement the TxSubmission mini-protocol (protocol ID 4, version 2) —
pull-based transaction dissemination with blocking/non-blocking modes,
flow control, and full CBOR codec with indefinite-length inner lists.

Includes client-side run_client helper, server handler in fake server,
and CLI 'submit' command with single-tx and Poisson stream modes.
20 new tests (129 total), live-tested against fake server.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: document multi-peer coordinator design decision
Choose thread-per-peer with shared coordinator over Pallas v2
event-driven (single-threaded bottleneck) and Haskell actor model
(over-engineered for ~20 peers). Document PeerHandle sketch,
peer-agnostic consensus interface, and ordering rationale
(multi-peer before Leios protocols).

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: document Phase 4 Leios protocol implementation plan
Sub-phases 4a-4f: LeiosNotify/LeiosFetch protocols, Praos header/body
extensions, per-peer task integration, coordinator/ChainStore extensions,
and priority scheduling. Working assumptions: protocol IDs 18/19, opaque
types, two protocols initially, freshest-first deferred.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: add security hardening, live test vectors, and comprehensive tests
Security fixes:
- read_segment now validates payload_len against max_payload before
  allocating, preventing OOM from malicious segment headers
- CodecRecv enforces max_buffer (default 2.5MB) to prevent unbounded
  buffer growth from crafted CBOR that never completes decoding
- Demuxer passes configured sdu_size as the segment payload limit

Test vectors captured from backbone.cardano.iog.io:3001:
- ProposeVersions and AcceptVersion raw bytes validated against our
  encoder output (byte-for-byte match ensures wire compatibility)

New tests (19 added, 50 total):
- Wire: oversized payload rejection, live segment headers, timestamp wrap
- Codec: buffer overflow rejection, large cross-segment messages, channel close
- Handshake codec: unknown tag, truncated payload, live vector decode
- N2N: v7-v10 2-field format, live bytes decode, invalid CBOR, key order

Also: net-cli capture command, CLAUDE.md test vector workflow, .gitignore

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: harden CBOR decoding and demuxer against DoS attacks
- Cap version table entries at 256 and version mismatch list at 256
  in handshake codec, preventing unbounded allocation from crafted
  CBOR map/array lengths
- Switch demuxer from blocking send to try_send -- if a protocol's
  channel is full, the connection is torn down instead of blocking
  the demuxer (which would stall all protocols on the connection)
- Add test for oversized version table rejection

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: add persistent chain follower with reconnection
New `follow` CLI command that jumps to the current chain tip and prints
each new block as it arrives. Reconnects with exponential backoff on
failure, using a rolling window of known points for efficient
re-intersection. Shared connection helper extracted to reduce duplication
across CLI commands. Live-tested against Cardano mainnet.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: implement bearer, multiplexer, and channel infrastructure
Phase 1 steps 1-6: the core transport and multiplexing layers.

- Workspace setup: net-core (library) + net-cli (binary) crates
- bearer/: trait-based transport abstraction with TcpBearer and MemBearer
- mux/wire: 8-byte segment header encode/decode, segment read/write,
  payload fragmentation into SDUs
- mux/channel: split ChannelSend/ChannelRecv halves (pipelining-ready)
- mux/scheduler: Scheduler trait with RoundRobin and StrictPriority
- mux/egress: muxer task with per-protocol staging buffers and
  scheduler-driven segment writing
- mux/ingress: demuxer task with per-protocol dispatch and configurable
  ingress buffer limits (overflow = connection teardown per spec)
- mux/mod: Mux assembly tying it all together with register() and run()

16 tests covering wire format round-trips, scheduler behavior, bearer
data exchange, and full mux integration (single-protocol, bidirectional,
multi-protocol) over MemBearer.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: add CBOR codec layer over multiplexer channels
Phase 1 step 7: CBOR message framing over raw mux byte channels.

- CodecSend: encodes any minicbor::Encode type to CBOR and sends via channel
- CodecRecv: accumulates bytes across segment boundaries and incrementally
  decodes CBOR messages using minicbor, solving the no-message-framing
  problem from the Ouroboros wire protocol
- Uses HRTB (for<'a> Decode) to avoid lifetime conflicts between the
  decode buffer and mutation — decoded types must be owned
- minicbor 0.25 dependency added

Tests: codec round-trip and multiple-message sequencing over MemBearer mux.
18 tests total, all passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: document security audit for all protocols
Add per-protocol security audit sections for the six Praos protocols
(Handshake, ChainSync, BlockFetch, TxSubmission, KeepAlive, PeerSharing)
covering allocation bounds, timeout coverage, and test coverage. Reorder
sections by protocol ID and remove Phase markers from all headings. Link
README "Security hardened" note to the audit doc.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: add Leios coordinator extensions (Phase 4e)
Replace stub-forwarded Leios events with smart coordinator logic:
- Slot-bounded dedup for EB, TX, and vote offers across peers
- Per-offer peer tracking for RTT-based smart fetch routing
- Pending fetch dedup and cleanup on peer failure
- Separate LeiosBlockTxsOffered/LeiosBlockTxsReceived events
- FetchLeiosBlockTxs (with bitmap) and FetchLeiosVotes commands
- leios_dedup_window config (default 1000 slots)
- 8 new coordinator tests (255 total)
- Live-tested: serve --leios → multi-follow --leios (two connections)

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: add Leios per-peer task integration (Phase 4d)
Wire LeiosNotify (ID 18) and LeiosFetch (ID 19) into the per-peer task
architecture behind a `leios_enabled` config flag (default false).

- LeiosStore: content-addressed blob store for EBs/votes (separate from
  ChainStore since Leios data is keyed by (slot, hash), not a linear chain)
- Client tasks: spawn_leios_notify (continuous request_next loop),
  spawn_leios_fetch (command-driven, like BlockFetch)
- Server handlers: serve_leios_notify (from LeiosStore + subscribe),
  serve_leios_fetch (block/txs/vote lookups)
- Types: 6 PeerEvent, 2 PeerCommand, 5 NetworkEvent, 3 NetworkCommand variants
- Coordinator: stub-forwards Leios events, populates LeiosStore on fetch
- Wiring: peer_task, responder_task, duplex_task all conditionally register
  and spawn Leios protocol sub-tasks
- CLI: --leios flag on serve (synthetic EB/vote generation) and multi-follow
  (logs Leios notifications) for local end-to-end testing

247 total tests (9 new). Locally tested: serve --leios -> multi-follow --leios.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: add Shelley+ header and block body parsers (Phase 4c)
Convert WrappedHeader from opaque tuple struct to named-field struct
with parsed HeaderInfo. Parser navigates era-tagged #6.24-wrapped CBOR
to extract block_number, slot, prev_hash, issuer_vkey, body_size, and
block_body_hash, plus CIP-0164 optional Leios fields (announced_eb,
certified_eb). Array length alone disambiguates which optional fields
are present (10=none, 11=certified_eb, 12=announced_eb, 13=both).

Convert BlockBody similarly with parsed LeiosBlockInfo. Block parser
extracts the optional eb_certificate from the 5th element of the
Shelley+ block array. Byron headers/blocks return None gracefully.

Box InjectBlock header to fix large_enum_variant. Update all call
sites (~20 files). 238 total tests, 17 new parser tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: document Phase 4 Leios protocol implementation plan
Sub-phases 4a-4f: LeiosNotify/LeiosFetch protocols, Praos header/body
extensions, per-peer task integration, coordinator/ChainStore extensions,
and priority scheduling. Working assumptions: protocol IDs 18/19, opaque
types, two protocols initially, freshest-first deferred.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>