Skip to content

Add a test that check TICKF and TICK produce the same LedgerView #5047

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lehins opened this issue May 15, 2025 · 0 comments
Open

Add a test that check TICKF and TICK produce the same LedgerView #5047

lehins opened this issue May 15, 2025 · 0 comments
Labels
constraint-generators Relevant tasks to constraint-generators library or its usage in ledger 🕵️ testing

Comments

@lehins
Copy link
Collaborator

lehins commented May 15, 2025

We had a similar test:

-- | This property test checks the correctness of the TICKF transation.
-- TICKF is used by the consensus layer to get a ledger view in a computationally
-- cheaper way than using the TICK rule.
-- Therefore TICKF and TICK need to compute the same ledger view.
propTickfPerservesLedgerView :: NewEpochState ShelleyEra -> Property
propTickfPerservesLedgerView nes =
  let (EpochNo e) = nesEL nes
      slot = slotFromEpoch (EpochNo $ e + 1)
      nes' = setDepositsToObligation (filterEmptyRewards nes)
      tickNes = runShelleyBase $ applySTSTest @(ShelleyTICK ShelleyEra) (TRC ((), nes', slot))
      tickFNes = runShelleyBase $ applySTSTest @(ShelleyTICKF ShelleyEra) (TRC ((), nes', slot))
   in fromMaybe discard $ do
        Right tickNes' <- pure tickNes
        Right tickFNes' <- pure tickFNes
        pure $ currentLedgerView tickNes' === currentLedgerView tickFNes'

which was removed in #5007, due to triggering assertions introduced in the same PR.

The goal of this ticket is to bring back the same kind of test that runs for all eras, not just Shelley, but also with a reasonable NewEpochState that is actually valid. Likely through the utilization of constraint generators.

@lehins lehins added 🕵️ testing constraint-generators Relevant tasks to constraint-generators library or its usage in ledger labels May 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
constraint-generators Relevant tasks to constraint-generators library or its usage in ledger 🕵️ testing
Projects
None yet
Development

No branches or pull requests

1 participant