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

[FR] - make transaction build to balance automatically also the multi-assets #3068

Closed
Tracked by #4144 ...
dorin100 opened this issue Aug 12, 2021 · 17 comments · Fixed by #4450
Closed
Tracked by #4144 ...

[FR] - make transaction build to balance automatically also the multi-assets #3068

dorin100 opened this issue Aug 12, 2021 · 17 comments · Fixed by #4450
Assignees
Labels
alonzo-purple Relates to the Alonzo Purple Testnet API&CLI-Backlog comp: cardano-cli enhancement New feature or request era: alonzo type: enhancement An improvement on the existing functionality user type: internal Created by an IOG employee

Comments

@dorin100
Copy link

Internal/External
Internal if an IOHK staff member.

Area
Native Tokens Related to Native Tokens (Mary).
Plutus Related to Plutus Scripts (Alonzo).

Describe the feature you'd like
make transaction build to balance automatically also the multi-assets, not only the Lovelace UTXOs

@kieransimkin
Copy link

I would argue that this is not a feature enhancement, but a bug - I can't find any logical justification for why it would automatically balance ADA but not non-Ada tokens? It just means code that works with UTXOs containing only ADA inexplicably breaks for UTXOs containing non-Ada tokens. Really not expected behaviour at all. If you have left-over tokens of any kind, they should be outputted back to the change address, what is the justification for not doing this?

@mateusap1
Copy link

Any updates? I think at least adding an option is a good idea

@dorin100
Copy link
Author

cc @vfrsilva

@kieransimkin
Copy link

Any updates? I think at least adding an option is a good idea

Apparently the core dev team at IOG have absolutely no interest in making life easier for us developers, or even explaining the rationale behind their dodgy decisions. This is the 2nd or 3rd ticket I've raised over an silly issue like this which is causing unnecessary confusion and roadblocks to new Cardano developers. Every time I raise an issue, I either get ignored, or I get push back - took months to make any progress on the incompatibility between Serialization-lib and Cardano-CLI transactions - I suspect because dev team bury their heads in the sand.

Honestly, I like Cardano, I think it's a good system with a good community, and I'm personally very heavily invested it in it, but the process of developing for Cardano is way harder than it needs to be, and IOG needs to pull their fingers out, start listening to your developers, respond to them and try to make the platform easier to develop on - Cardano will lose to other cryptos if this doesn't happen, that is already happening.

Why develop for a platform that's harder than others, written in a language nobody knows (Haskell) and with a core development team who seem to have no interest in making life easier for their development community?

philipqnguyen added a commit to philipqnguyen/cnifty that referenced this issue Apr 20, 2022
`cardano-cli transaction build` was supposed to abstract all the
low level building of ``cardano-cli transaction build-raw`,
however it does not support balancing NFTs. Therefore, we currently
need to revert back to using `cardano-cli transaction build-raw`
and manually calculate the fees and balance the change address.

See issue: IntersectMBO/cardano-node#3068
@larestrepo
Copy link

I just hit this issue, is there any workaround? change-address should handle the balance to both ADA and non-ADA assets.

@jterrier84
Copy link

Same problem here. Any final solution or workaround available?

@marijanp
Copy link

What errors are you all getting and what version of cardano-node/-cli are you using? For me the balancing of non-Ada values works.

@jterrier84
Copy link

I get this error:
Command failed: transaction build Error: Non-Ada assets are unbalanced: 1354601 lovelace + 5000000000 afc910d7a306d20c12903979d4935ae4307241d03245743548e76783.4153484942 + 1 f0ff48bbb7bbe9d59a40f1ce90e9e9d0ff5002ec48f232b49ca0fb9a.6d696e6931706f6f6c

My cardano-cli version:
cardano-cli 1.34.1 - linux-aarch64 - ghc-8.10

@larestrepo
Copy link

cardano-cli 1.34.1 - linux-x86_64 - ghc-8.10
git rev 73f9a74

This is what I found: the change-address works if you spend all the assets from the utxo. Now if you want to partial spend (say you have 30 and want to send 10 to another address), change address is not able to figure out that the remaining 20 must be sent to the change address specified in the tx.

@kieransimkin
Copy link

cardano-cli 1.34.1 - linux-x86_64 - ghc-8.10 git rev 73f9a74

This is what I found: the change-address works if you spend all the assets from the utxo. Now if you want to partial spend (say you have 30 and want to send 10 to another address), change address is not able to figure out that the remaining 20 must be sent to the change address specified in the tx.

Yes, this is quite clearly a bug, I'm not sure why so much resistance to fixing it.

@MatthewTristan
Copy link

How can we get more attention from IOG about this?

@dorin100
Copy link
Author

cc @CarlosLopezDeLara , @kevinhammond

@manupadillaph
Copy link

Some news about this?

@MatthewTristan
Copy link

Any new news?

@kieransimkin
Copy link

Recommend you go on Twitter and tag everyone with IOHK or IOG in their handle on a daily basis.

Generally I think everyone is now using serialisation-lib for transaction generation now, although that's a world of pain in itself. So.. have fun 🙄🤦‍♂️

@LudvikGalois LudvikGalois self-assigned this Aug 22, 2022
@Ftrain27
Copy link

Any updates on this? Currently going through an EMURGO Plutus cohort where we're working with multiple assets. I agree with kieransimkin, I definitely expected --change-address to work with multiple assets, especially since there are very little technical differences between lovelace and all other native assets. Seems like a bug worth fixing.

@CarlosLopezDeLara
Copy link
Contributor

Dear all, we are finally working on this feature 🤓. We aim to have it ready ASAP. Hopefully we can have it ready for the Vasil maintenance release.

LudvikGalois pushed a commit that referenced this issue Sep 15, 2022
Previously we gave up when the non-Ada part of a transaction wasn't
balanced. We now balance the transaction and correctly update the fee
accordingly (since the fee will be higher). We also return an error in
the case where the is non-Ada change, but not at least minUTxO
change (e.g. in the case where the Ada is already balanced).

Resolves: #3068
LudvikGalois pushed a commit that referenced this issue Sep 15, 2022
Previously we gave up when the non-Ada part of a transaction wasn't
balanced. We now balance the transaction and correctly update the fee
accordingly (since the fee will be higher). We also return an error in
the case where the is non-Ada change, but not at least minUTxO
change (e.g. in the case where the Ada is already balanced).

Resolves: #3068
LudvikGalois pushed a commit that referenced this issue Sep 15, 2022
Previously we gave up when the non-Ada part of a transaction wasn't
balanced. We now balance the transaction and correctly update the fee
accordingly (since the fee will be higher). We also return an error in
the case where the is non-Ada change, but not at least minUTxO
change (e.g. in the case where the Ada is already balanced).

Resolves: #3068
LudvikGalois pushed a commit that referenced this issue Sep 21, 2022
Previously we gave up when the non-Ada part of a transaction wasn't
balanced. We now balance the transaction and correctly update the fee
accordingly (since the fee will be higher). We also return an error in
the case where the is non-Ada change, but not at least minUTxO
change (e.g. in the case where the Ada is already balanced).

Resolves: #3068
Jimbo4350 pushed a commit that referenced this issue Sep 28, 2022
Previously we gave up when the non-Ada part of a transaction wasn't
balanced. We now balance the transaction and correctly update the fee
accordingly (since the fee will be higher). We also return an error in
the case where the is non-Ada change, but not at least minUTxO
change (e.g. in the case where the Ada is already balanced).

Resolves: #3068
LudvikGalois pushed a commit that referenced this issue Oct 4, 2022
Previously we gave up when the non-Ada part of a transaction wasn't
balanced. We now balance the transaction and correctly update the fee
accordingly (since the fee will be higher). We also return an error in
the case where the is non-Ada change, but not at least minUTxO
change (e.g. in the case where the Ada is already balanced).

Resolves: #3068
LudvikGalois pushed a commit that referenced this issue Oct 4, 2022
Previously we gave up when the non-Ada part of a transaction wasn't
balanced. We now balance the transaction and correctly update the fee
accordingly (since the fee will be higher). We also return an error in
the case where the is non-Ada change, but not at least minUTxO
change (e.g. in the case where the Ada is already balanced).

Resolves: #3068
@dorin100 dorin100 added type: enhancement An improvement on the existing functionality user type: internal Created by an IOG employee comp: cardano-cli era: alonzo labels Oct 21, 2022
LudvikGalois pushed a commit that referenced this issue Oct 31, 2022
Previously we gave up when the non-Ada part of a transaction wasn't
balanced. We now balance the transaction and correctly update the fee
accordingly (since the fee will be higher). We also return an error in
the case where the is non-Ada change, but not at least minUTxO
change (e.g. in the case where the Ada is already balanced).

Resolves: #3068
newhoggy pushed a commit that referenced this issue Feb 9, 2023
Previously we gave up when the non-Ada part of a transaction wasn't
balanced. We now balance the transaction and correctly update the fee
accordingly (since the fee will be higher). We also return an error in
the case where the is non-Ada change, but not at least minUTxO
change (e.g. in the case where the Ada is already balanced).

Resolves: #3068
Jimbo4350 pushed a commit that referenced this issue Feb 11, 2023
Previously we gave up when the non-Ada part of a transaction wasn't
balanced. We now balance the transaction and correctly update the fee
accordingly (since the fee will be higher). We also return an error in
the case where the is non-Ada change, but not at least minUTxO
change (e.g. in the case where the Ada is already balanced).

Resolves: #3068
newhoggy pushed a commit that referenced this issue Feb 28, 2023
Previously we gave up when the non-Ada part of a transaction wasn't
balanced. We now balance the transaction and correctly update the fee
accordingly (since the fee will be higher). We also return an error in
the case where the is non-Ada change, but not at least minUTxO
change (e.g. in the case where the Ada is already balanced).

Resolves: #3068
newhoggy pushed a commit that referenced this issue Mar 10, 2023
Previously we gave up when the non-Ada part of a transaction wasn't
balanced. We now balance the transaction and correctly update the fee
accordingly (since the fee will be higher). We also return an error in
the case where the is non-Ada change, but not at least minUTxO
change (e.g. in the case where the Ada is already balanced).

Resolves: #3068
newhoggy pushed a commit that referenced this issue Mar 17, 2023
Previously we gave up when the non-Ada part of a transaction wasn't
balanced. We now balance the transaction and correctly update the fee
accordingly (since the fee will be higher). We also return an error in
the case where the is non-Ada change, but not at least minUTxO
change (e.g. in the case where the Ada is already balanced).

Resolves: #3068
newhoggy pushed a commit that referenced this issue Mar 19, 2023
Previously we gave up when the non-Ada part of a transaction wasn't
balanced. We now balance the transaction and correctly update the fee
accordingly (since the fee will be higher). We also return an error in
the case where the is non-Ada change, but not at least minUTxO
change (e.g. in the case where the Ada is already balanced).

Resolves: #3068
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alonzo-purple Relates to the Alonzo Purple Testnet API&CLI-Backlog comp: cardano-cli enhancement New feature or request era: alonzo type: enhancement An improvement on the existing functionality user type: internal Created by an IOG employee
Projects
None yet
Development

Successfully merging a pull request may close this issue.