ouroboros-network
ouroboros-network copied to clipboard
Inform Consensus Layer whether a bootstrap peer should be considered remote
@karknu had raised a concern about the Bootstrap State Machine (ie https://github.com/IntersectMBO/ouroboros-consensus/pull/808) that would be most naturally mitigated by the Diffusion Layer annotating new peers with whether or not that peer should be considered remote.
EG SPOs separately configure the "local trusted" portion of the topology from the "bootstrap peers source" of the topology. If that distinction would be preserved deep enough into the code, then the Bootstrap State Machine would simply refuse to transition from TooOld to YoungEnough while it only has local peers.
To address this we need to extend ExpandedInitiatorContext
which is used by node-to-node
clients.
simply refuse to transition from TooOld to YoungEnough while it only has local peers
For relays this is exactly what we want. For nodes with some trusted local peers and no bootstrap peers, such as BPs, the transition should happen when only talking to trusted local peers.
Am I right understanding that by adding a eicIsLocalRootPeer :: Bool
field in ExpandedInitiatorContext
is information enough for consensus ?
I realised that Consensus might actually be interested in a signal from the outbound governor which summarises all connections. If we just expose IsLocalRoot
in ExpandedInitiatorContext
then on the consensus side one will need to build such a signal oneself, despite it being available from the outbound-governor
.
This would be handy in other areas as well (e.g. churn). So here's another proposal. The outbound-governor
should expose ~STM EffectiveTargets
~ EffectiveCounters
where effective ~targets~ counters is a record containing number of hot & warm: local / ledger / big ledger / bootstrap peers currently used by the outbound governor. This would work for us in churn and summarising it to onlyLocalOutboundConnections :: EffectiveCounters -> Bool
.
I don't see how exposing targets would work for consensus, since they have to know which peers are local and which peers are not, right?
I used wrong name, it's about counters not targets.