-
Notifications
You must be signed in to change notification settings - Fork 86
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
CAD-3444 p2p-governor changes from p2p-master #3377
Conversation
coot
commented
Sep 21, 2021
- p2p-governor: peer selection without gossip
- p2p-governor: localRootPersProvider
- p2p-governor: use ledger as a source for publicRootPeers
- p2p-governor: improved tracing when ledger peers is disabled
- p2p-governor: PoolStake: derive Real instance
- p2p-governor: force the list of ledger peers to WHNF
- p2p-governor: keep lookup results for different domains separate
- p2p-governor: basic churnGovernor based on random selection only
- p2p-governor: sleep between 3300s and 3900s between churns
- p2p-governor: Adjust number of active peers based on fetchmode
- p2p-governor: added PeerSelectionCounters and respective tracers.
- p2p-governor: change LocalRootPeers.toGroups to match fromGroups, and use in Show
- p2p-governor: fix a bug in the QC shrinker for the p2p governor mock environment
- p2p-governor: move QC utils to their own module
- p2p-governor: improve the Script shrinker
- p2p-governor: Restructure the p2p governor tests a bit: split, add and reorder
- p2p-governor: Slightly simplify the Arbitrary instance for PeerAddr
- p2p-governor: Make the arbitraryScriptOf generator more general and use it more
- p2p-governor: Generalise the LocalRootPeers instance for Arbitrary
- p2p-governor: Change the PickScript to pick elements not offsets.
- p2p-governor: Extend the shrinker tests: test that the shrinkers shrink!
- p2p-governor: Add a "no excessive busyness" test for the p2p governor
- p2p-governor: Adjust prop_governor_gossip_1hr to allow demotions
- p2p-governor: Adjust prop_governor_connstatus to allow demotions
- p2p-governor: Improve counterexamples for +prop_governor_connstatus
- p2p-governor: Improve the mock env pick script interpretation
- p2p-governor: Adjust playTimedScript to trace the initial value
- p2p-governor: Add new env tracers for public roots and gossips
- p2p-governor: Make gossip failure results take non-zero time
- p2p-governor: Add a new signal-based abstraction for expressing properties
- p2p-governor: New governor properties for making progress towards targets
- p2p-governor: Add a few misc comments and TODOs
- p2p-governor: Order p2p governor tests after the livelock test
- p2p-governor: Update the comment on the list of properties
- p2p-governor: Add review feedback
- p2p-governor: Fix prop_governor_target_known_1_valid_subset
- p2p-governor: Add more Signal primitives
- p2p-governor: Replace one use of Signal.primitiveTransformEvents
- p2p-governor: Adjust LocalRootPeers to require targets > 0
- p2p-governor: Minor correction in a comment
- p2p-governor: Fix the prop_governor_target_known_above property
- p2p-governor: Adjust established and active target properties for local roots
- p2p-governor: Add support for hitting the local root peer targets
- p2p-governor: Refactored localRootPeersProvider
- p2p-governor: Scale pool's stake by sqrt
- p2p-governor: new root peers configuration (Refactored DiffusionArguments for new root peers configuration #3079)
- p2p-governor: Refactored DNS resolution to use io-sim-classes
- p2p-governor: Added dns resolution tests
- p2p-governor: Process synchronous hot promotion errors
- p2p-governor: add some randomness to the reconnection delay
ouroboros-network/src/Ouroboros/Network/PeerSelection/Simple.hs
Outdated
Show resolved
Hide resolved
ouroboros-network/src/Ouroboros/Network/PeerSelection/Simple.hs
Outdated
Show resolved
Hide resolved
ouroboros-network/src/Ouroboros/Network/PeerSelection/Simple.hs
Outdated
Show resolved
Hide resolved
ouroboros-network/src/Ouroboros/Network/PeerSelection/Simple.hs
Outdated
Show resolved
Hide resolved
ouroboros-network/src/Ouroboros/Network/PeerSelection/LedgerPeers.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus-shelley/src/Ouroboros/Consensus/Shelley/Ledger/PeerSelection.hs
Outdated
Show resolved
Hide resolved
ouroboros-network/src/Ouroboros/Network/PeerSelection/Governor.hs
Outdated
Show resolved
Hide resolved
ouroboros-network/src/Ouroboros/Network/PeerSelection/Governor.hs
Outdated
Show resolved
Hide resolved
ouroboros-network/src/Ouroboros/Network/PeerSelection/Governor.hs
Outdated
Show resolved
Hide resolved
ouroboros-network/src/Ouroboros/Network/PeerSelection/RootPeersDNS.hs
Outdated
Show resolved
Hide resolved
ouroboros-network/src/Ouroboros/Network/PeerSelection/LedgerPeers.hs
Outdated
Show resolved
Hide resolved
ouroboros-network/src/Ouroboros/Network/PeerSelection/Simple.hs
Outdated
Show resolved
Hide resolved
ouroboros-network/src/Ouroboros/Network/PeerSelection/RootPeersDNS.hs
Outdated
Show resolved
Hide resolved
ouroboros-network/src/Ouroboros/Network/PeerSelection/RootPeersDNS.hs
Outdated
Show resolved
Hide resolved
ouroboros-network/src/Ouroboros/Network/PeerSelection/RootPeersDNS.hs
Outdated
Show resolved
Hide resolved
cba61b8
to
0b9328b
Compare
ouroboros-network/src/Ouroboros/Network/PeerSelection/RootPeersDNS.hs
Outdated
Show resolved
Hide resolved
69f4985
to
6f2a117
Compare
In case of a TCP sim open the handshake will fail, and both nodes will retry at exactly the same time causing the same failure to repeat forever. The random delay breaks the cycle. The random delay is between -2s to +2s which is more than then the expected RTT around the world.
withLedgerPeers runs ledger peers worker thread, creates a two way communication channel with it and exposes a function which allows to request 'NumberOfPeer' and blocks until the ledger peers will respond.
'DomainAddress' is renamed to 'DomainAccessPoint'. 'RelayAccessPoint' constructors are uniform: they take either ip or domain and address. We also provide 'RelayDomainAccessPoint' bidirectional pattern which links 'RelayAccessDomain' and 'DomainAccessPoint' Both types, and their instances are moved to their own module.
We should not use `network-mux` timeout as it requires to be used in a synchronous way. This is not the case for outbound-governor. Also outbound-governor is using timeouts for dns resolution which are in seconds, we don't need to use `network-mux` high frequency timeouts. issue #3267
6f2a117
to
27b316f
Compare
This required to rewrite the tests using `withLedgerPeers`.
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
27b316f
to
30d3923
Compare
30d3923
to
507e76d
Compare
fixup: p2p-governor: Added dns resolution tests
Instead of setting up all peer selection tests in 'Test.Ouroboros.Network.PeerSelection', we do that in the 'Main' module. The advantage of this approach is that the tasty path of all the tests is visible at the top module and does not require chasing between different files to find out how to run the specific test. This patch preserves tasty groups, so all the tests are still available under "Ouroboros.Network.PeerSelection" group.
Instead of taking last 1000 events, timeout the simulation after 1hr of simulated time. The `mockLocalRooPeersProvider` is a recursive loop which never returns, it could only terminate by an exception. When we used rng to generate delays and timeouts this would eventually happen but in some cases this would never happen for some tests.
It could deadlock; We resolve the deadlock by: * supplying dns timeouts and delays script, which eventually succeeds; * the termination condition checks that we resolved all the addresses. We no longer need to use `Test.QuickCheck.within`.
507e76d
to
c4ac7ef
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.
LGTM! (At least the changes regarding DNS tests)
Looks like the test still failed in CI |
Verify that: * we try to resolve all local root domains * the resolved domains are a subset of the local root domains available in dns map
@bolt12 I think I fixed this one too. Please check the last commit. |
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
bors merge |
Build succeeded: |