| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.Storage.LeiosDB.Impl.SQLite.Insert
Description
The insert writes behind
LeiosDbWriter. They run on the
single writer, which calls them from its
WriteJobs.
Synopsis
- sqlInsertEbPoint ∷ Conn → LeiosPoint → BytesSize → IO ()
- sqlInsertEbBody ∷ Tracer IO TraceLeiosDb → Conn → (LeiosEbNotification → IO ()) → LeiosPoint → EndorserBlock → IO CompletedEbs
- sqlInsertTxs ∷ Tracer IO TraceLeiosDb → Conn → (LeiosEbNotification → IO ()) → LeiosPoint → [(TxOffset, ByteString)] → IO CompletedEbs
Documentation
sqlInsertEbPoint ∷ Conn → LeiosPoint → BytesSize → IO () Source #
sqlInsertEbBody ∷ Tracer IO TraceLeiosDb → Conn → (LeiosEbNotification → IO ()) → LeiosPoint → EndorserBlock → IO CompletedEbs Source #
Persist an EB body. The point MUST already be present (inserted
via sqlInsertEbPoint on the announcement path).
Arguments
| ∷ Tracer IO TraceLeiosDb | |
| → Conn | |
| → (LeiosEbNotification → IO ()) | |
| → LeiosPoint | The EB the txs belong to |
| → [(TxOffset, ByteString)] | Tx bytes by offset into the EB's body |
| → IO CompletedEbs |
Persist tx bytes for one EB by filling the rows sqlInsertEbBody
pre-allocated.
PREREQ: each tx's bytes hash to the tx hash the body lists at its offset.
A transaction is dropped if:
- its offset is not in the body;
- its offset is already filled (
filled = 1); - or its size is not the declared one.