Skip to content

Commit 7209d87

Browse files
committed
Add rewards thread
1 parent c38499b commit 7209d87

File tree

14 files changed

+199
-56
lines changed

14 files changed

+199
-56
lines changed

cardano-db-sync/cardano-db-sync.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ library
135135
Cardano.DbSync.Threads.Database
136136
Cardano.DbSync.Threads.EpochStake
137137
Cardano.DbSync.Threads.Ledger
138+
Cardano.DbSync.Threads.Rewards
138139
Cardano.DbSync.Threads.Stake
139140
Cardano.DbSync.Threads.TxInResolve
140141
Cardano.DbSync.Tracing.ToObjectOrphans

cardano-db-sync/src/Cardano/DbSync/Block.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ applyAndInsertBlock ::
136136
ExceptT SyncNodeError (ReaderT SqlBackend (LoggingT IO)) ()
137137
applyAndInsertBlock syncEnv ((blockId, firstAfterRollback), cblock) = do
138138
applyRessultVar <- liftIO (asyncApplyResult syncEnv cblock)
139-
-- insertNewEpochLedgerEvents syncEnv (sdEpochNo (apSlotDetails applyResult)) (apEvents applyResult)
140139
whenGeneric $ \blk ->
141140
prepareInsertBlock syncEnv (blockId, blk) applyRessultVar firstAfterRollback
142141
where

