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

Question: new_coins_per_byte & ref_script_coins_per_byte cost values to use #694

Closed
gmoratorio opened this issue Sep 26, 2024 · 5 comments
Closed

Comments

@gmoratorio
Copy link

I'm refactoring our CSL code from 11.5.0 to 12.1.0 and I've come across a few places where I'm not sure what we should use for cost values.
new_coins_per_byte
In our codebase we used 34482 for coins_per_utxo_word and I see in other places we have 4310 for coins_per_utxo_byte, but I'm not sure if
A. value for coins_per_utxo_word can be directly translated to coins_per_byte (or what the translation math should be) and
B. if our existing usage of 4310 in other places for coins_per_utxo_byte is the best value to use, or if there is a better recommended default

ref_script_coins_per_byte (now required to work with the script_size arg introduced in new_ref_input)
I found "minFeeRefScriptCostPerByte": 15 in our Stake Pool's conway-genesis.json file, but I'm not sure if this is the right value to use, and also ref_script_coins_per_byte expects an interval, so I'm not sure what the numerator and denominator should be in this case.

Any insights into cost values to use for new_coins_per_byte and ref_script_coins_per_byte or links to docs where these recommended values are stored would be very helpful.

Thanks in advance!

@lisicky
Copy link
Contributor

lisicky commented Sep 27, 2024

It's a protocol parameter that can be updated on-chain by a governance action.

To get your latest protocol parameters, you can use:

  1. cardano-cli
  2. dbsync
  3. Third-party services like Blockfrost, Koios, or Ogmios
  4. Manually get them from cexplorer
  5. Come up with something different

The difference between coins_per_utxo_word and coins_per_utxo_byte is that the coins_per_utxo_size parameter from protocol parameters was coins_per_utxo_word until the Babbage era, but since Babbage, it's coins_per_utxo_byte. We had both variants in the CSL to have a smooth transition between eras because initially, coins_per_utxo_byte was coins_per_utxo_word / 8. Up to this moment, coins_per_utxo_byte has not changed, but it might be changed in the future by a governance action.

@gmoratorio
Copy link
Author

ah yes, fantastic, thank you. I see both coins_per_utxo_size and coins_per_utxo_word from Blockfrost.

For min_fee_ref_script_cost_per_byte (looks like the protocol param is currently 15), for the UnitInterval required by CSL do we just do numerator 15, denominator 1?

@lisicky
Copy link
Contributor

lisicky commented Sep 27, 2024

@gmoratorio right

@gmoratorio
Copy link
Author

Thanks so much for the help! Really useful info. Much appreciated.

@gmoratorio
Copy link
Author

Thanks for the help!

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