Skip to content
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

Fix pvCanFollow usage in Conway and improve clarity in Shelley #3902

Merged
merged 2 commits into from
Dec 5, 2023

Conversation

lehins
Copy link
Collaborator

@lehins lehins commented Nov 30, 2023

Description

Fix wrong usage of pvCanFollow in Conway: fix #3901 and fix #3873
This problem happened because there was no documentation on pvCanFollow and names for bindings where totally useless. This proves my belief even further that ticks are not very useful for bindings.

Besides the bug fix this PR also includes:

  • Make pvCanFollow match the spec and remove the SNothing wrapper
    around the newly proposed ProtVer
  • Reduce duplication by adding hasLegalProtVerUpdate
  • Add helper functions failOnJust, failOnNonEmpty, failureOnJust,
    failureOnNonEmpty to small-steps, which allow us to lazily get the
    offending value, without forcing the validation, when validation is
    turned off.
    cardano-ledger-alonzo-test-1.1.2.8 has not been released yet, so the
    version bump in Change 4 PParam fields from EpochNo to EpochInterval #3876 was incorrect

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated
  • When applicable, versions are updated in .cabal and CHANGELOG.md files according to the
    versioning process.
  • The version bounds in .cabal files for all affected packages are updated. If you change the bounds in a cabal file, that package itself must have a version increase. (See RELEASING.md)
  • All visible changes are prepended to the latest section of a CHANGELOG.md for the affected packages. New section is never added with the code changes. (See RELEASING.md)
  • Code is formatted with fourmolu (use scripts/fourmolize.sh)
  • Cabal files are formatted (use scripts/cabal-format.sh)
  • hie.yaml has been updated (use scripts/gen-hie.sh)
  • Self-reviewed the diff

@lehins lehins requested a review from TimSheard November 30, 2023 16:10
Copy link
Contributor

@teodanciu teodanciu left a comment

Choose a reason for hiding this comment

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

This is great, I love that the dangerous parts (which hold the risk of getting the arguments reversed) are contained in the higher level hasLegalProtVerUpdate and legalProtVer

Looks good to me.

@lehins lehins force-pushed the lehins/fix-pvCanFollow branch from f0fdea1 to f85386d Compare December 5, 2023 09:29
@lehins lehins enabled auto-merge December 5, 2023 09:32
* Make `pvCanFollow` match the spec and remove the `Nothing` wrapper
  around the newly proposed `ProtVer`
* Reduce duplication by adding `hasLegalProtVerUpdate`
* Add helper functions `failOnJust`, `failOnNonEmpty`, `failureOnJust`,
  `failureOnNonEmpty` to `small-steps`, which allow us to lazily get the
  offending value, without forcing the validation, when validation is
  turned off.
`cardano-ledger-alonzo-test-1.1.2.8` has not been released yet, so the
version bump in #3876 was incorrect
@lehins lehins force-pushed the lehins/fix-pvCanFollow branch from f85386d to 2fd4e18 Compare December 5, 2023 11:48
@lehins lehins merged commit 194cbe5 into master Dec 5, 2023
9 of 26 checks passed
@iohk-bors iohk-bors bot deleted the lehins/fix-pvCanFollow branch December 5, 2023 13:44
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.

pvCanFollow bug Protect against invalid versions in HardForkInitiation
4 participants