IntersectMBO / IntersectMBO/cardano-api

[FR] - Change representation of cost models in the code to JSON string

Open
#505 18 comments 1 reaction 0 assignees View on GitHub
Dominant language
Haskell
Stars
40
Forks
30
Avg merge
2d 5h
Merged PRs (30d)
30

Description

**Internal/External**
*Internal*

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

**Describe the feature you'd like**
Currently cost models are represented [as an array with hard to understand values](https://github.com/IntersectMBO/cardano-api/blob/0eacd1f83ee20f19072a4b8d2a5d7cd27c0f088b/cardano-api/internal/Cardano/Api/Genesis.hs#L243). To make maintenance easier, they should be stored as JSON string in haskell (quasiquoted preferably). The cost model should be also linked to the original location in plutus repository in the code comment: https://github.com/IntersectMBO/plutus/blob/master/plutus-core/cost-model/data/builtinCostModel.json

A validation logic implemented in `cardano-testnet` would be nice to have: https://github.com/IntersectMBO/cardano-node/blob/cd3c037fa6d2f836794012f806cd32edfcf31763/cardano-testnet/src/Testnet/Defaults.hs#L88

**Describe alternatives you've considered**
n/a

**Additional context / screenshots**
n/a

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.