cardano-db-sync/src/Cardano/DbSync/Config.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ module Cardano.DbSync.Config (
1515
SyncProtocol (..),
1616
SyncNodeConfig (..),
1717
SyncNodeParams (..),
18-
cardanoLedgerConfig,
1918
genesisProtocolMagicId,
2019
readCardanoGenesisConfig,
2120
readSyncNodeConfig,

cardano-db-sync/src/Cardano/DbSync/Config/Cardano.hs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
module Cardano.DbSync.Config.Cardano (
99
GenesisConfig (..),
10-
cardanoLedgerConfig,
1110
genesisProtocolMagicId,
1211
mkTopLevelConfig,
1312
mkProtocolInfoCardano,
@@ -35,7 +34,6 @@ import Ouroboros.Consensus.Cardano (Nonce (..), ProtVer (ProtVer))
3534
import qualified Ouroboros.Consensus.Cardano as Consensus
3635
import Ouroboros.Consensus.Cardano.Node
3736
import Ouroboros.Consensus.Config (TopLevelConfig (..), emptyCheckpointsMap)
38-
import Ouroboros.Consensus.Ledger.Basics (LedgerConfig)
3937
import Ouroboros.Consensus.Node.ProtocolInfo (ProtocolInfo)
4038
import qualified Ouroboros.Consensus.Node.ProtocolInfo as Consensus
4139
import Ouroboros.Consensus.Shelley.Eras (StandardCrypto)
@@ -73,9 +71,6 @@ readCardanoGenesisConfig enc =
7371

7472
-- -------------------------------------------------------------------------------------------------
7573

76-
cardanoLedgerConfig :: GenesisConfig -> LedgerConfig CardanoBlock
77-
cardanoLedgerConfig = topLevelConfigLedger . mkTopLevelConfig
78-
7974
mkTopLevelConfig :: GenesisConfig -> TopLevelConfig CardanoBlock
8075
mkTopLevelConfig cfg = Consensus.pInfoConfig $ fst $ mkProtocolInfoCardano cfg []
8176

cardano-db-sync/src/Cardano/DbSync/Era/Universal/Epoch.hs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,9 @@ insertRewards ::
248248
(MonadBaseControl IO m, MonadIO m) =>
249249
SyncEnv ->
250250
EpochNo ->
251-
EpochNo ->
252251
[(StakeCred, Set Generic.Reward)] ->
253252
ExceptT SyncNodeError (ReaderT SqlBackend m) ()
254-
insertRewards syncEnv earnedEpoch spendableEpoch rewardsChunk = do
253+
insertRewards syncEnv spendableEpoch rewardsChunk = do
255254
DB.ManualDbConstraints {..} <- liftIO $ readTVarIO $ envDbConstraints syncEnv
256255
dbRewards <- concatMapM mkRewards rewardsChunk
257256
let chunckDbRewards = splittRecordsEvery 100000 dbRewards
@@ -278,7 +277,6 @@ insertRewards syncEnv earnedEpoch spendableEpoch rewardsChunk = do
278277
{ DB.rewardAddrId = saId
279278
, DB.rewardType = Generic.rewardSource rwd
280279
, DB.rewardAmount = Generic.coinToDbLovelace (Generic.rewardAmount rwd)
281-
, DB.rewardEarnedEpoch = unEpochNo earnedEpoch
282280
, DB.rewardSpendableEpoch = unEpochNo spendableEpoch
283281
, DB.rewardPoolId = poolId
284282
}
@@ -296,10 +294,9 @@ insertRewardRests ::
296294
(MonadBaseControl IO m, MonadIO m) =>
297295
SyncEnv ->
298296
EpochNo ->
299-
EpochNo ->
300297
[(StakeCred, Set Generic.RewardRest)] ->
301298
ExceptT SyncNodeError (ReaderT SqlBackend m) ()
302-
insertRewardRests syncEnv earnedEpoch spendableEpoch rewardsChunk = do
299+
insertRewardRests syncEnv spendableEpoch rewardsChunk = do
303300
dbRewards <- concatMapM mkRewards rewardsChunk
304301
let chunckDbRewards = splittRecordsEvery 100000 dbRewards
305302
-- minimising the bulk inserts into hundred thousand chunks to improve performance
@@ -322,18 +319,16 @@ insertRewardRests syncEnv earnedEpoch spendableEpoch rewardsChunk = do
322319
{ DB.rewardRestAddrId = saId
323320
, DB.rewardRestType = Generic.irSource rwd
324321
, DB.rewardRestAmount = Generic.coinToDbLovelace (Generic.irAmount rwd)
325-
, DB.rewardRestEarnedEpoch = unEpochNo earnedEpoch
326322
, DB.rewardRestSpendableEpoch = unEpochNo spendableEpoch
327323
}
328324

329325
insertProposalRefunds ::
330326
(MonadBaseControl IO m, MonadIO m) =>
331327
SyncEnv ->
332328
EpochNo ->
333-
EpochNo ->
334329
[GovActionRefunded] ->
335330
ExceptT SyncNodeError (ReaderT SqlBackend m) ()
336-
insertProposalRefunds syncEnv earnedEpoch spendableEpoch refunds = do
331+
insertProposalRefunds syncEnv spendableEpoch refunds = do
337332
dbRewards <- mapM mkReward refunds
338333
lift $ DB.insertManyRewardRests dbRewards
339334
where
@@ -348,7 +343,6 @@ insertProposalRefunds syncEnv earnedEpoch spendableEpoch refunds = do
348343
{ DB.rewardRestAddrId = saId
349344
, DB.rewardRestType = DB.RwdProposalRefund
350345
, DB.rewardRestAmount = Generic.coinToDbLovelace (garDeposit refund)
351-
, DB.rewardRestEarnedEpoch = unEpochNo earnedEpoch
352346
, DB.rewardRestSpendableEpoch = unEpochNo spendableEpoch
353347
}
354348

@@ -367,7 +361,7 @@ insertPoolDepositRefunds ::
367361
Generic.Rewards ->
368362
ExceptT SyncNodeError (ReaderT SqlBackend m) ()
369363
insertPoolDepositRefunds syncEnv epochNo refunds = do
370-
insertRewards syncEnv epochNo epochNo (Map.toList rwds)
364+
insertRewards syncEnv epochNo (Map.toList rwds)
371365
liftIO . logInfo tracer $ "Inserted " <> show (Generic.rewardsCount refunds) <> " deposit refund rewards"
372366
where
373367
tracer = getTrace syncEnv

cardano-db-sync/src/Cardano/DbSync/Era/Universal/Insert/LedgerEvent.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ insertNewEpochLedgerEvents syncEnv currentEpochNo@(EpochNo curEpoch) =
8282
liftIO . logInfo tracer $ "Starting at epoch " <> textShow (unEpochNo en)
8383
LedgerDeltaRewards _e rwd -> do
8484
let rewards = Map.toList $ Generic.unRewards rwd
85-
insertRewards syncEnv (subFromCurrentEpoch 2) currentEpochNo (Map.toList $ Generic.unRewards rwd)
85+
insertRewards syncEnv currentEpochNo (Map.toList $ Generic.unRewards rwd)
8686
-- This event is only created when it's not empty, so we don't need to check for null here.
8787
liftIO . logInfo tracer $ "Inserted " <> show (length rewards) <> " Delta rewards"
8888
LedgerIncrementalRewards _ rwd -> do
8989
let rewards = Map.toList $ Generic.unRewards rwd
90-
insertRewards syncEnv (subFromCurrentEpoch 1) (EpochNo $ curEpoch + 1) rewards
90+
insertRewards syncEnv (EpochNo $ curEpoch + 1) rewards
9191
LedgerRestrainedRewards e rwd creds ->
9292
lift $ adjustEpochRewards syncEnv e rwd creds
9393
LedgerTotalRewards _e rwd ->
@@ -101,17 +101,17 @@ insertNewEpochLedgerEvents syncEnv currentEpochNo@(EpochNo curEpoch) =
101101
"Found " <> textShow (Set.size uncl) <> " unclaimed proposal refunds"
102102
updateDropped cache (EpochNo curEpoch) (garGovActionId <$> (dropped <> expired))
103103
let refunded = filter (\e -> Set.notMember (garGovActionId e) uncl) (enacted <> dropped <> expired)
104-
insertProposalRefunds syncEnv (subFromCurrentEpoch 1) currentEpochNo refunded -- TODO: check if they are disjoint to avoid double entries.
104+
insertProposalRefunds syncEnv currentEpochNo refunded -- TODO: check if they are disjoint to avoid double entries.
105105
forM_ enacted $ \gar -> do
106106
gaId <- resolveGovActionProposal cache (garGovActionId gar)
107107
lift $ void $ DB.updateGovActionEnacted gaId (unEpochNo currentEpochNo)
108108
whenJust (garMTreasury gar) $ \treasuryMap -> do
109109
let rewards = Map.mapKeys Ledger.raCredential $ Map.map (Set.singleton . mkTreasuryReward) treasuryMap
110-
insertRewardRests syncEnv (subFromCurrentEpoch 1) currentEpochNo (Map.toList rewards)
110+
insertRewardRests syncEnv currentEpochNo (Map.toList rewards)
111111
LedgerMirDist rwd -> do
112112
unless (Map.null rwd) $ do
113113
let rewards = Map.toList rwd
114-
insertRewardRests syncEnv (subFromCurrentEpoch 1) currentEpochNo rewards
114+
insertRewardRests syncEnv currentEpochNo rewards
115115
liftIO . logInfo tracer $ "Inserted " <> show (length rewards) <> " Mir rewards"
116116
LedgerPoolReap en drs ->
117117
unless (Map.null $ Generic.unRewards drs) $ do

cardano-db-sync/src/Cardano/DbSync/Ledger/Async.hs

Lines changed: 93 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,24 @@
22

33
module Cardano.DbSync.Ledger.Async where
44

5+
import Cardano.DbSync.Era.Shelley.Generic.Rewards as Generic
6+
import Cardano.DbSync.Ledger.Event
57
import Cardano.DbSync.Ledger.Types
6-
import Cardano.Ledger.BaseTypes (EpochNo)
8+
import Cardano.DbSync.Types
9+
import Cardano.Ledger.BaseTypes
710
import Cardano.Ledger.Crypto (StandardCrypto)
811
import qualified Cardano.Ledger.EpochBoundary as Ledger
12+
import qualified Cardano.Ledger.Rewards as Ledger
13+
import Cardano.Ledger.Shelley.RewardUpdate as Ledger
914
import Control.Concurrent.Class.MonadSTM.Strict
1015
import qualified Control.Concurrent.STM.TBQueue as TBQ
16+
import Control.Monad.Extra (whenJust)
17+
import Data.Map (Map)
18+
import Data.Set (Set)
19+
20+
--------------------------------------------------------------------------------
21+
-- EpochStake
22+
--------------------------------------------------------------------------------
1123

1224
newEpochStakeChannels :: IO EpochStakeChannels
1325
newEpochStakeChannels =
@@ -18,27 +30,94 @@ newEpochStakeChannels =
1830
<*> newTVarIO Nothing
1931

2032
-- To be used by the main thread
21-
ensureEpochDone :: EpochStakeChannels -> EpochNo -> Ledger.SnapShot StandardCrypto -> IO ()
22-
ensureEpochDone sQueue epoch snapshot = atomically $ do
23-
mLastEpochDone <- waitFinished sQueue
33+
ensureStakeDone :: EpochStakeChannels -> EpochNo -> Ledger.SnapShot StandardCrypto -> IO ()
34+
ensureStakeDone esc epoch snapshot = do
35+
mLastEpochDone <- atomically $ waitStakeFinished esc
2436
case mLastEpochDone of
25-
Just lastEpochDone | lastEpochDone == epoch -> pure ()
37+
Just lastEpochDone | lastEpochDone >= epoch -> pure ()
2638
_ -> do
2739
-- If last is not already there, put it to list and wait again
28-
writeEpochStakeAction sQueue epoch snapshot True
29-
retry
40+
atomically $ writeEpochStakeAction esc epoch snapshot True -- TODO: do outside STM
41+
_ <- atomically $ waitStakeFinished esc
42+
pure ()
3043

31-
-- To be used by the main thread
32-
waitFinished :: EpochStakeChannels -> STM IO (Maybe EpochNo)
33-
waitFinished sQueue = do
34-
stakeThreadState <- readTVar (epochResult sQueue)
44+
-- To be used by the main thread. Only blocks if it's 'Running', until it finishes.
45+
waitStakeFinished :: EpochStakeChannels -> STM IO (Maybe EpochNo)
46+
waitStakeFinished esc = do
47+
stakeThreadState <- readTVar (epochResult esc)
3548
case stakeThreadState of
3649
Just (lastEpoch, Done) -> pure $ Just lastEpoch -- Normal case
3750
Just (_, Running) -> retry -- Wait to finish current work.
3851
Nothing -> pure Nothing -- This will happen after a restart
3952

4053
-- To be used by the main thread
4154
writeEpochStakeAction :: EpochStakeChannels -> EpochNo -> Ledger.SnapShot StandardCrypto -> Bool -> STM IO ()
42-
writeEpochStakeAction sQueue epoch snapShot checkFirst = do
43-
TBQ.writeTBQueue (estakeQueue sQueue) $ EpochStakeDBAction epoch snapShot checkFirst
44-
writeTVar (epochResult sQueue) $ Just (epoch, Running)
55+
writeEpochStakeAction esc epoch snapShot checkFirst = do
56+
TBQ.writeTBQueue (estakeQueue esc) $ EpochStakeDBAction epoch snapShot checkFirst
57+
writeTVar (epochResult esc) $ Just (epoch, Running)
58+
59+
--------------------------------------------------------------------------------
60+
-- Rewards
61+
--------------------------------------------------------------------------------
62+
63+
newRewardsChannels :: IO RewardsChannels
64+
newRewardsChannels =
65+
RewardsChannels
66+
<$> TBQ.newTBQueueIO 5
67+
<*> newTVarIO Nothing
68+
69+
asyncWriteRewards :: HasLedgerEnv -> CardanoLedgerState -> EpochNo -> Bool -> [LedgerEvent] -> IO ()
70+
asyncWriteRewards env newState currentEpochNo isNewEpoch rewardEventsEB = do
71+
rewState <- atomically $ readTVar $ rewardsResult rc
72+
if isNewEpoch
73+
then do
74+
case rewState of
75+
Just (e', RewRunning) | e' == currentEpochNo -> do
76+
waitRewardUntil rc (e', RewDone)
77+
_ -> do
78+
ensureRewardsDone rc currentEpochNo (findTotal rewardEventsEB)
79+
waitEBRewardsAction rc currentEpochNo rewardEventsEB
80+
else do
81+
case rewState of
82+
Just (e', _) | e' >= currentEpochNo -> pure ()
83+
_ ->
84+
whenJust (Generic.getRewardsUpdate (getTopLevelconfigHasLedger env) (clsState newState)) $ \ru -> do
85+
atomically $ writeRewardsAction rc currentEpochNo False (Ledger.rs ru) -- (e-1) (e+1)
86+
where
87+
rc = leRewardsChans env
88+
89+
findTotal :: [LedgerEvent] -> Maybe (Map StakeCred (Set (Ledger.Reward StandardCrypto)))
90+
findTotal [] = Nothing
91+
findTotal (LedgerTotalRewards _ mp : _) = Just mp
92+
findTotal (_ : rest) = findTotal rest
93+
94+
-- To be used by the main thread
95+
ensureRewardsDone :: RewardsChannels -> EpochNo -> Maybe (Map StakeCred (Set (Ledger.Reward StandardCrypto))) -> IO ()
96+
ensureRewardsDone rc epoch mmp = do
97+
whenJust mmp $ \mp -> do
98+
atomically $ writeRewardsAction rc epoch True mp
99+
waitRewardUntil rc (epoch, RewDone)
100+
101+
waitEBRewardsAction :: RewardsChannels -> EpochNo -> [LedgerEvent] -> IO ()
102+
waitEBRewardsAction rc epoch les = do
103+
atomically $ do
104+
TBQ.writeTBQueue (rQueue rc) $ RewardsEpochBoundary epoch les
105+
writeTVar (rewardsResult rc) $ Just (epoch, RewEBRunning)
106+
waitRewardUntil rc (epoch, RewEBDone)
107+
108+
-- To be used by the main thread
109+
writeRewardsAction :: RewardsChannels -> EpochNo -> Bool -> Map StakeCred (Set (Ledger.Reward StandardCrypto)) -> STM IO ()
110+
writeRewardsAction rc epoch checkFirst mp = do
111+
TBQ.writeTBQueue (rQueue rc) $ RewardsDBAction epoch mp checkFirst
112+
writeTVar (rewardsResult rc) $ Just (epoch, RewRunning)
113+
114+
waitRewardUntil :: RewardsChannels -> (EpochNo, EpochRewardState) -> IO ()
115+
waitRewardUntil rc st = waitRewardUntilPred rc (== st)
116+
117+
-- blocks until the reward result satisfies a specific predicate.
118+
waitRewardUntilPred :: RewardsChannels -> ((EpochNo, EpochRewardState) -> Bool) -> IO ()
119+
waitRewardUntilPred rc prd = atomically $ do
120+
rewardsThreadState <- readTVar (rewardsResult rc)
121+
case rewardsThreadState of
122+
Just st | prd st -> pure ()
123+
_ -> retry

cardano-db-sync/src/Cardano/DbSync/Ledger/Event.hs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module Cardano.DbSync.Ledger.Event (
1919
convertPoolRewards,
2020
ledgerEventName,
2121
splitDeposits,
22+
splitRewardsEpochBoundary,
2223
) where
2324

2425
import Cardano.Db hiding (AdaPots, EpochNo, SyncState, TreasuryWithdrawals, epochNo)
@@ -465,3 +466,14 @@ splitDeposits les =
465466
case le of
466467
LedgerDeposits hsh coin -> Left (txHashFromSafe hsh, coin)
467468
_ -> Right le
469+
470+
splitRewardsEpochBoundary :: [LedgerEvent] -> ([LedgerEvent], [LedgerEvent])
471+
splitRewardsEpochBoundary les =
472+
partitionEithers $ eitherRewEB <$> les
473+
where
474+
eitherRewEB :: LedgerEvent -> Either LedgerEvent LedgerEvent
475+
eitherRewEB le = case le of
476+
LedgerDeltaRewards {} -> Left le
477+
LedgerRestrainedRewards {} -> Left le
478+
LedgerTotalRewards {} -> Left le
479+
_ -> Right le

cardano-db-sync/src/Cardano/DbSync/Ledger/State.hs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ module Cardano.DbSync.Ledger.State (
3232
hashToAnnotation,
3333
getHeaderHash,
3434
runLedgerStateWriteThread,
35-
getSliceMeta,
3635
findProposedCommittee,
3736
) where
3837

@@ -176,6 +175,7 @@ mkHasLedgerEnv trce protoInfo dir nw systemStart syncOptions = do
176175
intervar <- newTVarIO Strict.Nothing
177176
swQueue <- newTBQueueIO 5 -- Should be relatively shallow.
178177
stakeChans <- newEpochStakeChannels
178+
rewardsChans <- newRewardsChannels
179179
applyQueue <- newTBQueueIO 10
180180
pure
181181
HasLedgerEnv
@@ -194,6 +194,7 @@ mkHasLedgerEnv trce protoInfo dir nw systemStart syncOptions = do
194194
, leStateWriteQueue = swQueue
195195
, leApplyQueue = applyQueue
196196
, leEpochStakeChans = stakeChans
197+
, leRewardsChans = rewardsChans
197198
}
198199

199200
initCardanoLedgerState :: Consensus.ProtocolInfo CardanoBlock -> CardanoLedgerState
@@ -203,9 +204,6 @@ initCardanoLedgerState pInfo =
203204
, clsEpochBlockNo = GenesisEpochBlockNo
204205
}
205206

206-
getTopLevelconfigHasLedger :: HasLedgerEnv -> TopLevelConfig CardanoBlock
207-
getTopLevelconfigHasLedger = Consensus.pInfoConfig . leProtocolInfo
208-
209207
readCurrentStateUnsafe :: HasLedgerEnv -> IO (ExtLedgerState CardanoBlock)
210208
readCurrentStateUnsafe hle = atomically (clsState . ledgerDbCurrent <$> readStateUnsafe hle)
211209

@@ -234,13 +232,15 @@ applyBlock env blk = do
234232
let oldState = ledgerDbCurrent ledgerDB
235233
!result <- throwLeftIO $ tickThenReapplyCheckHash (ExtLedgerCfg (getTopLevelconfigHasLedger env)) blk (clsState oldState)
236234
let ledgerEventsFull = mapMaybe (convertAuxLedgerEvent (leHasRewards env)) (lrEvents result)
237-
let (ledgerEvents, deposits) = splitDeposits ledgerEventsFull
235+
let (ledgerEvents', deposits) = splitDeposits ledgerEventsFull
236+
let (rewardsEpochBoundary, ledgerEvents) = splitRewardsEpochBoundary ledgerEvents'
238237
let !newLedgerState = finaliseDrepDistr (lrResult result)
239238
!details <- atomically $ getSlotDetails env (ledgerState newLedgerState) time (cardanoBlockSlotNo blk)
240239
!newEpoch <- throwLeftIO $ mkOnNewEpoch (clsState oldState) newLedgerState (findAdaPots ledgerEvents)
241240
let !newEpochBlockNo = applyToEpochBlockNo (isJust $ blockIsEBB blk) (isJust newEpoch) (clsEpochBlockNo oldState)
242241
let !newState = CardanoLedgerState newLedgerState newEpochBlockNo
243242
asyncWriteStakeSnapShot env oldState newState
243+
asyncWriteRewards env newState (sdEpochNo details) (isJust newEpoch) rewardsEpochBoundary
244244
let !ledgerDB' = pushLedgerDB ledgerDB newState
245245
atomically $ writeTVar (leStateVar env) (Strict.Just ledgerDB')
246246
let !appResult =
@@ -321,13 +321,9 @@ asyncWriteStakeSnapShot env oldState newState =
321321
EpochBlockNo n
322322
| n == 0
323323
, Just (snapshot, epoch) <- Generic.getSnapShot (clsState oldState) -> do
324-
ensureEpochDone (leEpochStakeChans env) epoch snapshot
324+
ensureStakeDone (leEpochStakeChans env) epoch snapshot
325325
_ -> pure ()
326326

327-
getSliceMeta :: Generic.StakeSliceRes -> Maybe (Bool, EpochNo)
328-
getSliceMeta (Generic.Slice (Generic.StakeSlice epochNo _) isFinal) = Just (isFinal, epochNo)
329-
getSliceMeta _ = Nothing
330-
331327
storeSnapshotAndCleanupMaybe ::
332328
HasLedgerEnv ->
333329
CardanoLedgerState ->

0 commit comments

Comments
 (0)