- 
                Notifications
    You must be signed in to change notification settings 
- Fork 482
Tool to dump cost model parameters in order expected by ledger #7171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| 
 | 
| s -> Left $ "Unknown ledger language version: " ++ s | ||
|  | ||
| whichll :: Parser WhichLL | ||
| whichll = | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation is inconsistent across newly added files,
do you mind applying Fourmolu to all the Haskell code in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mind applying Fourmolu to all the Haskell code in this PR?
I've done that, but then stylish-haskell changed some of it back when I committed the changes.  Specifically, it lined up the ->s in case expressions and also the -#}s at the end of the pragmas at the start.  I like both of those better than what Fourmolu does, but you might object!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure but I think that also Fourmolu aligned let ... in ... like this
  let xxx
   in yyy
and stylish-haskell changed it back to
  let xxx
  in yyy
The first one looks a bit strange to me but I see why it's done it.  It's a pity that let and in don't have the same number of letters...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (modulo formatting)
Fixes https://github.com/IntersectMBO/plutus-private/issues/1650.
The ledger and the procol parameters view the cost model parameters as a list of integers with no other information. This makes them quite difficult to deal with (in particular to check that they're in the right order). This PR adds a simple tool to dump the cost model parameters in the expected order, in various formats including the JSON format used by
cardano-cli. See the attached files for examples of the output.cost-model-parameters-untagged.txt
cost-model-parameters-tagged.txt
cost-model-parameters-json.txt
The
uplcexecutable has adump-cost-modelcommand, but that doesn't know anything aboutplutus-ledger-apiand just produces a list ordered by parameter name,