Skip to content

Commit fda94ad

Browse files
committed
BootstrapPeers.md: include pseudo-HAA
1 parent 4946b3b commit fda94ad

File tree

1 file changed

+32
-10
lines changed

1 file changed

+32
-10
lines changed

docs/website/contents/for-developers/BootstrapPeersIER.md

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,48 @@ The following state machine depicts the desired behavior of the node.
1212

1313
```mermaid
1414
graph
15-
OnlyBootstrap[OnlyBootstrap]
16-
CaughtUp[CaughtUp]
15+
subgraph OnlyBootstrap
16+
direction TB
17+
PreSyncing[PreSyncing]
18+
Syncing[Syncing]
19+
PreSyncing -- "Honest Availability Assumption\nis satisfied" --> Syncing
20+
Syncing -- "Honest Availability Assumption\nis no longer satisfied" --> PreSyncing
21+
end
1722
18-
OnlyBootstrap -- "no peers claim to have\nsubsequent headers,\nand its selection is ≥\nthe best header" --> CaughtUp
19-
CaughtUp -- "vol tip became older than X" --> OnlyBootstrap
23+
CaughtUp[CaughtUp]
24+
Syncing -- "no peers claim to have\nsubsequent headers,\nand its selection is ≥\nthe best header" --> CaughtUp
25+
CaughtUp -- "vol tip became older than X" ----> PreSyncing
2026
2127
StartUp[[Node start-up]]
2228
StartUp -- "node was most recently in CaughtUp\nand vol tip is younger than X" --> CaughtUp
23-
StartUp -- "otherwise" --> OnlyBootstrap
29+
StartUp -- "otherwise" --> PreSyncing
2430
```
2531

26-
- `OnlyBootstrap` state - All upstream peers must reside in a centralized set of trusted _bootstrap peers_.
32+
- `OnlyBootstrap` - All upstream peers must be trusted.
33+
34+
In the context of bootstrap peers, as all peers are trusted, the _Honest Availability Assumption_ is satisfied in the following cases:
35+
36+
- The node is configured to connect to bootstrap peers, and it has established a connection to a bootstrap peer.
37+
38+
- The node is not configured to connect to bootstrap peers. This is the case for eg block producers and hidden relays. They will only be connected to trusted local root peers (eg the relays for a block-producing node).
2739

2840
- `CaughtUp` state - The peers are chosen according to the P2P design, including the _ledger peers_ etc.
2941

3042
**Desideratum 2.**
3143
In particular, the transitions should happen promptly.
3244

33-
- `CaughtUp -> OnlyBootstrap` should be prompt in order to minimize the duration that the node is exposed to untrusted peers (aka non-bootstrap peers) while its stale volatile tip is making it vulnerable.
45+
- `CaughtUp -> PreSyncing` should be prompt in order to minimize the duration that the node is exposed to untrusted peers (aka non-bootstrap peers) while its stale volatile tip is making it vulnerable.
3446
Delays here would directly threaten the security of the node.
3547

36-
- `OnlyBootstrap -> CaughtUp` should be prompt so that the centralized, relatively-few bootstrap peers are relieved of load as soon as possible.
48+
- `Syncing -> CaughtUp` should be prompt so that the centralized, relatively-few bootstrap peers are relieved of load as soon as possible.
3749
Delays here would not directly threaten the security of the node.
3850
However, wasting the centralized resources would threaten the ability of nodes to join the net, ie the availability of the whole net.
3951
Determining the exact load constraints for the bootstrap peers is not yet finalized.
4052

53+
- `PreSyncing -> Syncing` should be prompt to allow the node to conclude that is is caught up as a follow-up.
54+
55+
- `Syncing -> PreSyncing` should be prompt to prevent the node from concluding that it is caught up while it is not actually connected to a bootstrap peers.
56+
4157
**Desideratum 3.**
4258
The node should not return to `OnlyBootstrap` every time it restarts/briefly loses network/etc.
4359
Such unnecessary connections would also put unnecessary load on the centralized, relatively-few bootstrap peers.
@@ -59,11 +75,11 @@ This is the point of the "Node start-up" pseudo state in the diagram above.
5975

6076
As the volatile tip age approaches X, the Consensus Layer could forewarn the Diffusion Layer, eg "it seems like the transition back to OnlyBootstrap will be necessary soon; please prepare", if that would be helpful.
6177

62-
- For similar reasons, the Diffusion Layer should also manage the disconections from all peers upon the `OnlyBootstrap -> CaughtUp` transition.
78+
- For similar reasons, the Diffusion Layer should also manage the disconections from all (bootstrap) peers upon the `OnlyBootstrap -> CaughtUp` transition.
6379

6480
## Anticipated Interface
6581

66-
See [IntersectMBO/ouroboros-network#4555](https://github.com/IntersectMBO/ouroboros-network/pull/4555) for the definition/implementation of this interface on the Network side.
82+
See [IntersectMBO/ouroboros-network#4555](https://github.com/IntersectMBO/ouroboros-network/pull/4555) and [IntersectMBO/ouroboros-network#4846](https://github.com/IntersectMBO/ouroboros-network/pull/4846) for the definition/implementation of this interface on the Network side.
6783

6884
- The Diffusion Layer should monitor a `TVar State` (maybe via a `STM State` action).
6985
The Consensus Layer will update that state promptly.
@@ -75,6 +91,12 @@ See [IntersectMBO/ouroboros-network#4555](https://github.com/IntersectMBO/ourobo
7591
Here, `YoungEnough` signals that the ledger state's distribution among stake relays is sufficiently close to that of the actual real world.
7692
For now, we conservatively return `YoungEnough` only when the node concludes it has fully caught-up, and `TooOld` otherwise.
7793

94+
- The Diffusion Layer will inform the Consensus Layer whether the Honest Availability Assumption is satisfied.
95+
```haskell
96+
data OutboundConnectionsState = TrustedStateWithExternalPeers | UntrustedState
97+
daUpdateOutboundConnectionsState :: OutboundConnectionsState -> STM m ()
98+
```
99+
78100
- Whenever necessary, the Diffusion Layer can ask the Consensus Layer for the ledger peer information, eg
79101
```haskell
80102
lpGetLedgerPeers :: STM m [(PoolStake, NonEmpty RelayAccessPoint)]

0 commit comments

Comments
 (0)