Migrate to BearerBytes + Reception from the remade network fork
Flip the ouroboros-network SRP pin from the upstream
'main-peras-5202-merged' tag to the local 'leios-prototype-remake' branch
(file://path so the project-specific repo can later pin the same SHA).
Adapt the consensus side to two API changes from chunk N:
1. BearerBytes class replaces dataSize on ProtocolSizeLimits.
- byteLimitsLeiosFetch/byteLimitsLeiosNotify drop their (bytes -> Word)
parameter.
- Every byteLimits* call site loses its (const 0) / size argument
(consensus diffusion's noByteLimits/byteLimits records and the
PeerSimulator chainSyncNoSizeLimits/blockFetchNoSizeLimits).
- mkApps on N2N and N2C grows BearerBytes constraints for each bytes
parameter; Ouroboros.Network.Protocol.Limits is imported for it.
2. Reception arrival-time wrapping on channel recv.
- Every (a, Maybe bytes) trailing in N2N/N2C aChainSync*/aBlockFetch*/
etc. becomes (a, Maybe (Reception bytes)).
- createConnectedChannelsWithDelay in ThreadNet/Network wraps recv'd
values with `MkReception IntMap.empty` (mirroring how the network
repo's tests/demos synthesise trailings — no real arrival times when
the channel is an in-process TMVar).
- PeerSimulator ChainSync/BlockFetch runners strip the Reception when
packaging results into PeerSimulatorResult (`fmap received trailing`).
- immdb-server's MiniProtocols re-add the arrival timestamps in the
JSON tracers — restoring the `mux_at` field the C8 commit had to
placeholder while the old SRP didn't carry them.
Unrelated upstream-drift fixes folded in:
- TraceSendMsg/TraceRecvMsg now carry a Time / Maybe Time argument; the
PeerSimulator.Trace pattern is updated.
- FetchModeGenesis constructor renamed to GenesisFetchMode in
Ouroboros.Network.BlockFetch.ConsensusInterface; updated in the
BlockFetch test + PeerSimulator.BlockFetch.
- Node.hs: Cardano.LedgerPeersConsensusInterface's `getBlockHash` field
renamed to `getImmutableBlockPoint` returning Either
GetImmutableBlockPointError, with separate error cases for
Genesis/NotYetImmutable.
- ChurnMode is now newtype { getFetchMode :: FetchMode }; replace
`ChurnModeNormal` with `ChurnMode (PraosFetchMode FetchModeDeadline)`.
- Qualify NodeKernel.getFetchMode to disambiguate from
Cardano.Network.PeerSelection.Churn's identically-named field.
End-to-end gate after migration:
- cabal build all (including --enable-tests): clean.
- cardano-test -p "Leios" --quickcheck-tests=200: PASS, 1/1, 78.6s.
- consensus-test -p "Peras": PASS, 7/7, 2.3s.
- leios-schedule-gen smoke + immdb-server --help: green.
Co-Authored-By: Claude Opus 4.7 <[email protected]>