-
Notifications
You must be signed in to change notification settings - Fork 16
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
query protocol-parameters: use ledger JSON encoding, not API one #758
Merged
smelc
merged 2 commits into
main
from
smelc/write-protocol-parameters-use-ledger-encoding
May 28, 2024
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What about this TODO: https://github.com/IntersectMBO/cardano-cli/blob/main/cardano-cli/src/Cardano/CLI/EraBased/Run/Transaction.hs#L506
Are we able to round-trip i.e. read the parameters into the
transaction build
after your change? Afair there was a testnet test for that.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.
Notes to myself:
transaction build
doesn't read the parameters by using the CLI's code: it requests them from the nodetransaction build-raw
does read parameters from the command line.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.
@carbolymer> actually there are multiple usages of the API JSON encoding:
build-estimate
: https://github.com/IntersectMBO/cardano-cli/blob/main/cardano-cli/src/Cardano/CLI/EraBased/Run/Transaction.hs#L286build-raw
(the one you pointed out)calculate-min-fee
: https://github.com/IntersectMBO/cardano-cli/blob/main/cardano-cli/src/Cardano/CLI/EraBased/Run/Transaction.hs#L1261calculate-min-value
: https://github.com/IntersectMBO/cardano-cli/blob/main/cardano-cli/src/Cardano/CLI/EraBased/Run/Transaction.hs#L1342Should we change all of them?
@gitmachtl> would you be able to test this change before we merge it? I'm afraid we are not the best ones to test this change exhaustively.
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.
sure, also those are really important. let me compile the cli for testing...
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.
@smelc so first issue i see is, that cli is complaining about the missing parameter
key "minUTxOValue" not found
so the parameters with
null
value that were sorted out are causing an issue here. cli expects at least that the key is in there.afaik only those parameters are automatically "trimmed" out right now:
not sure if "decentralization" and "extraPraosEntropy" are actually ever read back for some processes? if not, only the "minUTxoValue" one is an issue. that parameter was only used pre babbage era, so would it be an option to only read that in if the used era expects it?
utxoCostPerWord
is also not present anymore in latest eras. but was used before, that might also be an issue during bootstrap phase to get thru the eras.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.
@gitmachtl> is there a way I can reproduce your tests myself? So that then I can investigate how to fix the issues in autonomy.
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.
@smelc Sure, you can simply copy&paste those lines on the cli.
So the cli complains about the missing
extrapraosEntropy
parameter. To simulate the presence of theextraPraosEntropy
we can do:Now its complaining about the missing
minUTxOVallue
If we also add this with the null value again, the fee calculation works:
Same errors are for the
calculate-min-required-utxo
function.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.
@smelc yes, we should only use one encoding, so in this case ledger's.