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
Copy file name to clipboardExpand all lines: docs/ImpactAnalysis.md
+51-21Lines changed: 51 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -245,11 +245,6 @@ It's not yet clear how priority relates Peras and Praos, but that's beyond the s
245
245
That's not guaranteed, though, so the node must be able to fetch whichever transactions are missing, but in the absence of an attack that ought to be minimal.
246
246
The Mempool is the natural inspiration for this optimization, but it's inappropriate as the actual cache for two reasons: it has a relatively small, multidimensional capacity and its eviction policy is determined by the distinct needs of block production.
247
247
This new component instead has a greater, unidimensional capacity and a simple Least Recently Used eviction policy.
248
-
-*NEW-LeiosMiniProtocols*, for REQ-DiffuseLeiosBlocks, REQ-DiffuseLeiosVotes, and REQ-ArchiveLeiosBlocks.
249
-
The node must include new mini-protocols to diffuse EB announcements, EBs themselves, EBs' transactions, and votes for EBs.
250
-
-*NEW-LeiosFetchDecisionLogic*, for REQ-DiffuseLeiosBlocks, REQ-DiffuseLeiosVotes, and REQ-ArchiveLeiosBlocks.
251
-
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.
252
-
Such fetch decision logic is also required for TxSubmission and for Peras votes; the Leios logic will likely be similar but not equivalent.
253
248
254
249
## Protocol Burst Attack
255
250
@@ -318,19 +313,7 @@ The following experiments each pertain to several of the risks above.
318
313
Ledger state snapshot files and contiguous blocks can be sliced from `mainnet`, P&T clusters, etc to assemble a sequence of transactions that could be collated by an EB.
319
314
Both full validation (eg Leios voting) as well as mere reapplication (eg Mempool) should be separately analyzed.
320
315
This experiment will record and summarize the observed behavior of the mutator time and various GC statistics, so as to inform futher consideration of risks as well as the design of other experiments (eg traffic shaping).
321
-
-*EXP-LeiosDiffusionOnly*.
322
-
A minimally-patched Praos node can include only the Leios changes necessary to actually diffuse EBs and their closures.
323
-
Notably, even the content of the transactions in the EBs need not be well-formed.
324
-
- This patched node will assume every EB is worthy of certification but somehow never influences the ledger state.
325
-
- In order for Praos headers to suffice, EBs in this patched system will list the "announcing" header's hash, which is fine since EBs are trustworthy in this experiment.
326
-
- In this experiment, EBs' transactions merely need to be diffused, hash checked, and stored---not even parsed.
327
-
Every transaction within an EB will be an opaque bytestring (with random contents to avoid accidental trivialities).
328
-
The complementary EXP-LeiosLedgerDbAnalyser experiment will characterize which resource consumption this choice avoids, which is useful for avoiding conflation.
329
-
- Each RB permitted to contain a certificate is blocked (in the NEW-LeiosCertRbStagingArea) by the arrival of its predecessor's announced EB, but Praos is otherwise unaffected.
330
-
- Mocked upstream peers will originate all blocks, and the node(s) under test will merely relay everything.
331
-
The incoming RBs could simply be copied from `mainnet`, a P&T cluster run, etc, with the EBs' fully mocked arrival times derived in some way from the original RBs' slot onsets.
332
-
- This experiment will analyze the GC stats and other event logs of the node(s) under test.
333
-
- TODO what about TxSubmission traffic?
316
+
- TODO more
334
317
335
318
## Consensus Changes for Resource-Management Requirements
336
319
@@ -374,11 +357,58 @@ It is not already clear which new or updated mechanisms/components would mitigat
374
357
That integration seems like a good fit.
375
358
It has other benefits (eg saves a disk roundtrip and exhibits linear disk reads for driver prefetching/etc), but those seem unimportant so far.
376
359
377
-
378
360
# Network
379
361
380
-
> [!WARNING]
381
-
> TODO: Describe requirements and changes to the **Network components**
362
+
## Requirements and Risks
363
+
364
+
The relevant requirements derived from the CIP for the Network component are a subset of those listed in the Consensus section above: REQ-DiffuseLeiosBlocks, REQ-DiffuseLeiosVotes, REQ-PrioritizePraosOverLeios, and REQ-PrioritizeFreshOverStaleLeios.
365
+
366
+
Similarly, the RSK-LeiosPraosContentionNetworkBandwidth and RSK-LeiosNetworkingOverheadLatency risks from the above applies to the Network layer.
367
+
Additionally, REQ-PrioritizeFreshOverStaleLeios suggests the following new risk.
368
+
369
+
-*RSK-LeiosLeiosContentionNetworkBandwidth*.
370
+
Same as RSK-LeiosPraosContentionNetworkBandwidth, except between Leios traffic for fresh EBs and Leios traffic for stale EBs.
371
+
372
+
## Network Changes for Functional Requirementrs
373
+
374
+
-*NEW-LeiosMiniProtocols*, for REQ-DiffuseLeiosBlocks, REQ-DiffuseLeiosVotes, and REQ-ArchiveLeiosBlocks.
375
+
The node must include new mini-protocols to diffuse EB announcements, EBs themselves, EBs' transactions, and votes for EBs.
376
+
-*NEW-LeiosFetchDecisionLogic*, for REQ-DiffuseLeiosBlocks, REQ-DiffuseLeiosVotes, and REQ-ArchiveLeiosBlocks.
377
+
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.
378
+
Such fetch decision logic is also required for TxSubmission and for Peras votes; the Leios logic will likely be similar but not equivalent.
379
+
380
+
## Network Changes for Resource-Management Requirements
381
+
382
+
-*NEW-LeiosPraosMuxBias*.
383
+
The existing multiplexer is intentionally fair amongst the different mini-protocols.
384
+
In the current CIP, the Praos traffic and Leios traffic are carried by different mini-protocols.
385
+
Therefore, introducing a simple bias in the multiplexer to strongly (TODO fully?) prefer sending messages from Praos mini protocols over messages from Leios mini protocols would directly mitigate RSK-LeiosPraosContentionNetworkBandwidth.
386
+
387
+
It is not yet clear how best to mitigate RSK-LeiosLeiosContentionNetworkBandwidth or, more generally, how to satisfy REQ-PrioritizeFreshOverStaleLeios (aka freshest first delivery) in the Network Layer.
388
+
One notable option is to "rotate" the two proposed Leios mini-protocols into a less natural pair: one would send all requests and only requests and the other would send all replies and only replies.
389
+
In that way, the server can---when it has received multiple outstanding requests, which seems likelying during ATK-LeiosProtocolBurst---reply to requests in a different order then the client sent them, which is inevitable since the client will commonly request an EB as soon it's offered, which means the client will request maximally fresh EBs after having requesting less fresh EBs.
390
+
If the client were to avoid sending any request that requires a massive atomic reply (eg a MsgLeiosBlockTxsRequest for 10 megabytes), then the server can prioritize effectively even without needing to implement any kind of preemption mechanism.
391
+
This option can be formulated in the existing mini protocol infrastructure, but another option would be to instead enrich the mini-protocol infrastructure to somehow directly allow for server-side reordering.
392
+
393
+
## Prototypes and Experiments for Derisking Resource-Management
394
+
395
+
The first new code will be used to demonstrate and measure the contention underlying the above risks.
396
+
The following experiments each pertain to several of the risks above.
397
+
398
+
-*EXP-LeiosDiffusionOnly*.
399
+
A minimally-patched Praos node can include only the Leios changes necessary to actually diffuse EBs and their closures.
400
+
Notably, even the content of the transactions in the EBs need not be well-formed.
401
+
- This patched node will assume every EB is worthy of certification but somehow never influences the ledger state.
402
+
- In order for Praos headers to suffice, EBs in this patched system will list the "announcing" header's hash, which is fine since EBs are trustworthy in this experiment.
403
+
- In this experiment, EBs' transactions merely need to be diffused, hash checked, and stored---not even parsed.
404
+
Every transaction within an EB will be an opaque bytestring (with random contents to avoid accidental trivialities).
405
+
The complementary EXP-LeiosLedgerDbAnalyser experiment will characterize which resource consumption this choice avoids, which is useful for avoiding conflation.
406
+
- Each RB permitted to contain a certificate is blocked (in the NEW-LeiosCertRbStagingArea) by the arrival of its predecessor's announced EB, but Praos is otherwise unaffected.
407
+
- Mocked upstream peers will originate all blocks, and the node(s) under test will merely relay everything.
408
+
The incoming RBs could simply be copied from `mainnet`, a P&T cluster run, etc, with the EBs' fully mocked arrival times derived in some way from the original RBs' slot onsets.
409
+
- This experiment will analyze the GC stats and other event logs of the node(s) under test.
0 commit comments