-
Notifications
You must be signed in to change notification settings - Fork 318
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
CIP-0055? | Babbage Era Protocol Parameters #265
CIP-0055? | Babbage Era Protocol Parameters #265
Conversation
@JaredCorduan , question, i am calculating the current value discrete in my stakepool operator scripts, based on mary/alonzo values. (https://github.com/gitmachtl/scripts/blob/f84ed987ab0dcdcba7caee758a9f723853735899/cardano/mainnet/00_common.sh#L669-L752) After the HF event, can i still use the same calculation method but just multiplying the value of the coinsPerUTxOByte value by 8 and use this as the new "word" amount? |
No, that is not guaranteed to work. The old formula was based on an upper bound to the memory usage, and the new formula is based on the size on the wire. |
@JaredCorduan I do expect the new formula to always yield values that are less or equal to what they used to be with the current formula, as the approximation was 'over-estimating' sizes generally speaking. Right? |
|
(clicked the wrong button, sorry to close/open the PR) That is probably true, but we have not tested it or made that promise. |
just to be clear, the old formula was over-estimating the size in memory. the new methods is an exact measurement of the size on the wire. in other words, we are measuring something slightly different in Babbage, though obviously they are correlated. |
can the size be calculated from the "build-raw transaction" output we do already to produce a "dummy-tx" for later usage with the "transaction calculate-min-fee" command? like just using the cBor hex content of the unwitnessed-tx-file, size is length of that cbor string / 2 (because hex uses 2 chars for 1 byte). i want to have an external 2nd option to calculate the minAda. if it is necessary to do the signing too, that would be a nightmare with hw wallets or multisig operations. currently we can calculate the minRequiredUTxO externally by the formular or via the internal "calculate-min-required-utxo" command. but the external formular method does not require any cBor conversion just pure "bash" commands. |
almost! it's not the size of the cbor tx that matters, but the size of each cbor txout inside the output of |
hmm ok, but this is not trivial because it would need to redo the whole cbor conversion... hmm. |
what cbor conversion are you referring to? |
to bring any kind of txOut into the used cBor format for calculating the minAda. there is no native solution to do this in pure bash without 3rd party tools. but lets see how it differs. currently running testnodes in the vasil-qa testchain. any plans to bring this new parameter into this testchain anytime soon? |
it's already using the new calculation on vasil-qa. |
@JaredCorduan what about the 'extra entropy' and the 'decentralization parameter' which are now gone in Babbage/Vasil? Do you think you could add two lines of rationale as for why those parameters have now been removed so that we have a complete overview of the updatable parameters changes. |
yes, that's a great idea. |
@KtorZ I've added some prose about the removal of |
f2481d7
to
9234cec
Compare
(not ceiling anymore)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
4141: Add utxoCostPerByte protocol parameter r=newhoggy a=newhoggy Resolves #4052 See cardano-foundation/CIPs#265 Co-authored-by: John Ky <john.ky@iohk.io>
4141: Add utxoCostPerByte protocol parameter r=newhoggy a=newhoggy Resolves #4052 See cardano-foundation/CIPs#265 Co-authored-by: John Ky <john.ky@iohk.io>
hi, i have troubles to get the math right. so i have a simple transaction to a testnet base address. sending lovelaces and 10x ATADAcoin. this results in a minADA value of 1168010 lovelaces. according to the utxoCostPerByte value of 4310 this should be 271 bytes. but when i only take the CBOR part of this txout
cbor-hex: thats only 111 bytes and not 271 bytes? what am i missing here? 160 bytes as a fixed addition? EDIT: ah... the overhead ... |
@gitmachtl great catch, I forgot that we ended up adding the constant overhead, that should definitely be a part of this CIP! |
@JaredCorduan i figured out, that for a mary/alonzo transaction in babbage era you get along with an overhead of only 158 bytes. what is causing the 2 extra bytes for a babbage formated transaction? is it the change in the legacy/babbage transaction output (https://github.com/input-output-hk/cardano-ledger/blob/2505b7f103c78ee5a230b3e302e31d9607fffbd5/eras/babbage/test-suite/cddl-files/babbage.cddl#L77-L88) ? |
Note that the purpose of the minimum UTxO value is to constrain how much memory someone can take up in the UTxO map, relative to how many lovelace they control. And we are now (starting in the Babbage era) using the number of bytes of a given transaction output on the wire to approximate the impact in memory to the UTxO. In Haskell, a The UTxO map looks like:
So each element of the map, ie each
Total: Remember that we are approximating the size of The transaction inputs look like:
So each
Total: The transaction IDs look like:
So each TxId uses:
Total: 5 Words This brings us to 14 words of overhead. The remaining 6 words account for the space taken up by the transaction output which is not accounted for in the bytes on the wire. Since outputs can vary a lot (Babbage era outputs have a lot of options, such as inline datums, reference scripts, etc), we did not do accounting as above, but rather chose 6 because that was the value which made the minimum lovelace of an lovelace-only output have a minimum of 1 ADA (using the current Alonzo protocol parameters). Though the minimum utxo calculation has changed each era, ever since the Shelley era we have kept the minimum value for a lovelace-only outputs as close to 1 ADA as we can. |
thx 🙏 |
This informational CIP extends CIP-0028 to introduce a change to one of the Alonzo protocol parameters in the Babbage era, namely
lovelacePerUTxOWord
. We propose to have this updateable parameter be based on bytes instead of words (eight bytes).