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

ouroboros-network changes for cardano-node-8.9.3 #4869

Merged
merged 44 commits into from
May 7, 2024

Conversation

coot
Copy link
Contributor

@coot coot commented Apr 30, 2024

Description

Includes:

Checklist

Quality

  • Commit sequence makes sense and have useful messages, see ref.
  • New tests are added and existing tests are updated.
  • Self-reviewed the PR.

Maintenance

  • Linked an issue or added the PR to the current sprint of ouroboros-network project.
  • Added labels.
  • Updated changelog files.
  • The documentation has been properly updated, see ref.

coot added 5 commits April 21, 2024 10:44
Order first by `remoteAddress`, then by `localAddress`.
Make `ConnectionId` use sites independent of the order of `ConnectionId`
fields.
The peer-sharing protocol application should throw an exception when
more peers were received than requested. Note that the outbound governor
never used more peers it requested.
There's no need to pass `StdGen` to `PrunePolicy` from the
`InboundGovernor` when it's more natural to get it from connection
manager.

This opens a possibility to use `InboundObservableState` for different
purposes (and in a different way).
@coot coot added the peer-sharing Issues / PRs related to peer sharing label Apr 30, 2024
@coot coot requested a review from karknu April 30, 2024 16:10
@coot coot self-assigned this Apr 30, 2024
@coot coot requested a review from a team as a code owner April 30, 2024 16:10
@coot coot force-pushed the coot/peer-sharing-8.9 branch from ccc2527 to 50f860f Compare May 1, 2024 06:39
@coot coot added inbound-governor Issues / PRs related to inbound-governor outbound-governor Issues / PRs related to outbound-governor labels May 1, 2024
@coot coot force-pushed the coot/peer-sharing-8.9 branch 5 times, most recently from 85d4396 to 9b5e916 Compare May 2, 2024 19:51
@karknu
Copy link
Contributor

karknu commented May 3, 2024

The order of the commits is wrong.
ff54b38 should be the last commit so that the retry time fixes are included in the 0.15 release.

coot added 11 commits May 6, 2024 12:20
`PublicInboundGovernorState` extracts information directly from
`InboundGovernorState` and exposes an `STM` action which allows to read
it.
In the previous commit we improved error handling of threads started by
the server.  Now we don't need to use `Async.link` in the tests to make
sure exceptions are propagated, and some the errors are not longer
wrapped in `ExceptionInLinkedThread`.
In a following patch we will need the `readInboundState` to be available
for creation of `PeerSelectionActions`.
A more generic name suits better since we want to use it not just for
random delays.
…Peers

This patch replaces `readNewInboundConnection` with `readInboundPeers`,
including the monitoring action for inbound connections.   In the
following patch we will implement an action which is using inbound
duplex peers.
This patch also update `PeerSelection` tests to cover inbound peers.
When outbound governor timeouts, we need have to update the `stdGen`
available in the outbound governor, so next time it has a chance to make
a different decision (known peers decisions use random selection between
light peer sharing (aka inbound peers) and peer sharing).
karknu and others added 20 commits May 7, 2024 14:36
When calculating publicRoot lookup results having only configured peers
with IP addreses is not a DNS failure. Instead of a 3h TTL use 60s for
IP addresses only (will be increased by backoff logic).
If we are above the credits instead of failing instantly take a look if
any of the events provide us with more credits. This makes the test
suite more robust incase one kind of events happens close to another
kind of events. For example a burst of peersharing activity just before
the node starts to look for new public roots.
`PeerSelectionCounters` provide now raw data in terms of sizes of active
/ established / known sets.  Added `PeerSelectionCountersHWC` pattern
synonym, which calculates sizes in terms of hot / warm / cold sets.

The counters include:
* public roots (excluding big ledger peers)
* big ledger peers
* bootstrap peers
* local roots
* shared peers (e.g. peers received through peer sharing)

Co-authored-by: Armando Santos (@bolt12)
Co-authored-by: Marcin Szamotulski (@coot)
Chrun now explicitly synchronises with outbound governor using
`PeerSelectionCounters`.  Each churn action can timeout.

Co-authored-by: Armando Santos (@bolt12)
Co-authored-by: Marcin Szamotulski (@coot)
Also export it from `Governor` module, it is useful in `cardano-node`.
`localRoots` didn't count local connections, but the targets. We don't
expose other targets in EKG metrics, so there's no reason to actually
include local root targets.
Since `PeerSelectionCounters` are stored in a `TVar` we don't need to
cache them in `PeerSelectionState`.
Use `peerSelectionStateToCounters` to compute numbers of peers over
which outbound-governor is making decisions.
Local roots are always disjoint with big ledger peers.  This is ensured
when we are adding new big ledger peers and when the local roots has
changed, there's no need to subtract them in `EstablishedPeers.aboveTargetOther`.
PeerSelectionView is a generalisation of PeerSelectionCounters useful
internally in the outbound-governor.  It allows us to not duplicate the
logic of computing counters separately for churn and the outbound
governor, which can help us to introduce bugs.
`Ouroboros.Network.PeerSelection.Governor.Type` excluded from
`check-stylish`, to preserve large export of record names in pattern
synonyms.
@coot coot force-pushed the coot/peer-sharing-8.9 branch from d7c853b to 8e0f65f Compare May 7, 2024 12:51
@coot coot requested review from newhoggy and a team as code owners May 7, 2024 12:51
coot added 2 commits May 7, 2024 14:52
This is less misleading, especially since ex-local root peers might fall
into that category, and they were never received through peer sharing.
ouroboros-network: 0.15.0.0
ouroboros-network-framework: 0.13.0.0
@coot coot force-pushed the coot/peer-sharing-8.9 branch from 8e0f65f to 02ef293 Compare May 7, 2024 12:57
@coot coot changed the title peer sharing changes - ouroboros-nework-0.14.x / cardano-node-8.9.x ouroboros-network changes for cardano-node-8.9.3 May 7, 2024
@coot coot merged commit 6a947bc into release/ouroboros-network-0.14.x May 7, 2024
12 of 14 checks passed
@coot coot deleted the coot/peer-sharing-8.9 branch May 7, 2024 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inbound-governor Issues / PRs related to inbound-governor outbound-governor Issues / PRs related to outbound-governor peer-sharing Issues / PRs related to peer sharing
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants