Skip to content

Commit d108a4d

Browse files
kdermech1bo
authored andcommitted
Preserve ratify results across the Dijkstra translation
Starting from def dropped enacted, expired and delayed actions, losing the removal, deposit refund and event for actions enacting at the era boundary.
1 parent 245e63d commit d108a4d

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

eras/dijkstra/impl/src/Cardano/Ledger/Dijkstra/Translation.hs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,15 @@ instance TranslateEra DijkstraEra (Tx TopTx) where
7575
instance TranslateEra DijkstraEra NewEpochState where
7676
translateEra ctxt nes = do
7777
let es = translateEra' ctxt $ nesEs nes
78-
-- We need to ensure that we have the same initial EnactState in the pulser as
79-
-- well as in the current EnactState, otherwise in the very first EPOCH rule call
80-
-- the pulser will reset it.
78+
-- Carry over the translated pulser's ratify state, overriding only its
79+
-- EnactState so the first EPOCH rule sees a consistent one. Starting from
80+
-- `def` instead would drop rsEnacted/rsExpired/rsDelayed, silently losing
81+
-- the enactment (removal, deposit refund, GovInfoEvent) of any action due
82+
-- to enact at the era boundary.
83+
(_, carriedRatifyState) =
84+
finishDRepPulser (cgsDRepPulsingState (es ^. epochStateGovStateL))
8185
ratifyState =
82-
def
86+
carriedRatifyState
8387
& rsEnactStateL .~ mkEnactState (es ^. epochStateGovStateL)
8488
pure $
8589
NewEpochState

0 commit comments

Comments
 (0)