Skip to content

Commit 0c0438a

Browse files
nbacqueyagustinmistaamesgengeo2atbagrel1
committed
Fix TODOs or add link to issue
Co-authored-by: Agustin Mista <[email protected]> Co-authored-by: Alexander Esgen <[email protected]> Co-authored-by: Georgy Lukyanov <[email protected]> Co-authored-by: Thomas BAGREL <[email protected]> Co-authored-by: Nicolas BACQUEY <[email protected]> Co-authored-by: Nicolas "Niols" Jeannerod <[email protected]>
1 parent d4d5ca0 commit 0c0438a

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ChainDB/API.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,11 +393,11 @@ data ChainDB m blk = ChainDB
393393
-- ^ Get statistics from the LedgerDB, in particular the number of entries
394394
-- in the tables.
395395
, addPerasCertAsync :: ValidatedPerasCert blk -> m (AddPerasCertPromise m)
396-
-- ^ TODO docs
396+
-- ^ Asynchronously insert a certificate to the DB.
397397
, getPerasWeightSnapshot :: STM m (WithFingerprint (PerasWeightSnapshot blk))
398-
-- ^ TODO
398+
-- ^ Get the weight snapshot from the DB.
399399
, getPerasCertSnapshot :: STM m (PerasCertSnapshot blk)
400-
-- ^ TODO
400+
-- ^ Get the certificate snapshot from the DB.
401401
, closeDB :: m ()
402402
-- ^ Close the ChainDB
403403
--

ouroboros-consensus/test/storage-test/Test/Ouroboros/Storage/ChainDB/Model.hs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,7 @@ garbageCollect secParam m@Model{..} =
10861086
m
10871087
{ volatileDbBlocks = Map.filter (not . collectable) volatileDbBlocks
10881088
-- TODO garbage collection Peras certs?
1089+
-- See https://github.com/tweag/cardano-peras/issues/121
10891090
}
10901091
where
10911092
-- TODO what about iterators that will stream garbage collected blocks?
@@ -1125,6 +1126,8 @@ closeDB m@Model{..} =
11251126
reopen :: Model blk -> Model blk
11261127
reopen m = m{isOpen = True}
11271128

1129+
-- TODO: update to account for persisted Peras certificates.
1130+
-- see https://github.com/tweag/cardano-peras/issues/122
11281131
wipeVolatileDB ::
11291132
forall blk.
11301133
(LedgerSupportsProtocol blk, LedgerTablesAreTrivial (ExtLedgerState blk)) =>
@@ -1137,14 +1140,7 @@ wipeVolatileDB cfg m =
11371140
m' =
11381141
(closeDB m)
11391142
{ volatileDbBlocks = Map.empty
1140-
, -- TODO: Currently, the SUT has no persistence of Peras certs across
1141-
-- restarts, but this will change. There are at least two options:
1142-
--
1143-
-- * Change this command to mean "wipe volatile state" (including
1144-
-- volatile certificates)
1145-
--
1146-
-- * Add a separate "Wipe volatile certs".
1147-
perasCerts = Map.empty
1143+
, perasCerts = Map.empty
11481144
, cps = CPS.switchFork newChain (cps m)
11491145
, currentLedger = newLedger
11501146
, invalid = Map.empty

ouroboros-consensus/test/storage-test/Test/Ouroboros/Storage/ChainDB/Model/Test.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ prop_alwaysPickPreferredChain bt p =
107107
candFragment = Chain.toAnchoredFragment (getHeader <$> candidate)
108108

109109
-- TODO test with non-trivial weights
110+
-- see https://github.com/tweag/cardano-peras/issues/123
110111
weights :: PerasWeightSnapshot TestBlock
111112
weights = emptyPerasWeightSnapshot
112113

ouroboros-consensus/test/storage-test/Test/Ouroboros/Storage/ChainDB/StateMachine.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,8 @@ generator loe genBlock m@Model{..} =
10451045

10461046
genAddPerasCert :: Gen (ValidatedPerasCert blk)
10471047
genAddPerasCert = do
1048-
-- TODO chain condition?
1048+
-- TODO should we be more strict on which blocks we add certs to?
1049+
-- see https://github.com/tweag/cardano-peras/issues/124
10491050
blk <- genBlock m
10501051
let roundNo = case Model.maxPerasRoundNo dbModel of
10511052
Nothing -> PerasRoundNo 0

0 commit comments

Comments
 (0)