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

Simple transactions: add padded & recursive fee calculation? #1322

Open
rphair opened this issue Sep 19, 2024 · 3 comments
Open

Simple transactions: add padded & recursive fee calculation? #1322

rphair opened this issue Sep 19, 2024 · 3 comments

Comments

@rphair
Copy link
Collaborator

rphair commented Sep 19, 2024

There are repeated postings of Cardano users getting values calculated too low from calculate-min-fee when either:

  • submitting a fee of 0 or zero values for the transaction input amounts
  • not re-submitting with the calculated fee to ensure it's the same as the proposed fee (i.e. submitting recursively until then).

The advice to both pad the input fee & submit conservative or actual values, so that CBOR can be realistically assigned and a workable transaction fee determined from the byte cost, has been given here & in other places, though still not addressed @CarlosLopezDeLara in your otherwise excellent recently rewritten instructions (https://developers.cardano.org/docs/get-started/cardano-cli/get-started/simple-transactions#calculating-transaction-fees-and-balancing-a-transaction):

Given that this question has to be answered manually every time, I propose that we agree upon & include language (to @CarlosLopezDeLara's high standards) that includes this "recursive" fee calculation as constantly recommended to the community.

I believe that if users continue to encounter trouble they may be tempted to use transaction build instead of the advance fee calculation even when their security configurations don't support doing this safely (as per https://developers.cardano.org/docs/get-started/secure-workflow#why-cant-i-use-cardano-cli-transaction-build).

@CarlosLopezDeLara
Copy link
Collaborator

CarlosLopezDeLara commented Sep 19, 2024

Yes, this is a good idea. The key thing is that using --fee 0 is not always a good idea. It may produce a slightly smaller tx than the real one once we add the fees. We have two options:

  1. Start with 0, get a fee, rebuild the tx, get fee again, sign, submit.

  2. Start with something like --fee 0.170000

@CarlosLopezDeLara
Copy link
Collaborator

CarlosLopezDeLara commented Sep 19, 2024

About "security", I always suggest doing the signing of transactions in an air-gapped machine, while building the transaction is perfectly acceptable thing to do in a hot environment.

@rphair
Copy link
Collaborator Author

rphair commented Sep 19, 2024

Start with something like --fee 0.170000

The older version of the doc pages had fee 300000 lovelace which was well backed up by recommendations circulated in the community.

Given the process requires convergence from either direction, in case the "recursion" doesn't happen I think it's better for a manual CLI user to pay for an extra CBOR byte or two than for a Tx to fail for a user who sometimes can't diagnose the problem.

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

No branches or pull requests

2 participants