IntersectMBO / IntersectMBO/cardano-cli

[FR] - Input cost models validation

Open
#928 15 comments 0 reactions 0 assignees View on GitHub
enhancement Stale
Dominant language
Haskell
Stars
71
Forks
24
Avg merge
23h 40m
Merged PRs (30d)
14

Description

**Internal/External**
*Internal*

**Area**
*Other*

**Context**
When providing plutus cost models as an input to cardano-cli:
* as a map
* excess parameters are ignored, only existing parameters are checked.
* If the existing parameters are missing, the parsing fails and the error is reported.
* as a list
* lists longer than expected are consumed up to the number of existing parameters - excess parameters are ignored.
* If the list of cost model parameters is too short, the missing parameters are defaulted to `maxBound :: Int64` and no error is reported.

**Description**
When an user provides a cost model containing too many or not enough parameters, `cardano-cli` should fail with an appropriate message.

**Additional info**
The original issue:
* https://github.com/IntersectMBO/cardano-cli/issues/924#issuecomment-2397366588

The v2 cost models included in Alonzo Genesis validation and conversion was implemented in
* https://github.com/IntersectMBO/cardano-api/pull/564/ - parts of the logic potentially can be reused for this as well.

New strict validations in ledger for cost models in geneses:
- https://github.com/IntersectMBO/cardano-ledger/pull/5241

Relevant changes in cardano-api (part of node-10.6 release):
- https://github.com/IntersectMBO/cardano-api/pull/958

>[!WARNING]
>***Needs clarification***: Which cost models should we cover with this validation? V1? V2? V3?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.