In #2792 we changed the FromJSONCostModels instance to translate the legacy Plutus V1 cost model parameter names to the current ones, thus keeping the Alonzo genesis file unchanged. The ToJSON instance was unchanged. This means that there are cost model params cmps where (fromJSON . toJSON) cmps =/= cmps.
We could change the Alonzo genesis config if we wanted to, but this comes with it's own set of troubles. (ie, we could use a list of integers, as the CBOR instances do, and fill in the keys on deserialization).
We could also remove the validation from JSON instances, and provide translation tools and validation tools.
In #2792 we changed the
FromJSON
CostModels
instance to translate the legacy Plutus V1 cost model parameter names to the current ones, thus keeping the Alonzo genesis file unchanged. TheToJSON
instance was unchanged. This means that there are cost model paramscmps
where(fromJSON . toJSON) cmps =/= cmps
.We could change the Alonzo genesis config if we wanted to, but this comes with it's own set of troubles. (ie, we could use a list of integers, as the CBOR instances do, and fill in the keys on deserialization).
We could also remove the validation from JSON instances, and provide translation tools and validation tools.
Maybe there are other options?