Kwxm/costing/restore old cost model param names #5932
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The changes in #5857 caused some of the cost model parameter names (for
equalsByteString
andequalsString
) to change, which introduced a conflict with some of the names in the Alonzo genesis file. The parameter names changed because one of the costing function types had a linear function hard coded into it and I replaced it with something where you could have a more general type. I've now added the more specific type back: it's redundant but it has the right names. See this Note for more information.A few other points:
FromJSON/ToJson
methods. A better way to solve our problem might be to write customFromJSON/ToJSON
instances that convert the restrictedlinear_on_diagonal
tag to the more generalConstantOffDiagonal
constructor, so that we'd have a sort of syntactic sugar that could convert the JSON encoding of our old types into the internal version of our new types. That might take some time though, so I've gone for a quicker fix here.plutus-ledger-api
and I think it'll also depend on the work that's currently in progress on allowing configurable cost models (see here for example, although there's more work to be done).