IntersectMBO / cardano-api

Cardano API
Apache License 2.0
22 stars 19 forks source link

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

Open carbolymer opened 5 months ago

carbolymer commented 5 months ago

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

Jimbo4350 commented 5 months ago

haskell (quasiquoted preferably)

We could also store it as a list we will mconcat:

mconcat [ "parameterName: ", show @Int 123456
        , ...
        ]
github-actions[bot] commented 4 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 120 days.

github-actions[bot] commented 3 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 120 days.