-
Notifications
You must be signed in to change notification settings - Fork 90
Net-Sim tracer improvements #5211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
ed39f5b to
fe63b8e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Improves net-sim tracing and test output, centralizes a dynamic IOSim tracer in tests-lib, and streamlines time rendering in counterexamples.
- Add TVar labelling/tracing for peer selection public state; derive Show to support tracing
- Make diffusionSimulation IOSim-specific, provide internal diffusionSimulationM, and update tests to include timestamps via selectTraceEventsSayWithTime
- Move dynamicTracer to tests-lib and remove duplicate tracers
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| ouroboros-network/tests/lib/Test/Ouroboros/Network/Diffusion/Node/Kernel.hs | Add MonadTraceSTM/MonadLabelledSTM constraints and label/trace the public peer selection TVar |
| ouroboros-network/tests/lib/Test/Ouroboros/Network/BlockFetch.hs | Remove dynamicTracer and unused imports; simplify tracer import |
| ouroboros-network/tests-lib/lib/Test/Ouroboros/Network/Utils.hs | Export and define dynamicTracer; add note on WithTime usage |
| ouroboros-network/tests-lib/lib/Test/Ouroboros/Network/Data/Signal.hs | Render times more concisely in signalProperty counterexamples |
| ouroboros-network/lib/Ouroboros/Network/PeerSelection/Governor/Types.hs | Derive Show for PublicPeerSelectionState to enable tracing |
| ouroboros-network/changelog.d/20251007_150356_coot_net_sim_tracer.md | Changelog: Show instance, cleaner counterexamples, new dynamicTracer |
| cardano-diffusion/tests/lib/Test/Cardano/Network/Diffusion/Testnet/Simulation.hs | Make diffusionSimulation IOSim-only; add diffusionSimulationM; adjust tracers; remove iosimTracer |
| cardano-diffusion/tests/lib/Test/Cardano/Network/Diffusion/Testnet.hs | Update tests to new diffusionSimulation; print timestamps via selectTraceEventsSayWithTime; remove iosimTracer |
| cardano-diffusion/changelog.d/20251007_150408_coot_net_sim_tracer.md | Changelog: breaking API note for diffusionSimulation; net-sim testing improvements |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
cardano-diffusion/tests/lib/Test/Cardano/Network/Diffusion/Testnet/Simulation.hs
Outdated
Show resolved
Hide resolved
fe63b8e to
7e17390
Compare
7e17390 to
64ace4a
Compare
487ab4a to
f7850ac
Compare
64ace4a to
25eb7b7
Compare
25eb7b7 to
2ddd872
Compare
cardano-diffusion/tests/lib/Test/Cardano/Network/Diffusion/Testnet/Simulation.hs
Outdated
Show resolved
Hide resolved
cardano-diffusion/tests/lib/Test/Cardano/Network/Diffusion/Testnet/Simulation.hs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
d7fee75 to
650c9bb
Compare
* labelled `PublicPeerSelectionStateVar`; * trace `PublicPeerSelectionStateVar` values through `traceTVar`.
* avoid duplicate traces; * avoid duplicate time stamps in the `Say` output in `IOSim` trace;
650c9bb to
9c3a273
Compare
We always use `dynamicTracer` in `IOSim`, so hide it in a closure.
It can be reused in `block-fetch` & `sim-net` tests.
9c3a273 to
6272a47
Compare
6272a47 to
9770f3a
Compare
Description
Requires: #5200 to be merged first.
Checklist
Quality
Maintenance
ouroboros-networkproject.