You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This document is the first iteration of a high-level design for Linear Leios.
4
-
It is one of the next steps towards deriving an implementable design from [CIP-0164](https://github.com/cardano-foundation/CIPs/pull/1078).
12
+
This document is the first iteration of a high-level design document for the Leios consensus upgrade as also proposed in [CIP-0164](https://github.com/cardano-foundation/CIPs/pull/1078). It analyses the protocol-level design provided by the CIP and **derives requirements** (`REQ`) and **sketches changes** (`NEW` or `UPD`) onto the concrete system of the [`cardano-node`](https://github.com/IntersectMBO/cardano-node).
5
13
6
-
(TODO This content is only for [the Consensus and Storage Layer](https://github.com/IntersectMBO/ouroboros-consensus) of [`cardano-node`](https://github.com/IntersectMBO/cardano-node) for now.)
14
+
# Background
7
15
8
-
# Vocabulary/Jargon
16
+
> [!WARNING]
17
+
> TODO: Introduce relevant concepts and terminology needed to comprehend the remainder of the document
9
18
10
19
- Recall from CIP-0164 that an _endorser block_ (EB) is a list of cryptographic hashes that uniquely identify (serialized) transactions (including their signatures).
11
20
- Let an _EB's closure_ be the sequence of transactions referenced by an EB.
@@ -17,7 +26,23 @@ It is one of the next steps towards deriving an implementable design from [CIP-0
17
26
- Let a _CertRB's closure_ be the closure of the EB that it certifies.
18
27
- A vote _supports_ an RB header directly and its announced EB indirectly: if enough votes support the same RB header, then its announced EB can be included on chain.
19
28
20
-
# Requirements
29
+
# Ecosystem
30
+
31
+
> [!WARNING]
32
+
> TODO: Introduce the "cardano node system" and its context
33
+
> - c4 landscape diagram
34
+
> - characterize ecosystem / dependency graph
35
+
> - cover external interfaces of the cardano node
36
+
> - ecosystem impact (onto relevant personas)
37
+
38
+
# Consensus
39
+
40
+
> [!WARNING]
41
+
> TODO: Refine requirements and changes to the **Consensus components**
42
+
43
+
This section is covering the anticipated impact onto [the Consensus and Storage Layer](https://github.com/IntersectMBO/ouroboros-consensus) of [`cardano-node`](https://github.com/IntersectMBO/cardano-node).
44
+
45
+
## Requirements
21
46
22
47
This high-level design incorporates the following requirements from CIP-0164 into the existing code's architecture.
23
48
Subsequent sections will specify changes that satisfy these new requirements without introducing Denial of Service attack vectors, etc.
@@ -50,7 +75,7 @@ These two rules can be summarized as Praos > fresh Leios > stale Leios.
50
75
Looking forward, Peras should also be prioritized over Leios, since a single Peras failure is more disruptive (to Praos, even!) than a single Leios failure.
51
76
It's not yet clear how priority relates Peras and Praos, but that's beyond the scope this document.
52
77
53
-
# Consensus Changes for Functional Requirements
78
+
##Consensus Changes for Functional Requirements
54
79
55
80
-*UPD-LeiosAwareBlockProductionThread*, for REQ-IssueLeiosBlocks and REQ-IncludeLeiosCertificates.
56
81
The existing block production thread must generate an EB at the same time it generates an RB.
@@ -102,7 +127,7 @@ It's not yet clear how priority relates Peras and Praos, but that's beyond the s
102
127
The Leios mini-protocols will require new fetch decision logic, since the node should not necessarily simply download every such object from every peer that offers it.
103
128
Such fetch decision logic is also required for TxSubmission and for Peras votes; the Leios logic will likely be similar but not equivalent.
104
129
105
-
# Protocol Burst Attack
130
+
##Protocol Burst Attack
106
131
107
132
There are multiple attack vectors against Leios, but one is particularly relevant to resource-management.
108
133
@@ -114,7 +139,7 @@ The potential magnitude of that burst will depend on various factors, including
114
139
The cost to the victim is merely the work to acquire the closures and to check the hashes of the received EB bodies and transaction bodies.
115
140
In particular, at most one of the EBs in the burst could extend the tip of a victim node's current selection, and so that's the only EB the victim would attempt to fully parse and validate.
116
141
117
-
# Risks Threatening the Resource-Management Requirements
142
+
##Risks Threatening the Resource-Management Requirements
118
143
119
144
The fundamental idea behind Leios has always been that the Praos protocol is inherently and necessarily bursty.
120
145
Leios should be able to freely utilize the nodes' resources whenever Praos is not utilizing them, which directly motivates REQ-PrioritizePraosOverLeios.
@@ -125,7 +150,7 @@ Contention for the following primary node resources might unacceptably degrade t
125
150
126
151
-*RSK-LeiosPraosContentionNetworkBandwidth*.
127
152
This is not anticipated to be a challenge, because time-multiplexing the bandwidth is relatively easy.
128
-
In factor, Leios traffic while Praos is idle could potentially even prevent the TCP Receive Window from contracting, thus avoiding a slow start when Praos traffic resumes.
153
+
In fact, Leios traffic while Praos is idle could potentially even prevent the TCP Receive Window from contracting, thus avoiding a slow start when Praos traffic resumes.
129
154
-*RSK-LeiosPraosContentionCPU*.
130
155
This is not anticipated to be a challenge, because today's Praos node does not exhibit major CPU load on multi-core machines.
131
156
Leios might have more power-to-weight ratio for parallelizing its most expensive task (EB validation), but that parallelization isn't yet obviously necessary.
@@ -159,7 +184,7 @@ The same risks can also be viewed from a different perspective, which is more ac
159
184
Same as RSK-LeiosLedgerOverheadLatency, but for the Mempool frequently revalidating 15000% load in a caught-up node during congestion (ie 30000% the capacity of a Praos block, since the Leios Mempool capacity is now two EBs instead of two Praos blocks).
160
185
-_Etc_
161
186
162
-
# Prototypes and Experiments for Derisking Resource-Management
187
+
##Prototypes and Experiments for Derisking Resource-Management
163
188
164
189
The first new code will be used to demonstrate and measure the contention underlying the above risks.
165
190
The following experiments each pertain to several of the risks above.
@@ -183,7 +208,7 @@ The following experiments each pertain to several of the risks above.
183
208
- This experiment will analyze the GC stats and other event logs of the node(s) under test.
184
209
- TODO what about TxSubmission traffic?
185
210
186
-
# Consensus Changes for Resource-Management Requirements
211
+
##Consensus Changes for Resource-Management Requirements
187
212
188
213
It is not already clear which new or updated mechanisms/components would mitigate the resource-management risks, if the prototypes and experiment indicate mitigations are necessary.
189
214
@@ -194,7 +219,7 @@ It is not already clear which new or updated mechanisms/components would mitigat
194
219
See ["Erlang-style processes in the RTS"](https://gitlab.haskell.org/ghc/ghc/-/issues/21578) and ["Execution domains in GHC/Haskell" (HIW23 Lightning Talk)](https://www.youtube.com/watch?v=Ha7oIVrLwSI).
195
220
- RSK-LeiosPraosContentionDiskBandwidth could be mitigated by rate-limiting the Leios disk traffic, with back pressure to accordingly rate-limit the Leios network traffic.
196
221
197
-
# TODO some concrete Consensus details
222
+
##TODO Miscellaneous details
198
223
199
224
- First version of LedgerDB need not explicitly store EB's ledger state; the CertRB's result ledger state will reflect the EB's contents.
200
225
Second version could thunk the EB's reapplication alongside the announcing RB?
@@ -224,3 +249,24 @@ It is not already clear which new or updated mechanisms/components would mitigat
224
249
Second version maybe instead integrates certified EBs into the existing ImmDB?
225
250
That integration seems like a good fit.
226
251
It has other benefits (eg saves a disk roundtrip and exhibits linear disk reads for driver prefetching/etc), but those seem unimportant so far.
252
+
253
+
254
+
# Network
255
+
256
+
> [!WARNING]
257
+
> TODO: Describe requirements and changes to the **Network components**
258
+
259
+
# Ledger
260
+
261
+
> [!WARNING]
262
+
> TODO: Describe requirements and changes to the **Ledger component**
263
+
264
+
# Cryptography
265
+
266
+
> [!WARNING]
267
+
> TODO: Describe requirements and changes to the **Cryptography / Cardano base components**
268
+
269
+
# Appendix
270
+
271
+
> [!WARNING]
272
+
> TODO: consider putting lengthy content here instead
0 commit comments