Skip to content

All balance in --tx-in-collateral is taken. Change should go to --change-address (build command) #4075

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

Closed
1 of 13 tasks
Tracked by #4144 ...
CarlosLopezDeLara opened this issue Jun 22, 2022 · 3 comments · Fixed by #4198
Closed
1 of 13 tasks
Tracked by #4144 ...
Labels
comp: cardano-cli era: babbage in-scope This item is being worked and will be part of an upcoming release priority medium issues/PRs that SHOULD be addressed. This should be done for the release, but acceptable if it doesn tag: 1.35.1 type: bug Something is not working user type: internal Created by an IOG employee Vasil

Comments

@CarlosLopezDeLara
Copy link
Contributor

CarlosLopezDeLara commented Jun 22, 2022

What - The user facing feature being implemented

When phase 2 validation fails and NO --tx-out-return-collateral is given, only exact amount of collateral should be used and change should be sent to --change-address specified in (cardano-cli transaction build)

Current behaviour is that it falls back to Alonzo-style of taking all collateral.

Steps to reproduce
Steps to reproduce the behavior:

  1. Create a plutus script transaction that should fail phase2 validation
  2. Give a --tx-in-collateral with more ADA than needed to cover the collateral
  3. Do not give a --tx-out-return-collateral
  4. Sign and submit the transaction
  5. All the balance in -tx-in-collateral is taken

Why

Only the exact amount of collateral should be taken and change should be sent to --change-address when no --tx-out-return-collateral is given by the user.

Related GH issues

Personas - Who will this affect?

  • SPO
  • Dapp Devs
  • Exchanges

Acceptance Criteria

Given that I'm a Dapp developer, when I submit a plutus script that fails phase 2 validation AND my transaction does not specify --tx-out-return-collateral I want:

  • Only the exact collateral amount to be taken from --tx-in-collateral AND the excess is sent to --change-address

Definition of Done

  • Code peer-reviewed
  • Builds successfully on CI
  • Includes documentation and/or examples for the functionality
  • Log/record changes on Vnext (or similar depending on what we adopt)
  • Acceptance Criteria met
  • The new functionality is covered by dev/unit/property tests
  • Merged to master
  • Test Engineering Sign-off + E2E automated tests
  • Released
@CarlosLopezDeLara CarlosLopezDeLara added bug Something isn't working priority medium issues/PRs that SHOULD be addressed. This should be done for the release, but acceptable if it doesn Vasil labels Jun 22, 2022
@CarlosLopezDeLara
Copy link
Contributor Author

Ledger to provide a helper function.

@CarlosLopezDeLara CarlosLopezDeLara added the 1.35.1 Include in 1.35.1 label Jun 30, 2022
@CarlosLopezDeLara CarlosLopezDeLara added 1.35.2 and removed 1.35.1 Include in 1.35.1 labels Jul 8, 2022
@Jimbo4350
Copy link
Contributor

Jimbo4350 commented Jul 13, 2022

This is not a bug. We are getting too trigger happy with labeling things as bugs when they are feature requests!

@Jimbo4350 Jimbo4350 removed the bug Something isn't working label Jul 13, 2022
@Jimbo4350 Jimbo4350 changed the title [BUG] - All balance in --tx-in-collateral is taken. Change should go to --change-address (build command) All balance in --tx-in-collateral is taken. Change should go to --change-address (build command) Jul 20, 2022
@CarlosLopezDeLara CarlosLopezDeLara added in-scope This item is being worked and will be part of an upcoming release and removed 1.35.2 labels Jul 22, 2022
@Jimbo4350
Copy link
Contributor

Jimbo4350 commented Jul 27, 2022

One caveat is you also need to not provide the --tx-total-collateral flag in order to benefit from automatically calculating the return collateral. Specifying either --tx-total-collateral or --tx-total-collateral will result in the build command not automatically returning the "excess" collateral to your change address.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: cardano-cli era: babbage in-scope This item is being worked and will be part of an upcoming release priority medium issues/PRs that SHOULD be addressed. This should be done for the release, but acceptable if it doesn tag: 1.35.1 type: bug Something is not working user type: internal Created by an IOG employee Vasil
Projects
None yet
3 participants