Skip to content

Commit 8b0f277

Browse files
committed
Add module docstring to ObjectPool API
1 parent 02044e1 commit 8b0f277

File tree

1 file changed

+27
-0
lines changed
  • ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/MiniProtocol/ObjectDiffusion/ObjectPool

1 file changed

+27
-0
lines changed

ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/MiniProtocol/ObjectDiffusion/ObjectPool/API.hs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
-- | API for reading from and writing to object pools in the ObjectDiffusion
2+
-- miniprotocol.
3+
--
4+
-- The underlying object pool can be any database, such as a 'PerasCertDb' in
5+
-- Peras certificate diffusion.
6+
--
7+
-- 'ObjectPoolReader' is used on the outbound side of the protocol. Objects in
8+
-- the pool are ordered by a strictly increasing ticket number ('ticketNo'),
9+
-- which represents their time of arrival. Ticket numbers are local to each
10+
-- node, unlike object IDs, which are global. Object IDs are not used for
11+
-- ordering, since objects may arrive slightly out of order from peers.
12+
--
13+
-- To read from the pool, one requests objects with a ticket number strictly
14+
-- greater than the last known one. 'oprZeroTicketNo' provides an initial ticket
15+
-- number for the first request.
16+
--
17+
-- 'ObjectPoolWriter' is used on the inbound side of the protocol. It allows
18+
-- checking whether an object is already present (to avoid re-requesting it) and
19+
-- appending new objects. Ticket numbers are not part of the inbound interface,
20+
-- but are used internally: newly added objects always receive a ticket number
21+
-- strictly greater than those of older ones.
22+
--
23+
-- This API design is inspired by 'MempoolSnapshot' from the TX-submission
24+
-- miniprotocol, see:
25+
-- <https://ouroboros-consensus.cardano.intersectmbo.org/haddocks/ouroboros-consensus/Ouroboros-Consensus-Mempool-API.html#t:MempoolSnapshot>
26+
27+
128
module Ouroboros.Consensus.MiniProtocol.ObjectDiffusion.ObjectPool.API
229
( ObjectPoolReader (..)
330
, ObjectPoolWriter (..)

0 commit comments

Comments
 (0)