Skip to content

Cost model fails to parse on local network for Alonzo #518

@SebastienGllmt

Description

@SebastienGllmt

localhost chain configurations such as yaci-devkit and hydra store the cost model as an array

Note that this is different from the mainnet configurations where the cost model is instead stored as a map

I asked why these localhost networks use a different format, and got the following answer

Both maps and arrays are supported in genesis files. Internally, the cost model is represented as an array.

Hydra devnet genesis files follows the same approach as DevKit. Sanchonet also used an array

This is critical for the devnet environment, as we don’t need to go through protocol parameter updates or governance actions to update the cost models there. Such updates would take at least one or two epochs to become effective.

Sometime cardano-cli also returns array, so it is sometime easy to just copy the latest protocol params from cardano-cli and paste to devkit template.

If you pass an array currently, Dingo fails with

{
"time":"2025-03-24T08:24:05.899219265+09:00",
"level":"ERROR",
"msg":"json: cannot unmarshal array into Go struct field AlonzoGenesis.CostModels of type map[string]int"
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions