Merge pull request #5368 from IntersectMBO/f-f/contra-tracer-0.2
Upgrade to contra-tracer 0.2.1
Upgrade to contra-tracer 0.2.1
Wrap `Channel m a` recv values in a new `Reception a = MkReception !(IntMap Time) !a`, recording per-chunk arrival times. In the mux demuxer the chunk's arrival time is paired with its starting byte offset; codec/driver layers either strip the time map (the codec sees only bytes) or propagate it through `wrapMiniProtocolTrailing` at the mini-protocol callback boundary. Tests/demos/benches use `IntMap.empty` when synthesising trailing. This is the network half of the November Leios demo's arrival-time plumbing; consumers (e.g. Praos block-arrival tracing on the consensus side) will be wired up separately. Co-Authored-By: Claude Opus 4.7 <[email protected]>
Upstream cleanup, not Leios-specific: eight unused-import warnings that
upstream's own ghc-options promote to errors via 'nix/ouroboros-network.nix'
('-Werror' on forAllProjectPackages). They've been present at the
'main-peras-5202-merged' SHA that cardano-node and ouroboros-consensus
master both consume; surface when downstream haskell.nix builds also
inherit `-Werror`.
Affected files (one unused qualified import each):
- framework/lib/Ouroboros/Network/Protocol/Handshake/Codec.hs (BL)
- framework/tests-lib/.../ConnectionManager/Experiments.hs (LBS)
- framework/io-tests/.../Driver.hs (List)
- framework/io-tests/.../Socket.hs (IntMap)
- tests/lib/.../TxSubmission/AppV1.hs (BSL)
- tests/lib/.../TxSubmission/AppV2.hs (BSL)
- protocols/tests-lib/.../KeepAlive/Test.hs (BL)
- protocols/tests-lib/.../PeerSharing/Test.hs (BL)
Verified with 'cabal clean && cabal build all --ghc-options=-Werror' →
exit 0.
Co-Authored-By: Claude Opus 4.7 <[email protected]>
The test `socket close during receive` doesn't exist any more.
Once in a while the test fails, because in IO trailing bytes might be written to the ingres queue before the SDU is processed. Then a single `recv` will just read the trailing bytes, and the test would fail. The fix is to read from the mux channel until we receive all the expected bytes.
Replace the central decsision thread by having server threads coordinate between them by blocking on STM actions.
Replace the `dataSize :: bytes -> Word` field of `ProtocolSizeLimits`
with a `BearerBytes` class:
class BearerBytes bytes where
bearerBytesSize :: bytes -> Word
Default instances cover `BS.ByteString`, `BL.ByteString`, `[Char]` and
`AnyMessage msg` (for tests). Driver/Limits gains a `BearerBytes bytes`
constraint on the public entry points (`runPeerWithLimits` and friends).
The seven `byteLimits*` codec helpers no longer take a
`(bytes -> Word)` argument — call sites drop the `(fromIntegral .
LBS.length)` boilerplate. Two test predicates that previously used
`dataSize` now call `bearerBytesSize` directly.
Co-Authored-By: Claude Opus 4.7 <[email protected]>
The 1.1.0.0 release of 'ouroboros-network' and the 1.0.0.0 release of 'cardano-diffusion' both pin 'trace-dispatcher ^>=2.11.0', but cardano-node 11.0.1 pulls in trace-dispatcher 2.12.x. Bump the bounds in both cabal files so the rebased Leios fork builds against the trace-dispatcher version shipped with cardano-node 11.0.1. Co-Authored-By: Claude Opus 4.7 <[email protected]>
Upstream cleanup, not Leios-specific: eight unused-import warnings that
upstream's own ghc-options promote to errors via 'nix/ouroboros-network.nix'
('-Werror' on forAllProjectPackages). They've been present at the
'main-peras-5202-merged' SHA that cardano-node and ouroboros-consensus
master both consume; surface when downstream haskell.nix builds also
inherit `-Werror`.
Affected files (one unused qualified import each):
- framework/lib/Ouroboros/Network/Protocol/Handshake/Codec.hs (BL)
- framework/tests-lib/.../ConnectionManager/Experiments.hs (LBS)
- framework/io-tests/.../Driver.hs (List)
- framework/io-tests/.../Socket.hs (IntMap)
- tests/lib/.../TxSubmission/AppV1.hs (BSL)
- tests/lib/.../TxSubmission/AppV2.hs (BSL)
- protocols/tests-lib/.../KeepAlive/Test.hs (BL)
- protocols/tests-lib/.../PeerSharing/Test.hs (BL)
Verified with 'cabal clean && cabal build all --ghc-options=-Werror' →
exit 0.
Co-Authored-By: Claude Opus 4.7 <[email protected]>
Replace the `dataSize :: bytes -> Word` field of `ProtocolSizeLimits`
with a `BearerBytes` class:
class BearerBytes bytes where
bearerBytesSize :: bytes -> Word
Default instances cover `BS.ByteString`, `BL.ByteString`, `[Char]` and
`AnyMessage msg` (for tests). Driver/Limits gains a `BearerBytes bytes`
constraint on the public entry points (`runPeerWithLimits` and friends).
The seven `byteLimits*` codec helpers no longer take a
`(bytes -> Word)` argument — call sites drop the `(fromIntegral .
LBS.length)` boilerplate. Two test predicates that previously used
`dataSize` now call `bearerBytesSize` directly.
Co-Authored-By: Claude Opus 4.7 <[email protected]>
The 1.1.0.0 release of 'ouroboros-network' and the 1.0.0.0 release of 'cardano-diffusion' both pin 'trace-dispatcher ^>=2.11.0', but cardano-node 11.0.1 pulls in trace-dispatcher 2.12.x. Bump the bounds in both cabal files so the rebased Leios fork builds against the trace-dispatcher version shipped with cardano-node 11.0.1. Co-Authored-By: Claude Opus 4.7 <[email protected]>
Wrap `Channel m a` recv values in a new `Reception a = MkReception !(IntMap Time) !a`, recording per-chunk arrival times. In the mux demuxer the chunk's arrival time is paired with its starting byte offset; codec/driver layers either strip the time map (the codec sees only bytes) or propagate it through `wrapMiniProtocolTrailing` at the mini-protocol callback boundary. Tests/demos/benches use `IntMap.empty` when synthesising trailing. This is the network half of the November Leios demo's arrival-time plumbing; consumers (e.g. Praos block-arrival tracing on the consensus side) will be wired up separately. Co-Authored-By: Claude Opus 4.7 <[email protected]>
Needed by GHC 9.6.7 and 9.8.4 to build ghc-lib-parser for stylish-haskell.