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

Cannot delegate Plutus stake address #297

Closed
mkoura opened this issue Sep 20, 2023 · 4 comments
Closed

Cannot delegate Plutus stake address #297

mkoura opened this issue Sep 20, 2023 · 4 comments

Comments

@mkoura
Copy link
Contributor

mkoura commented Sep 20, 2023

Description

An attempt to delegate a PlutusV1 stake address fails on submit with MissingScriptWitnessesUTXOW.

An attempt to delegate a PlutusV2 stake address fails on submit with MissingRedeemers.

Steps to Reproduce

  1. Create stake address registration cert:

cardano-cli stake-address registration-certificate --stake-script-file cardano_node_tests/tests/data/plutus/v1/guess-42-stake.plutus --out-file test_delegate_deregister_ci0_qyd_True_v1_addr0_stake_reg.cert

  1. Create stake address delegation cert:

cardano-cli stake-address delegation-certificate --stake-script-file cardano_node_tests/tests/data/plutus/v1/guess-42-stake.plutus --stake-pool-id pool1e3fy8wyh2h6zrfrceaqywuhr3ttd9t9da8zxef2l5akv7vxm9uj --out-file test_delegate_deregister_ci0_qyd_True_v1_addr0_stake_deleg.cert

  1. Build a transaction:

cardano-cli transaction build --certificate-file test_delegate_deregister_ci0_qyd_True_v1_addr0_stake_reg.cert --certificate-file test_delegate_deregister_ci0_qyd_True_v1_addr0_stake_deleg.cert --certificate-script-file cardano_node_tests/tests/data/plutus/v1/guess-42-stake.plutus --certificate-redeemer-file cardano_node_tests/tests/data/plutus/42.redeemer --tx-in-collateral "dfff51d600a8f46e631baa5fe59b0bd65f598e6d3465b209a55fa05087e5a9c8#0" --tx-in "dfff51d600a8f46e631baa5fe59b0bd65f598e6d3465b209a55fa05087e5a9c8#3" --change-address addr_test1yrkv6hkd3c707e4zrj7nldwnegteq32spphskts2arzptdl49efzcr2v6ktsfjyrcvc00qgnf30spkq49ke7eguxq92q9xhvsd --witness-override 1 --out-file test_delegate_deregister_ci0_qyd_True_v1_reg_deleg_tx.body --babbage-era --testnet-magic 42

  1. Sign the transaction with payment key:

cardano-cli transaction sign --tx-body-file test_delegate_deregister_ci0_qyd_True_v1_reg_deleg_tx.body --testnet-magic 42 --signing-key-file test_delegate_deregister_ci0_zny_pool_user.skey --out-file test_delegate_deregister_ci0_qyd_True_v1_reg_deleg_tx.signed

  1. Try to submit the transaction:

cardano-cli transaction submit --testnet-magic 42 --tx-file test_delegate_deregister_ci0_qyd_True_v1_reg_deleg_tx.signed --cardano-mode

  1. For PlutusV1 observe the failure:

Command failed: transaction submit Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraBabbage (ApplyTxError [UtxowFailure (AlonzoInBabbageUtxowPredFailure (ShelleyInAlonzoUtxowPredFailure (MissingScriptWitnessesUTXOW (fromList [ScriptHash "f52e522c0d4cd59704c883c330f781134c5f00d8152db3eca3860154"]))))])

or for PlutusV2:

Command failed: transaction submit Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraBabbage (ApplyTxError [UtxowFailure (AlonzoInBabbageUtxowPredFailure (MissingRedeemers [(Certifying (ShelleyTxCertDelegCert (ShelleyDelegCert (ScriptHashObj (ScriptHash "9c8e9da7f81e3ca90485f32ebefc98137c8ac260a072a00c4aaf142d")) (KeyHash "cc5243b89755f421a478cf404772e38ad6d2acade9c46ca55fa76ccf"))),ScriptHash "9c8e9da7f81e3ca90485f32ebefc98137c8ac260a072a00c4aaf142d")])),UtxowFailure (AlonzoInBabbageUtxowPredFailure (PPViewHashesDontMatch SNothing (SJust (SafeHash "8ee004f99373941d6cbee99aab615d0c7fbab451faa9f115ef4587d66d0a77b5")))),UtxowFailure (UtxoFailure (AlonzoInBabbageUtxoPredFailure (UtxosFailure (CollectErrors [NoRedeemer (Certifying (ShelleyTxCertDelegCert (ShelleyDelegCert (ScriptHashObj (ScriptHash "9c8e9da7f81e3ca90485f32ebefc98137c8ac260a072a00c4aaf142d")) (KeyHash "cc5243b89755f421a478cf404772e38ad6d2acade9c46ca55fa76ccf"))))]))))])

