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

CIP-33 Reference Scripts #995

Closed
45 tasks done
dorin100 opened this issue Mar 29, 2022 · 3 comments
Closed
45 tasks done

CIP-33 Reference Scripts #995

dorin100 opened this issue Mar 29, 2022 · 3 comments

Comments

@dorin100
Copy link
Collaborator

dorin100 commented Mar 29, 2022

cardano-node related PR:
#3810

info
https://github.com/cardano-foundation/CIPs/tree/master/CIP-0033
IntersectMBO/cardano-node#3766 (comment)

AC1 Possible to reference a script

  1. Spend a Plutus utxo which contains a reference script
    • using build
    • using build-raw
  2. Invoke/reference multiple scripts in the same transaction
    • using build
    • using build-raw
  3. Mix of attached and reference scripts in a single valid transaction
    • using build
    • using build-raw
  4. Use both the reference script and datum at the same utxo input
    • using build
    • using build-raw
  5. Reference the same output with the same script multiple times in a single transaction
    • using build
    • using build-raw
  6. Reference several instances of the same script at different outputs in a single transaction
    • using build
    • using build-raw
  7. Use a reference script in order to authorize a Plutus locked delegation cert/minting policy/withdrawal check cardano-node PR #4034
    • using build
    • using build-raw
  8. Reference something that is not a script (or script that is not well-formed) - Expect failure
    • using build
    • using build-raw
  9. Reference one valid script and one invalid - Expect failure
    • using build
    • using build-raw

AC2 Fee and collateral are cheaper when using a reference script

  1. Submit a transaction with an attached script, submit an equal transaction with the script referenced, and compare the fees and collaterals.

    • using build
    • using build-raw
  2. check that the cost for a transaction with reference scripts is respecting the cost model

    • using build
    • using build-raw
  3. check that the cost for a transaction with reference scripts, referenced datums, referenced inputs and collaterals is respecting the cost model

    • using build
    • using build-raw
  4. check that consuming/spending an utxo with referenced reference scripts, referenced datums, referenced inputs will make those data not available anymore and the full ADA amount from the initial utxo is correctly transferred

    • using build
    • using build-raw
  5. check the minAdaRequired and execution units for different scenarios - transactions with reference scripts, reference datums, reference inputs, Plutus, script + combinations between them:

    • ADA only
    • ADA + tokens
    • ADA + datum
    • ADA + inline datum
    • ADA + tokens + datum
    • ADA + tokens + inline datum
    • ADA + reference script
    • ADA + tokens + reference script
    • ADA + datum + reference script
    • ADA + inline datum + reference script
    • ADA + tokens + datum + reference script
    • ADA + tokens + inline datum + reference script
  • check execution units for different scenarios - transactions with reference scripts, reference datums, reference inputs, Plutus, script + combinations between them

AC3 Scripts with old versions cannot use reference scripts, attempting to do so will be a phase 1 transaction validation failure.

  1. spend an old version script in a transaction that includes a reference script - Expect Failure
    • using build
    • using build-raw
  2. spend an utxo in the same transaction with a Plutus V1 / V2 reference script (referencing a script should not have any effect on spending an unrelated utxo)
    • using build
    • using build-raw

try attaching and referencing the same script in a single valid transaction. Should run validation twice for each input? Check that txOutReferenceScript is correct.
a tx with a Plutus script which is both needed and supplied in two ways: 1) via reference script, 2) in the script witnesses

  • AC4 memUnits and cpuUnits

AC5 run a Plutus script validating that the correct script hash is attached to the input
#1261

AC7 simple scripts

  • reference simple (not Plutus) scripts
@dorin100 dorin100 changed the title CIP-33 Reference Scripts CIP-33 Reference Scripts - draft Mar 29, 2022
@catch-21
Copy link
Contributor

catch-21 commented Apr 14, 2022

We should also have a test that runs a plutus script validating that the correct script hash is attached to input, see tx output reference script

@saratomaz

This comment was marked as duplicate.

@dorin100 dorin100 changed the title CIP-33 Reference Scripts - draft CIP-33 Reference Scripts May 3, 2022
@dorin100 dorin100 mentioned this issue May 4, 2022
21 tasks
@vfrsilva
Copy link

vfrsilva commented May 4, 2022

@dorin100 I see we can still test the following:

  1. When UTxO has enough to store the script
  2. When UTxO doesn't have enough to store the script
    a. Error message OK?
  3. When Script size is bigger than TX size
    a. Error message OK?
  4. When the script is invalid
    a. Error message OK?
  5. Test if the real cost to store the script is the same that CLI reports

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants