Home / Input Output / ouroboros-leios-sim
Mar 19, 4-5 AM (0)
Mar 19, 5-6 AM (0)
Mar 19, 6-7 AM (0)
Mar 19, 7-8 AM (2)
Mar 19, 8-9 AM (0)
Mar 19, 9-10 AM (1)
Mar 19, 10-11 AM (1)
Mar 19, 11-12 PM (3)
Mar 19, 12-1 PM (0)
Mar 19, 1-2 PM (0)
Mar 19, 2-3 PM (0)
Mar 19, 3-4 PM (2)
Mar 19, 4-5 PM (1)
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 (2)
Mar 20, 8-9 AM (1)
Mar 20, 9-10 AM (0)
Mar 20, 10-11 AM (0)
Mar 20, 11-12 PM (1)
Mar 20, 12-1 PM (0)
Mar 20, 1-2 PM (2)
Mar 20, 2-3 PM (1)
Mar 20, 3-4 PM (2)
Mar 20, 4-5 PM (1)
Mar 20, 5-6 PM (1)
Mar 20, 6-7 PM (0)
Mar 20, 7-8 PM (5)
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 (4)
Mar 21, 2-3 PM (1)
Mar 21, 3-4 PM (0)
Mar 21, 4-5 PM (1)
Mar 21, 5-6 PM (5)
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 (1)
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 (3)
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 (2)
Mar 23, 10-11 AM (1)
Mar 23, 11-12 PM (0)
Mar 23, 12-1 PM (5)
Mar 23, 1-2 PM (6)
Mar 23, 2-3 PM (8)
Mar 23, 3-4 PM (2)
Mar 23, 4-5 PM (3)
Mar 23, 5-6 PM (0)
Mar 23, 6-7 PM (2)
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 (0)
Mar 24, 9-10 AM (0)
Mar 24, 10-11 AM (0)
Mar 24, 11-12 PM (1)
Mar 24, 12-1 PM (0)
Mar 24, 1-2 PM (3)
Mar 24, 2-3 PM (1)
Mar 24, 3-4 PM (2)
Mar 24, 4-5 PM (1)
Mar 24, 5-6 PM (0)
Mar 24, 6-7 PM (0)
Mar 24, 7-8 PM (0)
Mar 24, 8-9 PM (2)
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 (0)
Mar 25, 8-9 AM (1)
Mar 25, 9-10 AM (3)
Mar 25, 10-11 AM (0)
Mar 25, 11-12 PM (1)
Mar 25, 12-1 PM (26)
Mar 25, 1-2 PM (0)
Mar 25, 2-3 PM (2)
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)
Mar 25, 8-9 PM (0)
Mar 25, 9-10 PM (0)
Mar 25, 10-11 PM (0)
Mar 25, 11-12 AM (0)
Mar 26, 12-1 AM (0)
Mar 26, 1-2 AM (0)
Mar 26, 2-3 AM (0)
Mar 26, 3-4 AM (0)
Mar 26, 4-5 AM (0)
114 commits this week Mar 19, 2026 - Mar 26, 2026
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: add multi-peer coordinator (Phase 3 complete)
Thread-per-peer coordinator with peer-agnostic application interface.
Each peer runs independent tokio task tree (ChainSync, BlockFetch,
KeepAlive, PeerSharing sub-tasks). Coordinator aggregates tips with
deduplication, routes fetch requests to best peer by RTT, and
reconnects failed peers with exponential backoff (1s-30s).

New modules: net-core/src/peer/ (types, peer_task, coordinator,
connect). Connection helpers moved from net-cli to net-core.
New CLI: multi-follow --host <addr> [--host <addr>...].
ConnectionMode enum supports future ResponderOnly/Duplex modes.

153 tests (147 existing + 6 new). Live-tested against mainnet.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: add per-module and per-protocol READMEs
Hierarchical documentation: top-level README links to net-core/ and
net-cli/, net-core links to bearer/mux/types/protocols/peer modules,
protocols/ links to each of the 8 protocol subdirectories. Each
protocol README includes Mermaid state machine diagram, agency table,
limits, and API entry points. All links point to directories (not
README.md) so GitHub shows files alongside docs.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: remove server Request/Response boilerplate, use Message directly
The server-side Request/Response enums were 1:1 mappings of Message
variants, and receive_request()/send_response() were pure conversion
boilerplate. The Runner already enforces agency and state transitions,
so these types added no safety.

Server code now uses runner.recv()/runner.send() with Message directly,
matching the simplicity of the protocol framework design.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: update CLAUDE.md and implementation plan for Phase 2 completion
Document all Phase 2 deliverables: shared types, ChainSync/BlockFetch/
KeepAlive protocols (client + server), persistent chain follower, fake
server with Poisson blocks/rollbacks, serve.rs in workspace structure,
server-uses-Message-directly design decision. Add Phase 3 detail for
TxSubmission and PeerSharing protocols.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: split types.rs into types/ module (header.rs, block.rs)
Refactor the 1086-line types.rs into a directory module:
- types/mod.rs: Point, Tip, encode/decode_points, constants, re-exports
- types/header.rs: WrappedHeader, HeaderInfo, Shelley+ header parser
- types/block.rs: BlockBody, LeiosBlockInfo, block body parser

All import paths preserved via re-exports. 238 tests pass.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: add duplex connection mode (Phase 3 complete)
Mux now supports both directions on one connection via composite
(ProtocolId, u16) channel keys. register_with_mode() lets callers
specify direction explicitly; register() remains backward compatible.
Demuxer routes by (protocol_id, mode) — no single-mode validation.
Scheduler stays keyed by ProtocolId (both directions share priority).

New: DuplexConnection, connect_duplex(), accept_duplex() for
bidirectional connection setup. DuplexTask combines client + server
protocol sub-tasks on one mux. Coordinator spawns duplex tasks when
config.duplex is set. multi-follow --duplex flag.

All three ConnectionMode variants now implemented:
- InitiatorOnly: outbound, client protocols
- ResponderOnly: inbound, server protocols
- Duplex: both on one connection

172 tests. Live-tested duplex against mainnet (version 15).

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 PeerSharing protocol (Phase 3, step 2)
Implement PeerSharing mini-protocol (protocol ID 10) — simple
request/reply for peer discovery with IPv4/IPv6 address support.
CLI 'peer-share' command with peer_sharing=1 handshake negotiation
and graceful rejection when node doesn't support it.
18 new tests (147 total), live-tested against mainnet relays.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: add ResponderOnly peers and refactor serve to use coordinator
Add server-side peer support to the multi-peer coordinator:
- ChainStore: shared in-memory chain state (VecDeque with capacity
  eviction, watch::channel notification) for responder peers
- Server handlers: extract serve_chainsync/blockfetch/keepalive/
  txsubmission/peersharing from net-cli into net-core, parameterized
  on Arc<ChainStore>
- ResponderTask: per-inbound-connection task spawning server handlers
- Accept loop: coordinator spawns background accept task if
  listen_address configured
- InjectBlock/InjectRollback commands for external block injection
- TransactionReceived event from TxSubmission server

Refactor serve.rs from 660 lines of ad-hoc peer management to 130
lines using the coordinator with InjectBlock commands from a Poisson
block generator.

Add --listen flag to multi-follow for relay mode.

171 tests (153 + 14 chain_store + 3 server_handlers + 1 responder).
Live-tested: serve → multi-follow --listen → follow relay chain.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: add LeiosFetch protocol (Phase 4b)
State machine (6 states, 10 messages), CBOR codec with bitmap TX
addressing, client helpers (fetch_block, fetch_block_txs, fetch_votes,
fetch_block_range, done), and security audit. Protocol ID 19. 16 MB
max EB size. All types opaque blobs. 30 new tests including allocation
bounds, bitmap encoding, and MemBearer integration. 221 total tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: add random rollbacks to fake server (Poisson distributed)
New --rollback-rate flag for the serve command generates random chain
rollbacks (depth 1-3) on an independent Poisson schedule. The ChainSync
server detects when a client's read pointer is invalidated by a rollback
and sends MsgRollBackward. Default rate is 0 (no rollbacks).

Example: --block-rate 1.0 --rollback-rate 0.1

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: implement Phase 2 — ChainSync and BlockFetch protocols
Add shared Cardano types (Point, Tip, WrappedHeader, BlockBody), ChainSync
protocol (intersection finding, tip following with AwaitReply handling), and
BlockFetch protocol (range requests, block streaming). Both protocols include
full state machines, CBOR codecs with allocation bounds, composable client
helpers, and integration tests over MemBearer. CLI commands added for live
testing. Verified against Cardano mainnet (backbone.cardano.iog.io:3001).

98 tests total, security-audited per CLAUDE.md checklist.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: implement protocol framework, handshake, and CLI
Phase 1 steps 7-11: protocol framework, handshake protocol, and live test.

- protocol.rs: Protocol trait (state machine definition), Runner with
  agency-checked send/recv over codec, Role (Client/Server)
- protocols/handshake: full N2N handshake implementation
  - State machine: Propose -> Confirm -> Done
  - CBOR codec matching spec section 3.6.9 (ProposeVersions, AcceptVersion,
    Refuse with 3 reason variants, QueryReply)
  - Version table uses BTreeMap for ascending key order per spec
  - Version data stored as opaque CBOR bytes in the table, decoded lazily
  - n2n: VersionData (magic, diffusion, peerSharing, query), version table
    builder for V14/V15, negotiate() implementing spec algorithm
  - run_client/run_server async functions
- net-cli: subcommand-based CLI with `handshake` command
  - Connects to a Cardano node, proposes V14/V15, prints result
  - Tested live against backbone.cardano.iog.io:3001 -- V15 accepted

29 tests covering codec round-trips, negotiation logic (success, magic
mismatch, no common version), and full client<->server integration over
MemBearer.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: add server-side protocol helpers and fake server CLI
Add symmetric Request/Response enum pairs with receive_request() and
send_response() functions for ChainSync, BlockFetch, and KeepAlive
protocols. Add accept_and_handshake() server connection helper.

New `serve` CLI command runs a fake Cardano node that generates blocks
on a Poisson schedule (configurable rate), serves ChainSync/BlockFetch/
KeepAlive to connecting clients. Live-tested with the `follow` command.

Also fix all pre-existing clippy warnings (matches! macro, io::Error::other,
map key iteration).

109 tests, zero clippy warnings.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: add project docs, protocol reference, implementation survey, and Phase 1 plan
- CLAUDE.md: project overview, code standards, architecture notes, doc index
- docs/praos-network.md: complete N2N protocol reference from spec + blueprint
  (mux wire format, all 6 mini-protocols with state machines, CDDL, timeouts,
  concrete Cardano era-tagged types)
- docs/implementation-haskell.md: ouroboros-network architecture survey
  (typed-protocols framework, mux Wanton scheduling, connection manager)
- docs/implementation-pallas-v1.md: pallas-network v1 survey
  (facade API, runtime agency checks, design assessment)
- docs/implementation-pallas-v2.md: pallas-network2 survey
  (Interface/Behavior/Manager pattern, pure state machines, promotion system)
- docs/leios-changes.md: CIP-0164 Leios network additions
  (LeiosNotify/LeiosFetch protocols, EB/vote/certificate types, QoS requirements,
  structural implications for net-rs)
- plans/masterplan.md: project vision, requirements, design areas
- plans/implementation-plan.md: Phase 1 plan (bearer, mux, codec, handshake, CLI)

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: update CLAUDE.md and implementation plan for Phase 1 completion
CLAUDE.md: add workspace structure, key design decisions (HRTB codecs,
Runner pattern, try_send demuxer, IngressCounter, supervisor), update
phase list to show Phase 1 complete with 4 phases total.

implementation-plan.md: mark Phase 1 complete with notes on what was
built vs planned (supervisor, security hardening, capture command, test
vectors -- all additions beyond the original plan).

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