Additional Context

OS: Fedora 37
cardano-cli: d634aaf
cardano-node: 9a0898636a4ea13f720dc3c6c8789b27beeb37c9

Files used for reproduction:

test_delegation_py.zip

@mkoura
Copy link
Contributor Author

mkoura commented Oct 4, 2023

With fixes from #306, delegation works when stake address registration is done in one tx and delegation in another tx.

When attempting to register and delegate plutus stake address in single tx, I'm getting following error on submit:

Command failed: transaction submit Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraBabbage (ApplyTxError [UtxowFailure (AlonzoInBabbageUtxowPredFailure (ExtraRedeemers [RdmrPtr Cert 0]))])

The tx was built using build-raw:

cardano-cli transaction build-raw --fee 300000 --out-file test_delegate_deregister_ci0_qsc_False_v1_reg_deleg_tx.body --certificate-file test_delegate_deregister_ci0_qsc_False_v1_addr0_stake_reg.cert --certificate-file test_delegate_deregister_ci0_qsc_False_v1_addr0_stake_deleg.cert --certificate-script-file cardano_node_tests/tests/data/plutus/v1/guess-42-stake.plutus --certificate-execution-units "(218855869,686154)" --certificate-redeemer-file cardano_node_tests/tests/data/plutus/42.redeemer --tx-in-collateral "647aa255c7effe6fb62d7527c82f0715458dee98e810d402b08edd9e93bae8c1#0" --protocol-params-file /home/martink/Source/repos/cardano-node/state-cluster0/pparams-seyp.json --tx-in "647aa255c7effe6fb62d7527c82f0715458dee98e810d402b08edd9e93bae8c1#3" --tx-out "addr_test1yqy2ch5xn0dzzd9v8pgjvwxkmhxhlwng4fqyn48rlsuj6l849efzcr2v6ktsfjyrcvc00qgnf30spkq49ke7eguxq92qpec5tz+1499300000" --babbage-era

When using build command as

cardano-cli transaction build --certificate-file test_delegate_deregister_ci0_bhk_True_v1_addr0_stake_reg.cert --certificate-file test_delegate_deregister_ci0_bhk_True_v1_addr0_stake_deleg.cert --certificate-script-file cardano_node_tests/tests/data/plutus/v1/guess-42-stake.plutus --certificate-redeemer-file cardano_node_tests/tests/data/plutus/42.redeemer --tx-in-collateral "982f46982c164f81c952df1a21e86b62aa8678e5465e329db646b4913489a9c1#0" --tx-in "982f46982c164f81c952df1a21e86b62aa8678e5465e329db646b4913489a9c1#3" --change-address addr_test1yzf4hyctfe0uchjntdwg0g5tuvktwtag49f5h4e5xxkx8w049efzcr2v6ktsfjyrcvc00qgnf30spkq49ke7eguxq92qdw4jpq --witness-override 1 --out-file test_delegate_deregister_ci0_bhk_True_v1_reg_deleg_tx.body --babbage-era --testnet-magic 42

I'm now getting error

Command failed: transaction build Error: The following scripts have execution failures:
the script for certificate 0 (in the list order of the certificates) failed with:
certificate 0 (in the list order of the certificates) points to a script hash that is not known.

mkoura added a commit to IntersectMBO/cardano-node-tests that referenced this issue Oct 6, 2023
Copy link

github-actions bot commented Nov 4, 2023

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 120 days.

@github-actions github-actions bot added the Stale label Nov 4, 2023
@mkoura mkoura removed the Stale label Nov 9, 2023
@mkoura
Copy link
Contributor Author

mkoura commented Nov 10, 2023

It is possible to submit a Tx that registers and delegates plutus stake address when the Tx was built using cardano-cli from 8.1.2 release.

I attached both transactions for CBOR comparison: cli_issue_297_txs.tar.gz

@mkoura
Copy link
Contributor Author

mkoura commented Dec 1, 2023

Fixed by #476

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

1 participant