Skip to content

Commit 1341e40

Browse files
committed
docs: added eb-dag approach
1 parent 15f015b commit 1341e40

14 files changed

+1177
-451
lines changed

docs/workshop/day-3-recap.md

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,11 @@ The above diagram displays a more realistic picture of different IBs referencing
6060

6161
The EB reference approach offers a middle ground between security and latency. Certified EBs (those that have received votes from a majority of stake) provide security guarantees with lower latency than the [RB-reference approach](#rb-reference-approach), as they indicate that enough nodes have seen and validated them. Several core variations of the EB reference approach were discussed:
6262

63-
##### 1. **IB-to-EB-to-RB Reference**: IBs directly reference certified EBs, which themselves reference an older RB.
64-
![EB Reference Approach](eb-reference-01.svg)
63+
##### 1. **EB Reference**
64+
65+
IBs directly reference certified EBs, which themselves reference an older RB.
66+
67+
![EB Reference Approach](eb-reference.svg)
6568

6669
Different to the [IB-to-RB referencing](#ib-to-rb-reference-approach), this approach has IBs reference an EB instead which itself references an RB.
6770

@@ -70,24 +73,48 @@ We briefly discussed an alternative design choice, in which IBs reference an EB
7073
In this design, one gets a ledger state for each RB which gives a ledger state for each EB to be reused and IBs are validated with respect to that same state. On the contrary, due to EBs referencing an RB, there is still the same trade-off to be made as in the [IB-to-RB reference approach](#ib-to-rb-reference-approach) - having to chose more or less stable RBs for EBs resulting in higher latency or higher loss in EBs.
7174

7275

73-
##### 2. **EB Chain/ IB-to-EB(-to-EB)*-to-RB**
76+
##### 2. **EB-Chain**
7477

7578
In this approach IBs reference an EB which itself may reference another EB, which creates this chain of EBs that anchors on some older RB reference. Thus, EBs may have an RB reference or another EB reference of an EB that has not made it into an RB yet (full Leios variant). RBs on the other hand can only exactly reference one certified EB. IBs reference one of these EBs.
7679

77-
This approach allows for more recent state references while maintaining security through the chain of certified EBs, and handles edge-case scenarios, where multiple EBs have been produced:
80+
As a downside of this approach, it doesn't allow for EBs to reference one or more EBs. Therefore, it still has the same trade-off from the previous [IB-to-EB-to-RB](#1-ib-to-eb-to-rb-reference) approach, since these chains of EBs are anchored to RBs, which comes with this disadvantageous property of high latency, older stable RBs vs low latency, less stable RBs.
81+
82+
![EB Chain Approach](eb-chain.svg)
83+
84+
##### 3. **EB-DAG**
85+
86+
The EB DAG approach represents a sophisticated approach that leverages a directed acyclic graph (DAG) structure of Endorsement Blocks (EBs) to achieve both low latency and strong security guarantees. In this design:
87+
88+
![EB Chain Approach](eb-dag.svg)
89+
90+
- EBs can reference one or more older EBs that haven't been referenced by other EBs yet
91+
- Ranking Blocks (RBs) reference exactly one EB
92+
- Input Blocks (IBs) reference one of these EBs
7893

79-
- from different pipelines in parallel (see EB ordering below)
80-
- from the same pipeline
94+
**Key Advantages:**
8195

82-
![EB Chain Approach](eb-reference-02.svg)
96+
1. **Low Latency with Security**: By allowing EBs to reference other EBs directly, the system achieves low latency while maintaining security. This is because EBs don't need to wait for RBs to be produced, creating a more efficient validation pipeline.
8397

84-
**Extensions and Implementation Details:**
98+
2. **Strong Inclusion Guarantee**: With EBs referencing other EBs, there's a strong property that EBs almost always make it into the chain, assuming the EB rate is approximately 1.5x that of RB rate.
8599

86-
- **Minimum Age Requirement**: A constraint where EBs must reference an RB that is at least a certain age (e.g., 5 minutes old) to ensure it's widely available in the network.
100+
3. **Efficient State Management**: Despite allowing multiple EB references, the system maintains computational efficiency. When computing ledger states for EBs in a chain, nodes can reuse the ledger state from referenced EBs and only replay the IBs in the current EB.
87101

88-
- **EB Ordering by Slot**: In the Leios protocol, multiple pipelines run in parallel, each ideally producing one RB. With parameters set for 1.5 EBs per stage (with randomness via VRF functions potentially producing more), there may be multiple EBs to choose from for inclusion in an RB.
102+
4. **Complete History**: EBs form a chain back to genesis, with the first EB referencing an RB, and subsequent EBs referencing only other EBs. This creates a complete and verifiable history of the chain's state.
89103

90-
- **EB State Reuse**: An optimization technique where, when computing ledger states for EBs in a chain, we reuse the ledger state from referenced EBs and only replay the IBs in the current EB, reducing computational overhead, especially important when dealing with multiple pipelines and stages.
104+
5. **Deterministic State Count**: The number of ledger states a node needs to maintain is exactly equal to the number of EBs, providing predictable resource requirements.
105+
106+
**Implementation Details:**
107+
108+
1. **EB Ordering**: The system handles multiple pipelines running in parallel, each producing one RB. With parameters set for 1.5 EBs per stage (with randomness via VRF functions potentially producing more), there may be multiple EBs to choose from for inclusion in an RB.
109+
110+
2. **State Reconstruction**: When computing ledger states, nodes can efficiently reconstruct the state by reusing states from referenced EBs and only replaying new IBs, preventing computational overhead.
111+
112+
**Limitations:**
113+
114+
1. **No Transactions in RBs**: A notable limitation of this scheme is that RBs cannot contain transactions themselves, as they serve primarily as ordering mechanisms for the EB DAG.
115+
116+
> [!Note]
117+
> [Here](./eb-dag-detailed.svg) is a version of the EB-DAG including IBs.
91118
92119
#### IB Reference Approach
93120

docs/workshop/eb-reference-02.d2 renamed to docs/workshop/eb-chain.d2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
...@styles
22

33
title: {
4-
label: "EB Chain/ IB-to-EB(-to-EB)*-to-RB Reference Approach"
4+
label: "EB-Chain"
55
near: top-center
66
style.font-size: 24
77
style.bold: true

docs/workshop/eb-chain.svg

Lines changed: 139 additions & 0 deletions
Loading

docs/workshop/eb-dag-detailed.d2

Lines changed: 241 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
...@styles
2+
3+
title: {
4+
label: "EB-DAG Approach"
5+
near: top-center
6+
style.font-size: 24
7+
style.bold: true
8+
style.fill: "#ffffff"
9+
style.stroke: "#ffffff"
10+
}
11+
12+
# chain definitions
13+
14+
chain: {
15+
label: "Ranking Blockchain"
16+
class: container
17+
18+
Genesis: {
19+
class: rb
20+
label: "Genesis"
21+
}
22+
23+
RBs: {
24+
class: rb_stacked
25+
label: "RBs"
26+
}
27+
28+
RB1: {
29+
class: rb
30+
label: "RB 1"
31+
}
32+
33+
RB2: {
34+
class: rb
35+
label: "RB 2"
36+
}
37+
38+
RB3: {
39+
class: rb
40+
label: "RB 3\n(tip)"
41+
}
42+
}
43+
44+
# RB definitions
45+
46+
RB: {
47+
class: rb_unconfirmed
48+
label: "RB"
49+
}
50+
51+
# EB definitions
52+
53+
EB1: {
54+
class: eb
55+
label: "EB 1"
56+
}
57+
58+
EB2: {
59+
class: eb
60+
label: "EB 2"
61+
}
62+
63+
EB3: {
64+
class: eb
65+
label: "EB 3"
66+
}
67+
68+
EB4: {
69+
class: eb
70+
label: "EB 4"
71+
}
72+
73+
EB5: {
74+
class: eb
75+
label: "EB 5"
76+
}
77+
78+
EB6: {
79+
class: eb
80+
label: "EB 6"
81+
}
82+
83+
EB7: {
84+
class: eb_unconfirmed
85+
label: "EB 7"
86+
}
87+
88+
# IB definitions
89+
90+
IB1: {
91+
class: ib
92+
label: "IB 1"
93+
}
94+
95+
IB2: {
96+
class: ib
97+
label: "IB 2"
98+
}
99+
100+
IB3: {
101+
class: ib
102+
label: "IB 3"
103+
}
104+
105+
IB4: {
106+
class: ib
107+
label: "IB 4"
108+
}
109+
110+
IB5: {
111+
class: ib
112+
label: "IB 5"
113+
}
114+
115+
IB6: {
116+
class: ib
117+
label: "IB 6"
118+
}
119+
120+
IB7: {
121+
class: ib
122+
label: "IB 7"
123+
}
124+
125+
IB8: {
126+
class: ib
127+
label: "IB 8"
128+
}
129+
130+
IB9: {
131+
class: ib
132+
label: "IB 9"
133+
}
134+
135+
# RB references
136+
137+
chain.RBs -> chain.Genesis: {
138+
class: to_rb_arrow
139+
}
140+
chain.RB1 -> chain.RBs: {
141+
class: to_rb_arrow
142+
}
143+
chain.RB2 -> chain.RB1: {
144+
class: to_rb_arrow
145+
}
146+
chain.RB3 -> chain.RB2: {
147+
class: to_rb_arrow
148+
}
149+
RB -> chain.RB3: {
150+
class: to_rb_arrow
151+
}
152+
153+
# EB references
154+
155+
EB1 -> chain.Genesis: "Ledger Ref" {
156+
class: ledger_link
157+
}
158+
159+
chain.RB1 -> EB1: "Holds\nCertificate" {
160+
class: eb_cert
161+
}
162+
163+
EB2 -> EB1: "Ref" {
164+
class: to_eb_arrow
165+
}
166+
167+
chain.RB2 -> EB2: "Holds\nCertificate" {
168+
class: eb_cert
169+
}
170+
171+
EB3 -> EB1: "Ref" {
172+
class: to_eb_arrow
173+
}
174+
175+
EB4 -> EB3: "Ref" {
176+
class: to_eb_arrow
177+
}
178+
179+
EB5 -> EB2: "Ref" {
180+
class: to_eb_arrow
181+
}
182+
183+
EB5 -> EB4: "Ref" {
184+
class: to_eb_arrow
185+
}
186+
187+
chain.RB3 -> EB5: "Holds\nCertificate" {
188+
class: eb_cert
189+
}
190+
191+
RB -> EB6: "Holds\nCertificate" {
192+
class: eb_cert
193+
}
194+
195+
EB6 -> EB5: "Ref" {
196+
class: to_eb_arrow
197+
}
198+
199+
EB7 -> EB6: "Ref" {
200+
class: to_eb_arrow
201+
}
202+
203+
# IB references
204+
205+
EB1 -> IB1: "Ref" {
206+
class: to_ib_arrow
207+
}
208+
209+
EB1 -> IB2: "Ref" {
210+
class: to_ib_arrow
211+
}
212+
213+
EB3 -> IB3: "Ref" {
214+
class: to_ib_arrow
215+
}
216+
217+
EB3 -> IB4: "Ref" {
218+
class: to_ib_arrow
219+
}
220+
221+
EB4 -> IB5: "Ref" {
222+
class: to_ib_arrow
223+
}
224+
225+
EB5 -> IB6: "Ref" {
226+
class: to_ib_arrow
227+
}
228+
229+
EB6 -> IB7: "Ref" {
230+
class: to_ib_arrow
231+
}
232+
233+
EB7 -> IB8: "Ref" {
234+
class: to_ib_arrow
235+
}
236+
237+
EB7 -> IB9: "Ref" {
238+
class: to_ib_arrow
239+
}
240+
241+
direction: left

0 commit comments

Comments
 (0)