Skip to content
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

Merged
merged 8 commits into from
Apr 10, 2021
Merged

p2p local root peers #3006

merged 8 commits into from
Apr 10, 2021

Conversation

dcoutts
Copy link
Contributor

@dcoutts dcoutts commented Mar 19, 2021

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.

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.
@dcoutts dcoutts requested review from bolt12, coot and karknu March 19, 2021 20:25
karknu
karknu previously requested changes Mar 22, 2021
Copy link
Contributor

@karknu karknu left a 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.

-- > LocalRootPeers.size (LocalRootPeers.clampToLimit sz lrps)
-- > == min sz (LocalRootPeers.size lrps)
--
clampToLimit :: Ord peeraddr
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay! 😃

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@bolt12 bolt12 left a 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.

@dcoutts dcoutts force-pushed the dcoutts/p2p-local-root-peers branch from c124383 to bb88209 Compare March 29, 2021 11:23
dcoutts and others added 4 commits March 29, 2021 12:23
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.
@dcoutts dcoutts force-pushed the dcoutts/p2p-local-root-peers branch from bb88209 to e0978c3 Compare March 29, 2021 11:24
@dcoutts
Copy link
Contributor Author

dcoutts commented Mar 29, 2021

The only thing this support is IP only configuration, no considerations for domain names has been done.

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 have also noticed that the PeerSelection tests are in a different place than the p2p-master branch. That might be conflicting.

I moved them in this patch since they were in the wrong place (and in such a way that extending them was awkward).

@dcoutts dcoutts requested review from bolt12 and karknu March 29, 2021 11:28
@dcoutts dcoutts dismissed karknu’s stale review April 10, 2021 15:29

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.

@dcoutts
Copy link
Contributor Author

dcoutts commented Apr 10, 2021

bors merge

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Apr 10, 2021

@iohk-bors iohk-bors bot merged commit 73ce0bd into master Apr 10, 2021
@iohk-bors iohk-bors bot deleted the dcoutts/p2p-local-root-peers branch April 10, 2021 16:29
coot pushed a commit that referenced this pull request May 16, 2022
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants