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

Upgradeable families #3596

Merged
merged 6 commits into from
Aug 9, 2023
Merged

Upgradeable families #3596

merged 6 commits into from
Aug 9, 2023

Conversation

lehins
Copy link
Contributor

@lehins lehins commented Aug 1, 2023

Description

Take care of part of #3618

Adds upgradeTxOut, upgradeTxAuxData, upgradeScript and upgradeTxCert as well as:

  • Creates a test suite to each cardano-ledger-[era] package that didn't have one. See Consolidate all cardano-ledger-[era]-test package #3623 for more info on a long goal with respect to test suites.
  • Add a test for each of the four type families that checks upgrading matches translation through CBOR.
  • Add eraName that can be used in any place where textual representation of an era is needed (this can subsume similar functionality from consensus)
  • Add ToExpr instances for more types. Needed for testing.
  • For consistency moves EraTxAuxData instances into their own modules for Babbage and Conway

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 force-pushed the lehins/upgradeable-families branch 2 times, most recently from bff478b to b4f0b7b Compare August 4, 2023 18:06
@lehins lehins mentioned this pull request Aug 8, 2023
7 tasks
@lehins lehins requested a review from nc6 August 8, 2023 11:12
@lehins lehins force-pushed the lehins/upgradeable-families branch from b4f0b7b to 77bf5fd Compare August 8, 2023 20:26
@lehins lehins marked this pull request as ready for review August 8, 2023 22:55
@lehins lehins force-pushed the lehins/upgradeable-families branch from 77bf5fd to f2a204d Compare August 8, 2023 23:10
Copy link
Contributor

@nc6 nc6 left a comment

Choose a reason for hiding this comment

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

LGTM, have left a few comments requesting mostly clarification

@lehins lehins force-pushed the lehins/upgradeable-families branch 2 times, most recently from ec0711d to f1659cd Compare August 9, 2023 14:02
Consensus already defines a similar function. There is no need for it to
live there especially since it can be used in other downstream
applications and testing
The idea behind tests is to serialize a type in the previous era and
deserialize it in the current era, while checking that upgrading
functionality produces the same result.

Noteable type family that does not translate through serialization is
the Script on the Allegra/Alonzo boundary, hence it is treated
specially in tests.
* Upgrade of TxCerts can fail on Babbage/Conway boundary, hence slightly
  different interface than other upgrade functions.
* Includes upgradeability test for TxCert
@lehins lehins force-pushed the lehins/upgradeable-families branch from f1659cd to c43a997 Compare August 9, 2023 17:09
@lehins lehins enabled auto-merge August 9, 2023 17:09
@lehins lehins merged commit e928d40 into master Aug 9, 2023
9 checks passed
@iohk-bors iohk-bors bot deleted the lehins/upgradeable-families branch August 9, 2023 19:14
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.

None yet

2 participants