Invariants / CN-SESS-04

CN-SESS-04

CN release enforced

Session reducer per-mini-protocol payload reassembly: the GREEN session reducer maintains one accumulating Vec buffer per AcceptedMiniProtocol variant inside ConnectedState, and emits exactly one SessionEffect::DeliverPeerFrame per COMPLETE CBOR item observed in the wire stream — never per mux frame. Same canonical inbound byte stream → byte-identical DeliverPeerFrame sequence across runs. The per-protocol buffer is a CLOSED-sum- indexed struct (no HashMap), so iteration / membership / lookup are deterministic.

Source

docs/clusters/PHASE4-N-M-FRAG/cluster.md §1

Cluster
CL-WIRE-PROTOCOL
Authority surface
wire-layer reassembly across mux frame boundaries

Enforcement trace

Tests 6

  • crates/ade_network/src/session/core.rs::tests::fragmented_chain_sync_message_assembles_one_deliver
  • crates/ade_network/src/session/core.rs::tests::fragmented_block_fetch_block_assembles_one_deliver
  • crates/ade_network/src/session/core.rs::tests::interleaved_chain_sync_and_block_fetch_fragments_stay_isolated
  • crates/ade_network/src/session/core.rs::tests::pipelined_two_chain_sync_messages_in_one_mux_frame_emit_two_delivers
  • crates/ade_network/src/session/core.rs::tests::truncated_then_complete_two_step_drain
  • crates/ade_network/src/session/core.rs::tests::proto_buffers_isolation_across_accepted_protocols

Cross-references

Strengthened in

Evidence notes

PHASE4-N-M-FRAG (2026-05-27) surfaced + closed the missing per-mini-protocol reassembly in the session reducer. cardano-node fragments large block-fetch responses (Conway blocks exceeding the 65535-byte mux payload limit) across multiple mux frames bearing the same protocol id. Before FRAG, drain_connected_frames emitted one DeliverPeerFrame per mux frame; the block-fetch codec received a truncated CBOR item and failed → wire pump exited with BlockFetchDecode. After FRAG, the reducer accumulates per-protocol bytes and drains COMPLETE CBOR items via ade_codec::cbor::skip_item. Live operator pass against fully-synced docker preprod (epoch 291, slot ~124M) now decodes block-fetch responses successfully (committed bootstrap transcript records block_received events with the canonical block hash matching the peer's announced tip).