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

[BUG] - cardano-cli should error if provided invalid cost model #4867

Closed
disassembler opened this issue Feb 7, 2023 · 2 comments · Fixed by #4885
Closed

[BUG] - cardano-cli should error if provided invalid cost model #4867

disassembler opened this issue Feb 7, 2023 · 2 comments · Fixed by #4885
Assignees
Labels
type: bug Something is not working

Comments

@disassembler
Copy link
Contributor

Internal/External
Internal if an IOHK staff member.

Area
Other Any other topic (Delegation, Ranking, ...).

Summary
cardano-cli when given a cost model with invalid keys (in this case PlutusScriptV1 and V2. It currently creates an update proposal with a null cost model (e.g. no change on-chain). This is problematic because the only way to tell this has happened is to look at the raw CBOR or wait until it's on chain and view it in db-sync. If it has the wrong key names, it would be better to error out loudly and break the script from running so the undesirable noop option isn't taken.

Steps to reproduce
cardano-cli governance create-update-proposal --epoch 50 --max-block-execution-units '(20000000000,62000000)' --cost-model-file ~/cost-model-secp-preprod-mainnet.json --protocol-major-version 8 --protocol-minor-version 0 --genesis-verification-key-file foo.vkey --out-file update.proposal
view resulting hex in cbor.me

Expected behavior
Throw an error if cost model is missing PlutusV1 or PlutusV2 attributes.

System info (please complete the following information):

  • OS Name: [e.g. Ubuntu]
  • OS Version [e.g. 20.04]
  • Node version (output of cardano-node --version)
  • CLI version (output of cardano-cli --version)

If the git revision is reported to be 0000000000000000000000000000000000000000, please use cabal build instead of cabal install to build the binaries because cabal install does not record the git revision in the binaries.

Screenshots and attachments

  • If applicable, add screenshots, config files and/or logs to help explain the problem.

Additional context
Add any other context about the problem here.

@disassembler disassembler added the type: bug Something is not working label Feb 7, 2023
@newhoggy newhoggy self-assigned this Feb 8, 2023
@newhoggy
Copy link
Contributor

newhoggy commented Feb 8, 2023

@disassembler can you provide or link me to the ~/cost-model-secp-preprod-mainnet.json you used? Or provide some instructions on how to construct it?

@newhoggy
Copy link
Contributor

@iohk-bors iohk-bors bot closed this as completed in daeae61 Feb 14, 2023
newhoggy added a commit to IntersectMBO/cardano-cli that referenced this issue May 24, 2023
4885: Disallow empty cost model for create update proposal r=newhoggy a=newhoggy

```
$ cardano-cli governance create-update-proposal --epoch 50 --max-block-execution-units '(20000000000,62000000)' --cost-model-file ~/Downloads/cost-model-secp-preprod-mainnet.json --protocol-major-version 8 --protocol-minor-version 0 --genesis-verification-key-file example/genesis-keys/genesis1.vkey --out-file update.proposal
Command failed: governance create-update-proposal  Error: The decoded cost model was empty at: /Users/jky/Downloads/cost-model-secp-preprod-mainnet.json
```

Resolves IntersectMBO/cardano-node#4867

Co-authored-by: John Ky <john.ky@iohk.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something is not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants