cardano-node-tests
cardano-node-tests copied to clipboard
Vasil HF PlutusV2 Tests
This is a checklist for testing for Vasil HF with a focus on Plutus V2 functionality. We can break these points out to automate regression tests.
Acceptance Criteria
- https://input-output.atlassian.net/browse/CAD-4449
- https://input-output.atlassian.net/wiki/spaces/NODE/pages/3411509359/Vasil+HF+Acceptance+Criteria+ACs+and+Definition+of+Done+DoD
Out of scope
- Anything to do with testing hte HFC event is covered by SPOs and regression tests
-
serialiseData
covered by Hydra Team - VRF covered by SPOs and regression tests
- Anything to do with protocol update proposals should be covered by regression tests
CIP-0031 Reference Inputs
- [x] Plutus correctly observes everything available in an Alonzo txout (created pre-Vasil): value, tokens, datum hash.
- [x] Try referencing same input multiple times for single transaction (no duplicates should arise in TxInfo)
- [x] Try referencing spent outputs - raised https://github.com/input-output-hk/cardano-node/issues/4012
- [x] Try referencing an output that is also a regular input of the same transaction (is there conflict and does cli option order affect the outcome). I expect no conflict and TxInfo should have the txo as both both a regular and reference input.
- [x] Confirm that the spending conditions on referenced outputs are not checked
- [x] Confirm that reference input cannot be at Byron address - error is
ByronTxOutInContext
- [ ] Byron addresses are not allowed to be in PlutusV2 ScriptContext
- [ ] Large number of reference inputs can be seen in script context
- [ ]
transaction view
shows correct reference input details - [ ] cli includes fee in calculation for additional reference inputs
- [ ] (AC) Two different transactions can fetch the same reference input in the same block.
CIP-0032 Inline datums (quotes are from cip spec)
- [x] Can spend output with inline datum attached and this removes it from ledger state
- [x] Is invalid to include datum as both witness and input (ledger error is
NonOutputSupplimentaryDatums
)- [x] Also try as embedded/optional datum (shouldn't be invalid to combine with inline datum)
- [x] Try attaching datum that is not valid or well-formed script data
- [x] Try referencing two outputs that both hold the exact same datum (TxInfo should behave correctly)
- [x] Is there a way to break CLI displaying large attached datum (try multiple utxos with large or deeply nested json) - Doesn't seem to break but things start looking funky!
- [x] Confirm that attached BS datum and datum hash are distinctly different enough to not fool a cli output parser
- [x] Prove that "Scripts with old versions cannot be spent in transactions that include inline datums, attempting to do so will be a phase 1 transaction validation failure."
- [x] Datum witnessing requirements cannot be satisfied with reference inputs. Outputs with hashes must have datum included in transaction body as witness. We should prove that:
- [x] "when an output with an inline datum is spent, the spending transaction does not need to provide the datum itself."
- [x] a reference input with datum requires no witness, and so it should only be visible in TxOut and not txInfoData map.
- [x] Plutus can see regular inline datum in
txInfoInputs
- [x] Plutus can see referenced inline datum in
txInfoReferenceInputs
- [ ] Large inline datums - cli correctly complains if exceeding tx size limit but it hangs on submit if the datum is overly large
- [ ] Can be spent from vkey address
- [ ] When no scripts are being executed
- [ ] When some script is being executed (e.g. minting policy)
- [ ]
transaction view
shows correct inline datum details - [ ] cli includes fee in calculation
CIP-0033 Reference Scripts
- [x] Spending script with datum hash
- [x] Spending script with inline datum - raised https://github.com/input-output-hk/cardano-node/issues/3917
- [ ] Minting scripts
- [ ] Simple script (minting policy)
- [ ] The same policy referenced twice ?
- [ ] in combination with PlutusV2
- [x] PlutusV2 script, in combination with:
- [x] Reference PlutusV2 spending script
- [x] Reference PlutusV2 minting script
- [x] Attached PlutusV1 script - see error
ReferenceInputsNotSupported
- [x] Attached PlutusV2 minting script
- [x] The same policy referenced twice - cli doesn't allow it (only uses last occurrence)
- [ ] Consume reference input at same time as using its script for minting
- [x] Can spend output with minting script from spending script address
- [ ] Can spend output with minting script from vkey address - Blocked by https://github.com/input-output-hk/cardano-node/issues/4057
- [x] Burn
- [x] Can't have negative value of an asset -
Error: Negative quantity (-1) in transaction output
- [x] Can't have negative value of an asset -
- [ ] Simple script (minting policy)
- [x] Staking cert script - covered by https://github.com/input-output-hk/cardano-node/blob/master/scripts/babbage/staking-example/register-and-deglegate-script-staking-address.sh
- [x] Withdrawal script - covered by https://github.com/input-output-hk/cardano-node/blob/master/scripts/babbage/staking-example/claim-script-staking-rewards.sh
- [ ] Can spend output with reference script at script address
- [ ] Simple script
- [ ] Reference script
- [x] Can spend output with reference script at vkey address - raised https://github.com/input-output-hk/cardano-node/issues/4057
- [x] Simple script
- [x] Reference script
- [x] Shelley address
- [x] Byron address
- [x] Plutus can see regular input script hash
txInfoInputs
- [x] Plutus can see reference input script hash
txInfoReferenceInputs
- [x] Reference and execute multiple of the same spending script in the same transaction - (AC) uses multiple inline datums
- [x] Reference and execute multiple different spending script in the same transaction
- [x] Reference wrong spending script when spending from script address - Correctly fails, error is
RdmrPtr Spend 1 points to a Plutus script that does not exist.
- [ ] Reference scripts are not run when not needed (e.g. referenced but transaction is not spending from its script address)
- [ ] When spending a key-locked output and also referencing a script that doesn't need to run (don't provide collateral or pparams)
- [ ] PlutusV1 script (V1 should work is not being executed)
- [ ] PlutusV2 spending script
- [ ] PlutusV2 minting script
- [ ] Simple script
- [ ] When running a spending script and also referencing a script that doesn't need to run
- [ ] PlutusV1 script (V1 should work is not being executed)
- [ ] PlutusV2 spending script
- [ ] PlutusV2 minting script
- [ ] Simple script
- [ ] When minting and also referencing a script that doesn't need to run
- [ ] Minting with attached PlutusV2 script
- [ ] Minting with reference PlutusV2 script
- [ ] Minting with attached simple script
- [ ] Minting with reference simple script
- [ ] When spending a key-locked output and also referencing a script that doesn't need to run (don't provide collateral or pparams)
- [x] Inspect or read a script stored onchain using node-cli - used
query
cmd to produce output file - [x] Produce a valid transaction with both a reference script and datum at same utxo input
- [x] Prove that calculated fee and collateral are cheaper when using a reference script
- [ ] Collateral is correctly taken for failing reference script
- [x] Mix of attached and reference scripts in a single valid transaction
- [x] Try attaching the same script that is being referenced - Correctly errors
ExtraneousScriptWitnessesUTXOW
- [x] PlutusV2 spending script
- [ ] PlutusV2 minting script
- [x] Try referencing and attaching different scripts in a single transaction and prove correct output if only one fails or if both pass
- [x] Try attaching and referencing a pre-Vasil (V1) script - should fail phase1 validation only when script executes -
Command failed: transaction build Error: Error translating the transaction context: ReferenceInputsNotSupported
- [ ] Try attaching and referencing something that is not a script or is not well-formed
- [ ] Simple script
- [ ] PlutusV1 script
- [ ] PlutusV2 script
- [ ] Change type from Simple to Plutus before attaching and referencing, and vice versa
- [ ] Change type from PlutusV1 to PlutusV2 before attaching and referencing,, and vice versa
- [x] Correctly runs referenced simple script (aka native, aka phase1)
- [x] Timelock
- [x] Multisig
- [ ] Collateral input cannot be from a script address
- [ ]
transaction view
shows correct reference script details - [ ] cli includes fee in calculation
Return Collateral
- [x] Is always optional to include in transaction, even when script is invoked
- [x] Ada-only collateral has been dropped when collateral return is provided
- [x] Ada-only for collateral input remains when collateral return is omitted
- [x] Behaves as expected when combining referenced scripts, scripts embedded in the transaction, inline datum, tokens.
- [x] When collateral return is included and input collateral equals total collateral then the minUtxo constraint shouldn't fail like https://github.com/input-output-hk/cardano-node/issues/3041.
- [x] Returned output has index of number of txouts
- [x]
--tx-total-collateral
--tx-out-return-collateral
don't prevent a successful non-plutus transaction - [ ] In combination with reference spending script
- [ ] In combination with reference minting script
- [ ] (AC) Cli automatically calculates return collateral - raised https://github.com/input-output-hk/cardano-node/issues/3939
- [ ] Cannot using collateral at script address
- [ ] cli includes fee in calculation
Redeemers in TxInfo
- [x] Ensure redeemers for a mix of script purposes in transaction are visible in
txInfoRedeemers
(proved with multiple spending and a minting script in single transaction) - [ ] In combination with reference spending PlutusV2 script
- [ ] In combination with reference minting PlutusV2 script
SECP256k1
- [x] Work with MLabs to test the 2 builtin functions - MLabs have demonstrated successful verification of both on vasil-testnet
- [ ] Work with MLabs to automate the 2 builtin functions