Skip to content

Remove ConwayNewEpochPredFailure #5007

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
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aniketd
Copy link
Contributor

@aniketd aniketd commented Apr 23, 2025

Description

Closes #4662

Checklist

  • Commits in meaningful sequence and with useful messages.
  • Tests added or updated when needed.
  • CHANGELOG.md files updated for packages with externally visible changes.
    NOTE: New section is never added with the code changes. (See RELEASING.md).
  • Versions updated in .cabal and CHANGELOG.md files when necessary, according to the
    versioning process.
  • Version bounds in .cabal files updated when necessary.
    NOTE: If bounds change in a cabal file, that package itself must have a version increase. (See RELEASING.md).
  • Code formatted (use scripts/fourmolize.sh).
  • Cabal files formatted (use scripts/cabal-format.sh).
  • CDDL files are up to date (use scripts/gen-cddl.sh)
  • hie.yaml updated (use scripts/gen-hie.sh).
  • Self-reviewed the diff.

@aniketd aniketd requested a review from a team as a code owner April 23, 2025 14:56
@aniketd aniketd force-pushed the aniketd/remove-conwaynewepochpredfailure branch from 697448d to e1e3b92 Compare April 23, 2025 15:00
@@ -214,9 +200,7 @@ updateRewards ::
EpochNo ->
RewardUpdate ->
Rule (ConwayNEWEPOCH era) 'Transition (EpochState era)
updateRewards es e ru'@(RewardUpdate dt dr rs_ df _) = do
let totRs = sumRewards (es ^. prevPParamsEpochStateL . ppProtocolVersionL) rs_
Val.isZero (dt <> dr <> toDeltaCoin totRs <> df) ?! CorruptRewardUpdate ru'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lehins this is the location where it was checked, just FYI.

@@ -1273,7 +1272,7 @@ ppNEWEPOCH Allegra x = ppShelleyNewEpochPredicateFailure x
ppNEWEPOCH Mary x = ppShelleyNewEpochPredicateFailure x
ppNEWEPOCH Alonzo x = ppShelleyNewEpochPredicateFailure x
ppNEWEPOCH Babbage x = ppShelleyNewEpochPredicateFailure x
ppNEWEPOCH Conway x = ppConwayNewEpochPredFailure x
ppNEWEPOCH Conway _ = ppString "PredicateFailure (ConwayNEWEPOCH era) = Void, and can never Fail"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ppNEWEPOCH Conway _ = ppString "PredicateFailure (ConwayNEWEPOCH era) = Void, and can never Fail"
ppNEWEPOCH Conway x = absurd x

@Soupstraw
Copy link
Contributor

Soupstraw commented Apr 24, 2025

I guess you can turn that check into an assertion, that way we'll be able to notice if something's wrong with the reward update in one of our tests. It seems like too expensive of a check to keep it in the production version of ledger and run it every epoch boundary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove ConwayNewEpochPredFailure
2 participants