-
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
p2p local root peers #3006
p2p local root peers #3006
Conversation
The test/Ouroboros/ heirarchy is not for test modules, those live in test/Test/. That heirarchy is for extra source modules that happen only to be used within tests. Clear as mud?
The module was rather on the huge side.
Improve the generation and shrinking of pick scripts, and make their show instances much smaller so the counterexamples are easier to read. Also there were several pick scripts in the mock env that were not being shrunk at all. Fix that, and adjust so that any future additions will be noticed.
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.
This should have been opened against p2p-master.
The only thing this support is IP only configuration, no considerations for domain names has been done.
ouroboros-network/src/Ouroboros/Network/PeerSelection/LocalRootPeers.hs
Outdated
Show resolved
Hide resolved
ouroboros-network/src/Ouroboros/Network/PeerSelection/LocalRootPeers.hs
Outdated
Show resolved
Hide resolved
-- > LocalRootPeers.size (LocalRootPeers.clampToLimit sz lrps) | ||
-- > == min sz (LocalRootPeers.size lrps) | ||
-- | ||
clampToLimit :: Ord peeraddr |
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.
Should this be more fair and try to clamp a little from each group?
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.
I think it's not worth it, as noted in the comment above
-- It is unlikely in practice that there are so many local root peers
-- configured that it goes over this targets, so it's ok to resolve it pretty
-- arbitrarily. We just take the local roots in left to right order up to the
-- limit.
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.
What we should do though is trace it if it happens, so it can appear as a warning in the logs.
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.
Okay! 😃
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.
ouroboros-network/test/Test/Ouroboros/Network/PeerSelection/LocalRootPeers.hs
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.
I have also noticed that the PeerSelection
tests are in a different place than the p2p-master
branch. That might be conflicting.
ouroboros-network/test/Test/Ouroboros/Network/PeerSelection/LocalRootPeers.hs
Show resolved
Hide resolved
c124383
to
bb88209
Compare
Not yet used. It will replace the current simple representation in the governor state. Add tests for the QC generator and the non-trivial clampToLimits function.
That is, change the representation in the governor state for the local root peers from Map peeraddr PeerAdvertise to LocalRootPeers peeraddr. Then follow through the minimally necessary changes. In particular this does not yet introduce the governor targets of the local root peers being established or active peers. Also update the QC tests, using the new generator for the LocalRootPeers from the previous patch.
the enforcement of the invariant that says Public/Local Root peer sets to be disjoint.
bb88209
to
e0978c3
Compare
Just like it is now with local roots, resolving DNS names to IP addresses has to be done by the provider, so it's outside of the p2p governor directly. Adding a suitable provider will be later in this line of work.
I moved them in this patch since they were in the wrong place (and in such a way that extending them was awkward). |
We concluded we'd both merge this to the p2p-master branch and to master. And there are follow-up PRs that depend on this so it's good to unblock it.
bors merge |
Build succeeded: |
3006: p2p local root peers r=dcoutts a=dcoutts First parts of integrating the new scheme for local root peers. This changes to the new representation but does not yet introduce the governor targets of the local root peers being established or active peers. That'll be in follow-up patches (either extending this PR or after). I have those changes locally, but they need rebasing and tidying up. This is what I have ready to merge so far. Co-authored-by: Duncan Coutts <duncan@well-typed.com> Co-authored-by: Armando Santos <armando@well-typed.com> Co-authored-by: Armando Santos <armandoifsantos@gmail.com>
First parts of integrating the new scheme for local root peers.
This changes to the new representation but does not yet introduce the governor targets of the local root peers being established or active peers. That'll be in follow-up patches (either extending this PR or after).
I have those changes locally, but they need rebasing and tidying up. This is what I have ready to merge so far.