Skip to content

Commit 2ce5692

Browse files
authored
Expand scope of impact analysis document (#555)
This scaffolding should give everyone a minimum support for contributing relevant materials
1 parent aa40ba0 commit 2ce5692

File tree

1 file changed

+58
-12
lines changed

1 file changed

+58
-12
lines changed

docs/ImpactAnalysis.md

Lines changed: 58 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
1+
---
2+
Title: Leios impact analysis
3+
Authors:
4+
- Nicolas Frisby <[email protected]>
5+
- Sebastian Nagel <[email protected]>
6+
Status: Draft
7+
Version: 0.1
8+
---
9+
110
# Introduction
211

3-
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).
513

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
715

8-
# Vocabulary/Jargon
16+
> [!WARNING]
17+
> TODO: Introduce relevant concepts and terminology needed to comprehend the remainder of the document
918
1019
- Recall from CIP-0164 that an _endorser block_ (EB) is a list of cryptographic hashes that uniquely identify (serialized) transactions (including their signatures).
1120
- 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
1726
- Let a _CertRB's closure_ be the closure of the EB that it certifies.
1827
- 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.
1928

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
2146

2247
This high-level design incorporates the following requirements from CIP-0164 into the existing code's architecture.
2348
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 &gt; fresh Leios &gt; stale Leios.
5075
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.
5176
It's not yet clear how priority relates Peras and Praos, but that's beyond the scope this document.
5277

53-
# Consensus Changes for Functional Requirements
78+
## Consensus Changes for Functional Requirements
5479

5580
- *UPD-LeiosAwareBlockProductionThread*, for REQ-IssueLeiosBlocks and REQ-IncludeLeiosCertificates.
5681
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
102127
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.
103128
Such fetch decision logic is also required for TxSubmission and for Peras votes; the Leios logic will likely be similar but not equivalent.
104129

105-
# Protocol Burst Attack
130+
## Protocol Burst Attack
106131

107132
There are multiple attack vectors against Leios, but one is particularly relevant to resource-management.
108133

@@ -114,7 +139,7 @@ The potential magnitude of that burst will depend on various factors, including
114139
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.
115140
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.
116141

117-
# Risks Threatening the Resource-Management Requirements
142+
## Risks Threatening the Resource-Management Requirements
118143

119144
The fundamental idea behind Leios has always been that the Praos protocol is inherently and necessarily bursty.
120145
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
125150

126151
- *RSK-LeiosPraosContentionNetworkBandwidth*.
127152
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.
129154
- *RSK-LeiosPraosContentionCPU*.
130155
This is not anticipated to be a challenge, because today's Praos node does not exhibit major CPU load on multi-core machines.
131156
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
159184
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).
160185
- _Etc_
161186

162-
# Prototypes and Experiments for Derisking Resource-Management
187+
## Prototypes and Experiments for Derisking Resource-Management
163188

164189
The first new code will be used to demonstrate and measure the contention underlying the above risks.
165190
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.
183208
- This experiment will analyze the GC stats and other event logs of the node(s) under test.
184209
- TODO what about TxSubmission traffic?
185210

186-
# Consensus Changes for Resource-Management Requirements
211+
## Consensus Changes for Resource-Management Requirements
187212

188213
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.
189214

@@ -194,7 +219,7 @@ It is not already clear which new or updated mechanisms/components would mitigat
194219
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).
195220
- RSK-LeiosPraosContentionDiskBandwidth could be mitigated by rate-limiting the Leios disk traffic, with back pressure to accordingly rate-limit the Leios network traffic.
196221

197-
# TODO some concrete Consensus details
222+
## TODO Miscellaneous details
198223

199224
- First version of LedgerDB need not explicitly store EB's ledger state; the CertRB's result ledger state will reflect the EB's contents.
200225
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
224249
Second version maybe instead integrates certified EBs into the existing ImmDB?
225250
That integration seems like a good fit.
226251
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

Comments
 (0)