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

Open
#505 19 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
haskell
Domain
backend

Research direction

Start in internal/Cardano/Api/Genesis.hs at the cost-model representation, then compare it with plutus-core/cost-model/data/builtinCostModel.json. Review cardano-testnet/src/Testnet/Defaults.hs for the referenced validation approach. Done means cost models are represented as a readable JSON string in Haskell, with the original Plutus location documented and validation addressed if included.

Written by the indexing model from the issue text.

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. 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

Dominant language
Haskell
Stars
41
Forks
33
Avg merge
3d 3h
Merged PRs (30d)
15

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from IntersectMBO/cardano-api

All issues in IntersectMBO/cardano-api

Similar issues

More Haskell issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.