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

STS tests based on constraints #3728

Merged
merged 1 commit into from
Sep 21, 2023
Merged

Conversation

MaximilianAlgehed
Copy link
Collaborator

Description

This PR introduces the test setup for testing STS rules using the constraint library. It's a WIP effort but we have a running test for a simple STS rule: GOVCERT.

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

Copy link
Collaborator

@lehins lehins left a comment

Choose a reason for hiding this comment

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

That's a good start with STS. Only minor changes are needed.

eras/conway/impl/cardano-ledger-conway.cabal Outdated Show resolved Hide resolved
libs/cardano-ledger-test/cardano-ledger-test.cabal Outdated Show resolved Hide resolved
libs/cardano-ledger-test/src/Test/Cardano/Ledger/STS.hs Outdated Show resolved Hide resolved
libs/cardano-ledger-test/src/Test/Cardano/Ledger/STS.hs Outdated Show resolved Hide resolved
libs/cardano-ledger-test/src/Test/Cardano/Ledger/STS.hs Outdated Show resolved Hide resolved
@MaximilianAlgehed MaximilianAlgehed force-pushed the PR-STS-tests branch 2 times, most recently from de6f536 to f2dbc9b Compare September 17, 2023 19:52
@MaximilianAlgehed
Copy link
Collaborator Author

@lehins I think this should be ready to merge

Copy link
Contributor

@TimSheard TimSheard left a comment

Choose a reason for hiding this comment

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

The goal of this PR is to prototype the use of the shrinking capabilities by testing that a rules maintain the constraints we used to generates a 'legitimate' state. We should add another rule, as suggested in the comments, where there are some real constraints. This way we get a better test of the capabilities.

Personally, I'd like to better understand how we shrink an environment using the constraints

libs/cardano-ledger-test/src/Test/Cardano/Ledger/STS.hs Outdated Show resolved Hide resolved
libs/cardano-ledger-test/src/Test/Cardano/Ledger/STS.hs Outdated Show resolved Hide resolved
libs/cardano-ledger-test/src/Test/Cardano/Ledger/STS.hs Outdated Show resolved Hide resolved
Copy link
Collaborator

@lehins lehins left a comment

Choose a reason for hiding this comment

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

👍 Thank you

@MaximilianAlgehed
Copy link
Collaborator Author

@TimSheard I think I've addressed your comments

@MaximilianAlgehed
Copy link
Collaborator Author

@lehins I added the POOL and DELEG rules here too. It might be worth while to merge this soon to avoid things changing beneath our feet.

@MaximilianAlgehed MaximilianAlgehed force-pushed the PR-STS-tests branch 5 times, most recently from 1e5f722 to ed74728 Compare September 21, 2023 11:30
@lehins lehins merged commit 15ccf21 into IntersectMBO:master Sep 21, 2023
@MaximilianAlgehed MaximilianAlgehed deleted the PR-STS-tests branch September 21, 2023 16:52
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.

3 participants