Conversation
|
I wonder if we can make it more uniform and like some other tests because I don't think we need an |
cardano-diffusion/tests/lib/Test/Cardano/Network/Diffusion/Testnet.hs
Outdated
Show resolved
Hide resolved
cardano-diffusion/tests/lib/Test/Cardano/Network/Diffusion/Testnet.hs
Outdated
Show resolved
Hide resolved
cardano-diffusion/tests/lib/Test/Cardano/Network/Diffusion/Testnet.hs
Outdated
Show resolved
Hide resolved
|
@crocodile-dentist is right, we don't need to build the maps. It's much better to analyse the trace as a stream if possible. |
cardano-diffusion/tests/lib/Test/Cardano/Network/Diffusion/Testnet.hs
Outdated
Show resolved
Hide resolved
| .&&. counterexample "known big ledger peers upper bound violation" (knownBigLedgers' <= knownBigLedgers) | ||
| .&&. counterexample "known big ledger peers lower bound violation" (knownBigLedgers' >= decrease knownBigLedgers) | ||
| .&&. counterexample "established upper bound violation" (establisheds' <= establisheds) | ||
| .&&. counterexample "established lower bound violation" (establisheds' >= decrease establisheds) |
There was a problem hiding this comment.
I would also add a check that we decrease established peers by at least as how many active peers we have decreased, and analogously for big ledger peers.
There was a problem hiding this comment.
Do you mean this: establisheds - establisheds' >= actives - actives'?
There was a problem hiding this comment.
Yes, the logic we are trying to test is this in Churn:
decreaseWithMin :: Int -> Int -> Int
decreaseWithMin u v = max 0 $ v - max u (max 1 (v `div` 5))So we want to take the difference between established and active, and lower it by 20% or 1, whichever is greater, but also at least as many as active peers we have churned.
@karknu @coot should this be min v $ max u (max 1 (v div 5)) - this should catch some corner cases where we churn a few active peers, but the node is configured to use very few established peers in excess of the active target. This change will churn out all excess established peers even if the number of them is less than how many active peers we have churned. Or should this be an invariant violation that we check in the sane targets function - ie. it should be a misconfiguration where the number of excess established peers is less than the fraction of active peers churned at each cycle?
There was a problem hiding this comment.
I guess you mean decreaseWithMin u v = max 0 $ v - min v $ max u (max 1 (v div 5)), isn't it?
There was a problem hiding this comment.
It's starting to get unwieldy, but what about v - min v (max u (max 1 (v div 5)))?
d2ff934 to
a81cb11
Compare
a81cb11 to
08d9f1f
Compare
Description
Closes #5291
Checklist
Quality
Maintenance
ouroboros-networkproject.