Skip to content

Commit

Permalink
Force the evaluation of the mark snapshot
Browse files Browse the repository at this point in the history
in the TICK rule.
  • Loading branch information
Jared Corduan authored and nfrisby committed Apr 17, 2021
1 parent cd1e3da commit 1a94139
Showing 1 changed file with 8 additions and 0 deletions.
@@ -1,3 +1,4 @@
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
Expand Down Expand Up @@ -32,6 +33,7 @@ import qualified Data.Map.Strict as Map
import GHC.Generics (Generic)
import NoThunks.Class (NoThunks (..))
import Shelley.Spec.Ledger.BaseTypes (ShelleyBase, StrictMaybe (..), epochInfo)
import Shelley.Spec.Ledger.EpochBoundary (SnapShots (_pstakeMark))
import Shelley.Spec.Ledger.Keys (GenDelegs (..))
import Shelley.Spec.Ledger.LedgerState (DPState (..), DState (..), EpochState (..), FutureGenDeleg (..), LedgerState (..), NewEpochState (..), PulsingRewUpdate)
import Shelley.Spec.Ledger.STS.NewEpoch (NEWEPOCH, NewEpochPredicateFailure)
Expand Down Expand Up @@ -168,6 +170,12 @@ bheadTransition = do

nes' <- validatingTickTransition @TICK nes slot

-- Here we force the evaluation of the mark snapshot.
-- We do NOT force it in the TICKF and TICKN rule
-- so that it can remain a thunk when the consensus
-- layer computes the ledger view across the epoch boundary.
let !_ = _pstakeMark . esSnapshots . nesEs $ nes'

ru'' <-
trans @(Core.EraRule "RUPD" era) $
TRC (RupdEnv bprev es, nesRu nes', slot)
Expand Down

0 comments on commit 1a94139

Please sign in to comment.