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

Bring Plutus language version to the type level #3899

Merged
merged 8 commits into from
Dec 12, 2023

Conversation

lehins
Copy link
Collaborator

@lehins lehins commented Nov 30, 2023

Description

Fixes #3849 and #3406

Other improvements:

  • Instead of accepting UTxO the validation function ppViewHashesMatch now accepts ScriptsProvided and remove the no longer needed languages function. This approach avoids duplicate computation of ScritpsProvided, which was done in the languages function.

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 changed the title Lehins/plutus language to type level Plutus language to type level Nov 30, 2023
@lehins lehins force-pushed the lehins/plutus-language-to-type-level branch 6 times, most recently from 88ccc10 to 616166e Compare December 7, 2023 17:44
@lehins lehins changed the title Plutus language to type level Bring Plutus language version to the type level Dec 7, 2023
@lehins lehins force-pushed the lehins/plutus-language-to-type-level branch from 33521d9 to ce6d42b Compare December 7, 2023 21:11
@lehins lehins marked this pull request as ready for review December 7, 2023 21:11
@lehins lehins force-pushed the lehins/plutus-language-to-type-level branch from ce6d42b to 7ab1a2b Compare December 8, 2023 00:23
@lehins lehins force-pushed the lehins/plutus-language-to-type-level branch 2 times, most recently from c108aaa to ef9fc1e Compare December 8, 2023 23:13
Copy link
Contributor

@Soupstraw Soupstraw left a comment

Choose a reason for hiding this comment

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

Looks great so far. I'll finish the rest of the review tomorrow. Some of the comments I wrote down for myself as notes, so feel free to ignore them for now.

@lehins lehins force-pushed the lehins/plutus-language-to-type-level branch 3 times, most recently from 875aab9 to e34b840 Compare December 11, 2023 20:04
@lehins lehins requested a review from Soupstraw December 11, 2023 20:33
@lehins
Copy link
Collaborator Author

lehins commented Dec 11, 2023

@Soupstraw I've addressed all of your comments.

@lehins lehins force-pushed the lehins/plutus-language-to-type-level branch from b55cc2e to 91f4f22 Compare December 12, 2023 01:07
This is a major change to how we represent Plutus Scripts. This affects
how we collect and evaluate plutus scripts. There is now a unified
interface for all plutus versions and incorrect usage of an unsupported
plutus version in all eras is prevented by the type system.

Translation of PlutusContext has also been overhauled. There is still
quite a bit duplication happens with TxInfo translation, but this will
be taken care of by a subsequent commit.
* `Cardano.Ledger.Alonzo.Plutus.Context`
@lehins lehins force-pushed the lehins/plutus-language-to-type-level branch from 91f4f22 to 5bb3488 Compare December 12, 2023 01:33
Copy link
Contributor

@Soupstraw Soupstraw 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 a huge improvement. LGTM overall, but I'm sure I didn't catch everything because it's such a massive PR with lots of moving parts.

@lehins lehins force-pushed the lehins/plutus-language-to-type-level branch from 3494c1e to 7d28d69 Compare December 12, 2023 16:11
* Reduce a whole lot of duplication in TxInfo translation
* Changelog entries for all of the changes in #3889
Fix this mistake of exporting the `CostModel` constructor, which was introduced
in #3893.
@lehins lehins force-pushed the lehins/plutus-language-to-type-level branch from 7d28d69 to fa4ad77 Compare December 12, 2023 16:16
@lehins lehins enabled auto-merge December 12, 2023 16:27
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.

Epic!
The relationship between everything involved needed to execute the scripts is now so clear, as is, supporting a new Plutus Version, and/or Era.
I'm in an awe of this work! 🙇

@lehins lehins merged commit 0765d32 into master Dec 12, 2023
10 of 27 checks passed
@iohk-bors iohk-bors bot deleted the lehins/plutus-language-to-type-level branch December 12, 2023 19:08
@lehins
Copy link
Collaborator Author

lehins commented Dec 12, 2023

@Soupstraw and @teodanciu Thank you for reviewing this PR! I know it was not a small task.

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.

Bring Plutus language version to the type level
3 participants