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

Use aiken for commit validator #1680

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open

Use aiken for commit validator #1680

wants to merge 37 commits into from

Conversation

ch1bo
Copy link
Collaborator

@ch1bo ch1bo commented Oct 4, 2024

We want to update to a recent cardano-api version to get #1543 (which we contributed upstream). This update implied a bump on plutus-tx (via the ledger) and resulted in growing script sizes. At that point we explored various ways to decrease the script size again to keep the single transaction publishing and --hydra-scripts-tx-id config (or even expanding that).

This mikado / dependency graph shows our option and the chosen path of this PR:

ADRs _ Designs - cardano-api 9 3 update mikado 2024-10-03

Concretely this PR contains:

TODO:

  • Make mutation tests pass (missing traces)
  • Address FIXMEs in testing
  • Benchmark and set maximumNumberOfParties accordingly
  • CHANGELOG updated
  • Documentation update not needed
  • Haddocks updated
  • New TODOs introduced
    • One as a reminder that we have duplication of types between aiken/haskell

locallycompact and others added 30 commits October 2, 2024 14:37
We intend to create one of the hydra-plutus scripts with aiken.
This separates the aiken build, which yields the plutus.json blueprint
and the haskell build which provides access to the compiled validators.
Instead of using the plutus-tx "compiledScript", we use the
loaded-from-blueprint aiken script in the init validator and when
constructing/observing transactions in the hydra-node.
This is not yet working and it does not correctly detect changes to plutus.json
Plutus-tx seems to be encoding tuples as a Constr on-chain.
Also add TODO comments for things that are missing to be removed.
By regenerating the plutus.json file using -k flag during aiken build.
This removes the need of using aiken/builtin function decode_utf8,
providing some small optimization.

Also recreated plutus scripts.
Also removed its golden spec.

Finally added a note about a fragility being present while accessing
the commit validator script from the blueprintJSON.
Seems like the aiken compiler uses plutus core version 1.1.0 syntax and
we need to declare it as a PlutusV3 script.
ch1bo and others added 3 commits October 4, 2024 15:03
We do not need the plutus-style envelope and this would not match with
the PlutusV2 used there.
This will keep the first trace argument which we expect to see in our
mutation tests.
locallycompact and others added 2 commits October 4, 2024 16:11
This does not require us to be in a git repository and hence makes the
test more flexible and isolated.
The hydra-plutus library seems to be consistently rebuilt when the
plutus.json gets changed.
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.

6 participants