Skip to content

Commit 7920039

Browse files
committed
Linear Leios: EB diffusion pipelining
1 parent 622ed51 commit 7920039

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

simulation/docs/SimulatorModel.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,8 @@ The Linear Leios simulator adds the following new variables, some of which also
408408
- `relayLinearEBState`.
409409
As a shortcut, the first Linear Leios simulator will instantiate `Relay` with `RelayHeader InputBlockId` and `InputBlock`.
410410
This is because the IB specified in Short Leios has just a few small fields more than the EB specified in Linear Leios.
411+
- It is remarkable that the Linear EB is added to the Relay buffer immediately, before its validated.
412+
This is "EB Diffusion Pipelining", as indicated in the Linear Leios specification.
411413
- `linearLedgerStateVar`, `waitingForLinearLedgerStateVar`, and `waitingForWaitingForLinearLedgerStateVar`.
412414
An RB that contains an EB cert canot be validated without the the certified EB's ledger state.
413415
However, that EB is necessarily certified, so its ledger state can be built comparatively cheaply now, but still not for free.
@@ -421,6 +423,6 @@ The Linear Leios simulator adds the following new variables, some of which also
421423
- `linearEbOfRb`.
422424
A mapping from RB to its announced Linear EB _that has been validated_, which is needed when issuing an RB.
423425

424-
TODO block diffusion pipelining for both RBs and EBs
426+
TODO RB Diffusion is not pipelined
425427

426428
TODO RBs are so far only distributed by ChainSync and BlockFetch

simulation/src/LeiosProtocol/Short/Node.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1157,10 +1157,12 @@ dispatchValidationSTM tracer cfg leiosState req =
11571157
_ -> k
11581158
waitFor
11591159
leiosState.waitingForTipVar
1160-
[ (rbHash, [ifNoCert ib.id $ queue [valLinearEB ib False completion]])
1160+
[ (rbHash, [ifNoCert ib.id $ queue [valLinearEB ib False (const (pure ()))]])
11611161
| ib <- ibs
11621162
, BlockHash rbHash <- [ib.header.rankingBlock]
11631163
]
1164+
-- @complete@ the Linear EBs immediately, ie "EB Diffusion Pipelining"
1165+
completion [ (convertLinearId ib.id, ib) | ib <- ibs ]
11641166
pure []
11651167
ReapplyLinearEB ib completion -> pure [valLinearEB ib True (const completion)]
11661168
ValidateVotes vs deliveryTime completion -> do

0 commit comments

Comments
 (0)