fix(scripts): sync cost model genesis values with mainnet - #148
Merged
Conversation
2 tasks
…aConfig jq
Cluster genesis specs still carried Conway-launch cost model values.
genesis.conway.spec.json (all 3 variants) had PlutusV3 at 251 entries;
local_slow's cost_models_list.json was already ahead at 297. Mainnet
has since raised cost models via governance (V1=332, V2=332, V3=350
as of epoch 640, from Koios API).
common.sh and common-start-fast/common-start-slow additionally
truncated PlutusV2/V3 cost models back down on every cluster start
via jq, discarding correct genesis values. Removed those truncations
entirely, not replaced with anything.
Also removed a redundant extraConfig re-injection jq block from
common-start-fast. The extraConfig field itself is untouched and
still present in all three variants' genesis spec files; it was
always inert (nothing reads it), only the jq that copied it into
the generated genesis output is gone.
Per-variant end state, each verified by actually running the
cluster:
local_fast / mainnet_fast: genesis only, no extra code, reaches
PlutusV1=332, PlutusV2=185, PlutusV3=350. PlutusV1/V3 pass through
the spec unchanged; cardano-cli genesis create-staked hard-caps
PlutusV2 at exactly 185 regardless of spec or extraConfig content,
confirmed by isolated testing against two different cardano-cli
versions (10.11.1.0 and 11.1.0.0).
local_slow: genesis stays at the original historical values
(genesis.alonzo.spec.json is byte-identical to master, untouched).
PlutusV1 stays at 166 throughout. PlutusV2 starts at 175 in genesis
and grows to 185 through the historical era-transition proposals
(Alonzo-PV6, Babbage), then the existing PV9 governance flow
asserts it lands at 185. cost_models_list.json's PlutusV1/V2 arrays
are the original historical bytes; only PlutusV3 was updated
(297 to 350), matching genesis.conway.spec.json byte for byte.
Open question, not resolved here: reaching PlutusV2=332 on
local_fast/mainnet_fast would need a governance action submitted
after genesis, the same pattern local_slow's PV9 test already uses.
extraConfig does not do this. Whether to add that is a decision for
review, not made in this commit.
Verified: make lint passes; local_fast and mainnet_fast both report
protocol-parameters {PlutusV1: 332, PlutusV2: 185, PlutusV3: 350};
local_slow completes the full Byron to Conway startup with the PV9
proposal enacting and the hard fork to Conway PV10 succeeding; the
full cardano-node-tests pytest suite (test_pparam_update,
test_pparam_keys, test_legacy_proposal_submit variants,
test_incompatible_cost_models, test_node_upgrade.py::
test_update_cost_models) passes against the resulting cluster.
OlufemiAdeOlusile
force-pushed
the
sync-mainnet-cost-models
branch
from
July 19, 2026 13:36
c9b2205 to
ff45c9f
Compare
mkoura
approved these changes
Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
genesis.conway.spec.json, all 3 variants) still carried the Conway-launch PlutusV3 length (251 entries);local_slow'scost_models_list.jsonwas already ahead at 297. Mainnet has since raised cost models via governance (V1=332, V2=332, V3=350 as of epoch 640).common.shandcommon-start-fast/common-start-slowadditionally truncated PlutusV2/V3 cost models back down to the old lengths on every cluster start viajq, silently discarding correct genesis values. Removed those truncations from common code entirely (not re-added anywhere).extraConfigre-injection jq block fromcommon-start-fastper review feedback - theextraConfigfield itself is untouched and still present in all three variants' genesis spec files (it was always inert; only the jq that copied it into the generated genesis output is gone).Per-variant end state (verified by actually running each)
local_fast/mainnet_fast: genesis only, no extra jq/code -{PlutusV1: 332, PlutusV2: 185, PlutusV3: 350}.PlutusV1/PlutusV3pass through the spec unchanged;cardano-cli genesis create-stakedhard-capsPlutusV2at exactly 185 regardless of spec/extraConfigcontent, confirmed by isolated testing against two differentcardano-cliversions (10.11.1.0, 11.1.0.0).local_slow: genesis intentionally stays at the original historical values -genesis.alonzo.spec.jsonis byte-identical to master, not touched by this PR net of all commits.PlutusV1stays at 166 throughout (genesis andcost_models_list.jsonboth 166, never changes).PlutusV2starts at 175 in genesis and grows to 185 through the historical era-transition proposals (Alonzo-PV6/Babbage), then the existing PV9 governance flow (_update_cost_model_in_pv9/_wait_pv9_cost_model_enacted, usingcost_models_list.json) explicitly asserts it lands at 185.cost_models_list.json's PlutusV1/V2 arrays are the original historical bytes (master's own values); only PlutusV3 was updated (297 -> 350), matchinggenesis.conway.spec.jsonbyte for byte.Open question, not resolved in this PR: reaching PlutusV2=332 (full current-mainnet value) on
local_fast/mainnet_fastwould require a governance action submitted after genesis (the same patternlocal_slow's PV9 test already uses) -extraConfigdoes not do this; nothing reads it. A governance-action mechanism was added and tested (confirmed working), then reverted after re-reading the review feedback as asking for jq removal only, not new logic. Whether to add it back is a decision for review, not made in this PR.Test plan
make lintpasseslocal_fast:cardano-cli query protocol-parametersreports{PlutusV1: 332, PlutusV2: 185, PlutusV3: 350}mainnet_fast: same result, confirmedlocal_slow: full Byron -> Conway startup completes, PV9 cost model proposal enacts, hard-fork to Conway PV10 succeeds; final state{PlutusV1: 166, PlutusV2: 185, PlutusV3: 350}{332,185,350}state:test_pparam_update,test_pparam_keys, 8xtest_legacy_proposal_submit,test_incompatible_cost_models,test_node_upgrade.py::test_update_cost_models- all pass