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

Conway and other eras roundtrip tests #3726

Merged
merged 5 commits into from
Sep 13, 2023

Conversation

lehins
Copy link
Collaborator

@lehins lehins commented Sep 12, 2023

Description

This PR organizes CBOR RoundTrip tests into a nice hierarchy

It captures all of the Conway types and most of the types from other eras, but not all of them. Fixes: #3158

One important one is still missing is CBOR RoundTrip tests for PredicateFailures, but we can take care of it as a separate task.

Besides tests there other notable changes:

  • Fix roundtrip serialization for ProposalsSnapshot
  • Improve ToJSON/FromJSON implementation of Credential
  • Improvements to RoundTrip tests failure reporting, namely addition of diffing for re-serialization testing

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/add-ledger-state-roundtrip-tests branch from a503388 to 3932c4c Compare September 12, 2023 00:59
@lehins
Copy link
Collaborator Author

lehins commented Sep 12, 2023

Still needs a changeklog update and git history cleanup, but other than that is ready for review.

@lehins lehins force-pushed the lehins/add-ledger-state-roundtrip-tests branch 2 times, most recently from 39e275f to 940ffa1 Compare September 12, 2023 14:49
@lehins lehins force-pushed the lehins/add-ledger-state-roundtrip-tests branch 3 times, most recently from 6686cd0 to 7e6f8b7 Compare September 12, 2023 19:11
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.

Great to have a systematic way of doing these roundtrip tests.

I don't understand well the part about the Sharing, but maybe one Watercooler we could go briefly over it, if we have time .

Looks good to me

…redential`:

* use `keyHash` vs `key hash`/`keyhash`
* use `scriptHash` vs `script hash`/`scripthash`

Variants with space and without space are still parseable for backwards
compatibility
Generating nested data structures like Maps within Maps is prohbitively expensive.
In Alonzo we have CostModels present in PParams, which results in too
much data being generated for `ProposedPPUpdates`.
* Structure CBOR RoundTrip tests in reusable manner from era to era

* Improve roundtrip failure reporting

* Arbitrary for DRepDistr
@lehins lehins force-pushed the lehins/add-ledger-state-roundtrip-tests branch from 7e6f8b7 to 33ecc2a Compare September 13, 2023 13:26
@lehins lehins enabled auto-merge September 13, 2023 13:26
@lehins lehins merged commit 03bad4b into master Sep 13, 2023
@iohk-bors iohk-bors bot deleted the lehins/add-ledger-state-roundtrip-tests branch September 13, 2023 18:45
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.

Conway serialization tests
3 participants