IntersectMBO / cardano-api

Cardano API
Apache License 2.0
26 stars 23 forks source link

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

Open carbolymer opened 7 months ago

carbolymer commented 7 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 7 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 6 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 5 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 1 month ago

This issue was closed because it has been stalled for 120 days with no activity. Remove stale label or comment or this will be closed in 60 days.

github-actions[bot] commented 2 weeks 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.