Repository navigation
Conversation
dnadales
force-pushed
the
dnadales/eb-forge-store
branch
3 times, most recently
from
October 22, 2026 18:51
4eaae39 to
11cd377
Compare
A caller that does not await the promise then sees the failure. The 'LeiosDbWriter' documentation now says that a write can throw at submission.
The LeiosDB needs these bytes to store the endorser block. Only 'forgeLeiosEb' builds a 'ForgedLeiosEb'. Thus the bytes always match the references in the endorser block.
Each forging thread opens a LeiosDB writer, and 'storeForgedEb' writes the point, the body and the transactions of each forged endorser block. The forge does not await the writes. On SQLite, it blocks while the write queue is full. If a write fails, the node stops. 'finalize' erases the KES key before 'closeWriter' runs, because 'closeWriter' waits for the LeiosDB write queue.
The test reads the endorser block back from the LeiosDB at the point that the header announces.
The test installs a block forging with 'setBlockForging' on a node over an in-memory LeiosDB. Thus it checks that 'forkBlockForging' gives 'storeForgedEb' to 'forge'.
dnadales
force-pushed
the
dnadales/eb-forge-store
branch
from
October 22, 2026 19:08
11cd377 to
e13e48b
Compare
bladyjoker
reviewed
Oct 23, 2026
| -- The forge does not await the writes. On SQLite, it blocks while the write | ||
| -- queue is full. If a write fails, the node stops. Peers can get the header | ||
| -- before the endorser block is stored. | ||
| storeForgedEb :: |
Contributor
There was a problem hiding this comment.
This shouldn't be here, can we move it closer to LeiosDb? Perhaps even in the API?
bladyjoker
reviewed
Oct 23, 2026
| MkLeiosEb $ | ||
| V.fromList [(MkTxHash (fromShort (toRawTxIdHash (txId tx))), 0) | tx <- txs] | ||
| ebListing :: NonEmpty (GenTx BlockA) -> ForgedLeiosEb | ||
| ebListing = forgeLeiosEb . fmap (fromShort . toRawTxIdHash . txId) |
Contributor
There was a problem hiding this comment.
ebListing is a foreing concept, this is mkForgedLeiosEb
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After
forgeBlockreturns an endorser block, the node kernel writes its point, body and transactions to the LeiosDB.The point is the slot and the endorser block hash that the ranking-block header announces.
The forge does not await the writes.
Thus a peer can get the header before the LeiosDB stores the endorser block.
This is not a problem yet, because no peer fetches an endorser block from a header.
The node must send offers only after the LeiosDB sends
AcquiredEbandAcquiredEbTxs.On SQLite, the forge blocks while the write queue is full.
If a write fails, the node stops.
For this, the first commit makes the in-memory LeiosDB throw a failed write at submission, as the
Promisehaddock says.Part of input-output-hk/ouroboros-leios#1107.