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
Big Ledger Peers #4462
Big Ledger Peers #4462
Conversation
c11adbc
to
3e83ce2
Compare
3e83ce2
to
2268d58
Compare
2268d58
to
405fc39
Compare
405fc39
to
0e22de8
Compare
f4a8097
to
79dde3a
Compare
73ce1eb
to
131532f
Compare
ouroboros-network/src/Ouroboros/Network/PeerSelection/Governor/Types.hs
Outdated
Show resolved
Hide resolved
| TraceTargetsChanged PeerSelectionTargets PeerSelectionTargets | ||
|
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.
We should add a TraceInsaneTargets
.
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 is currently not easy, we update targets in an STM
transaction.
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.
🤔 we could move the check outside of the outbound governor, and have a method which submits only if they are sane. But this is outside of this PR.
ouroboros-network/src/Ouroboros/Network/PeerSelection/State/KnownPeers.hs
Outdated
Show resolved
Hide resolved
ouroboros-network/src/Ouroboros/Network/PeerSelection/State/KnownPeers.hs
Show resolved
Hide resolved
The core change is adding a lambda in the initiator part of `RunMiniProtocol`. From there it is propagated up to ouroboros-consensus-diffusion.
Also extend its haddocks.
Before this patch we were passing `ConnectionId`, `ControlMessageSTM` and now also `IsBigLedgerPeer` in distinct lambdas. This patch combines them into a single lambda which takes either an initiator or responder context. As in one of the previous patches, the core changes are done to the `RunMiniProtocol` type. We introduces three contexts: * `ExpandedInitiatorContext` - a context used by node-to-node applications. Although non-p2p node-to-node applications receive a context which is created out of `MinimalInitiatorContext` - this is to keep the interface used by `ouroboros-consensus-diffusion` as simple as possible. * `MinimalInitiatorContext` - a context used by node-to-client applications as well as in many non-p2p contexts (e.g. `connectToNode` or `subscribe` from `cardano-client` package) * `ResponderContext` - a context used by all responders.
Currently it only generates numbers which are less than 20, even though the intention was to make it less than 10k. Instead we generate it from the `[0,1k)` interval.
When connecting to itself, the connection manager would create two `TVar`'s with the state of the connection eventually leading to invalid transitions. We both of the following transitions: * `IncludeConnection Outbound → IncludeConnection Inbound` * `IncludeConnection Inbound → IncludeConnection Outbound` are valid. Which one will be executed depends which thread (inbound or outbound) will be executed first after connection is accepted.
Don't use partial function `last`; Quite rarely the refactored tests can fail because of that.
* `ConnectionId` * `MinimalInitiatorContext` * `ResponderContext`
Two new trace points are added to `TraceLedgerPeers`: * `NotEnoughBigLedgerPeers` * `NotEnoughLedgerPeers` The `FallingBackToBootstrapPeers` is renamed as `FallingBackToPublicRootPeers`.
6a9f0a9
to
747d03d
Compare
Description
The PR contains a few set of changes:
IsBigLedgerPeer
ConnectionId
orIsBigLedgerPeer
for the outbound side):ExpandedMiniProtocolContext
,MinimapProtocolContext
andResponderMiniProtocolContext
.diffusion
tests (sim-net
), which allows us to test big ledger peersconnection-manager
which resulted in wrong transitions when a node connects to itselfThis PR is addresses most of the task of #3886.
TODO:
SelfConn
SelfConn^{-1}
InboundState^{\tau} Unidirectional -> OutboundState Unidirectional
Checklist
DEPRECATED
warning that notifies downstream consumers. If deprecating a whole module, remember to add it to./scripts/ci/check-stylish.sh
as otherwisestylish-haskell
would un-deprecate it.interface-CHANGELOG.md
Fixes #3924