Home / Input Output / ouroboros-leios-sim
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 (1)
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)
Mar 26, 5-6 AM (0)
Mar 26, 6-7 AM (0)
Mar 26, 7-8 AM (1)
Mar 26, 8-9 AM (1)
Mar 26, 9-10 AM (4)
Mar 26, 10-11 AM (1)
Mar 26, 11-12 PM (5)
Mar 26, 12-1 PM (3)
Mar 26, 1-2 PM (2)
Mar 26, 2-3 PM (1)
Mar 26, 3-4 PM (2)
Mar 26, 4-5 PM (2)
Mar 26, 5-6 PM (1)
Mar 26, 6-7 PM (0)
Mar 26, 7-8 PM (0)
Mar 26, 8-9 PM (0)
Mar 26, 9-10 PM (0)
Mar 26, 10-11 PM (0)
Mar 26, 11-12 AM (0)
Mar 27, 12-1 AM (0)
Mar 27, 1-2 AM (0)
Mar 27, 2-3 AM (0)
Mar 27, 3-4 AM (0)
Mar 27, 4-5 AM (0)
Mar 27, 5-6 AM (0)
Mar 27, 6-7 AM (0)
Mar 27, 7-8 AM (0)
Mar 27, 8-9 AM (0)
Mar 27, 9-10 AM (1)
Mar 27, 10-11 AM (0)
Mar 27, 11-12 PM (0)
Mar 27, 12-1 PM (0)
Mar 27, 1-2 PM (0)
Mar 27, 2-3 PM (0)
Mar 27, 3-4 PM (0)
Mar 27, 4-5 PM (0)
Mar 27, 5-6 PM (0)
Mar 27, 6-7 PM (0)
Mar 27, 7-8 PM (0)
Mar 27, 8-9 PM (0)
Mar 27, 9-10 PM (0)
Mar 27, 10-11 PM (0)
Mar 27, 11-12 AM (0)
Mar 28, 12-1 AM (0)
Mar 28, 1-2 AM (0)
Mar 28, 2-3 AM (0)
Mar 28, 3-4 AM (0)
Mar 28, 4-5 AM (0)
Mar 28, 5-6 AM (0)
Mar 28, 6-7 AM (0)
Mar 28, 7-8 AM (0)
Mar 28, 8-9 AM (0)
Mar 28, 9-10 AM (0)
Mar 28, 10-11 AM (0)
Mar 28, 11-12 PM (0)
Mar 28, 12-1 PM (0)
Mar 28, 1-2 PM (0)
Mar 28, 2-3 PM (0)
Mar 28, 3-4 PM (0)
Mar 28, 4-5 PM (0)
Mar 28, 5-6 PM (0)
Mar 28, 6-7 PM (0)
Mar 28, 7-8 PM (0)
Mar 28, 8-9 PM (0)
Mar 28, 9-10 PM (0)
Mar 28, 10-11 PM (0)
Mar 28, 11-12 AM (0)
Mar 29, 12-1 AM (0)
Mar 29, 1-2 AM (0)
Mar 29, 2-3 AM (0)
Mar 29, 3-4 AM (0)
Mar 29, 4-5 AM (0)
Mar 29, 5-6 AM (0)
100 commits this week Mar 22, 2026 - Mar 29, 2026
net-rs: extract header from block body, remove magic 0xA0 fallback (risk register R#2)
BlockBody::header() extracts the WrappedHeader directly from block body
CBOR, reusing shared try_extract_header() logic with point(). Coordinator
now falls back to body.header() when pending_headers misses, and skips
chain store insertion if neither produces a header. Post-remediation
review: added Resolution subsections for all three residual observations,
stripped trailing whitespace.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: update docs — test counts, scheduler name, risk register statuses
- Test count 258/280 → 291 in README, CLAUDE.md, implementation-plan
- README scheduler label: strict priority → PriorityWfq (actual default)
- CLAUDE.md: document SubmitTransaction broadcast in coordinator
- Risk register: consistent "Fixed" status (#8 was "Resolved", #9 "Mitigated")

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: wire client-side TxSubmission into peer orchestration (risk register #11)
TxSubmission protocol was implemented but only wired on the server side.
Client connections never negotiated it, so outbound peers couldn't push
transactions. Register in client_protocol_configs, add spawn_txsubmission,
wire into peer_task/duplex_task/coordinator with broadcast semantics.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: configurable two-class WFQ scheduler (risk register #7)
Replace hardcoded StrictPriority with PriorityWfq as the default mux
scheduler. Protocols are assigned to Priority class (absolute priority,
round-robin) or Default class (message-based weighted fair queuing).
Praos protocols get Priority; Leios and PeerSharing get Default(1).
This prevents starvation of lower-priority protocols while maintaining
absolute Praos priority.

- Split scheduler.rs into scheduler/ module: PriorityWfq (new default),
  StrictPriority (hardwired tiers), RoundRobin (testing)
- Replace ProtocolConfig.priority: u8 with traffic_class: TrafficClass
- Add AnyScheduler dispatch enum and SchedulerType for runtime selection
- CLI --scheduler (round-robin|strict-priority|priority-wfq) and
  --protocol-priority <id>,<P|weight> shared across serve/follow/multi-follow
- Thread scheduler_type and traffic_class_overrides through CoordinatorConfig
  and per-peer task configs
- Mark risk register #7 as fixed

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: replace egress busy-wait with Notify-based wakeup
The mux egress loop previously used yield_now() in a polling loop to
wait for protocol data, causing CPU churn. Replace with a shared
tokio::sync::Notify per Mux instance: ChannelSend signals notify_one()
after queuing data, and the egress loop blocks on notified() instead
of spinning. A 100ms timeout handles closed-channel cleanup.

Risk register item #6 marked fixed.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: fork-aware block fetch routing via per-peer ChainFragment
Replace weak peer selection (any peer with block_no > 0) with per-peer
chain fragment tracking. Each peer's fragment records the exact set of
points announced via ChainSync, enabling the coordinator to verify a
peer provably has a requested block before routing a fetch to it.

- ChainFragment module (multi_peer/chain_fragment.rs) with Vec+HashSet,
  rollback truncation, and per-point removal on successful fetch
- WrappedHeader::point() derives header points via shared header_hash()
  helper (Blake2b-256), fixing pending_headers keying bug that used
  tip.point instead of the announced header's actual point
- PeerEvent::IntersectionFound surfaces intersection from find_intersection
- PeerEvent::BlockFetchFailed / NetworkEvent::BlockFetchFailed surface
  NoBlocks responses with full range (from, to) to the application
- Risk register item #4 marked fixed
- Future work: BlockFetch pipelining, multi-block range fetching

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: split peer/ into multi_peer/, store/, and peer/ modules
Separate concerns that were mixed in the peer/ module:
- multi_peer/ — coordinator, NetworkEvent/NetworkCommand, app interface
- store/ — ChainStore, LeiosStore (shared cross-peer state)
- peer/ — per-connection tasks, server handlers, PeerEvent/PeerCommand

Layering: multi_peer → peer → protocols; both multi_peer and peer → store.
No circular dependencies.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: fix BlockFetch point misattribution
Remove point from PeerEvent::BlockFetched — the block body contains
the header, so point derivation belongs at the coordinator level.

Add BlockBody::point() which extracts the header from the block,
parses it for slot via HeaderInfo, and computes Blake2b-256 of the
header CBOR for the block hash. Coordinator now derives correct
points for each streamed block, fixing multi-block range fetches.

- Add blake2b_simd dependency (pure Rust)
- Add BlockBody::point() with tests
- Remove point field from PeerEvent::BlockFetched
- Coordinator derives point via body.point()
- Update risk register items #2 (commit hash) and #3 (Fixed)

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: fix handshake capability advertisement
- Set peer_sharing=1 in all paths (PeerSharing protocol is always registered)
- Set initiator_only_diffusion_mode=true for InitiatorOnly connections,
  false for Duplex (was incorrectly false everywhere)
- negotiate() now takes server VersionData and correctly ORs diffusion
  modes from both sides per spec (was only using client's value)
- Add negotiate_diffusion_mode_or test
- Update risk register items #1 (commit hash) and #2 (Fixed)

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
net-rs: enforce per-state message size limits at demuxer level
Protocol::size_limit() was defined on all 8 protocols but never checked.
Now enforced at the demuxer (one hop from TCP socket) via shared
IngressLimit atomic that Runner updates on every state transition.
This lets TCP backpressure naturally constrain senders of oversized data.

- Add IngressLimit shared type (Arc<AtomicUsize>) to channel.rs
- Demuxer reads dynamic limit on every segment dispatch
- Runner sets ingress limit in new(), send(), and recv()
- Remove redundant codec max_buffer (was hardcoded 2.5MB, blocked
  valid 16MB LeiosFetch messages)
- Make Protocol::size_limit() a required trait method (no default);
  zero return = fail closed (reject all data)
- Update risk register item #1 to Fixed

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
'Risk register' from ChatGPT analysis of codebase
Prompts:

1. Take a deep dive into this Cardano networking library and critique it for
structure, adherence to the specs and security in the face of adversarial
peers.  It's in branch prc/net-rs
{repo link}

2. Turn this into a risk register in markdown with sections for each item
that needs attention, with a title, description, more details if you have it,
the current status, which will be open, and the severity of the risk.
net-rs: use Point type for Leios slot+hash encoding
Leios protocol messages now encode slot+hash as a nested [slot, hash]
CBOR sub-array via the existing Point type, matching the Praos Point
encoding convention and the Haskell prototype's LeiosPoint format.

Previously slot and hash were flat sibling fields in the CBOR encoding
(e.g. [2, slot, hash]); now they use Point (e.g. [2, [slot, hash]]).
This was identified during a desk check against the ouroboros-consensus
leios-prototype branch (commit 881e2c6).

Changes:
- LeiosNotify: MsgLeiosBlockOffer/MsgLeiosBlockTxsOffer use Point
- LeiosFetch: MsgLeiosBlockRequest/MsgLeiosBlockTxsRequest use Point
- All peer types (PeerEvent, PeerCommand, NetworkEvent, NetworkCommand)
  use Point instead of separate slot+hash fields
- LeiosStore, server handlers, peer tasks, coordinator updated
- 258 tests pass, clippy clean

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