Skip to content

cardano-testnet: Recompute genesis hashes in configuration.yaml if missing #6456

@palas

Description

@palas

Problem

create-env deliberately writes configuration.yaml without genesis hashes (WithoutHashes), so users can edit genesis files without recomputing hashes. However, cardanoTestnet (the runtime phase) never rewrites configuration.yaml, so when using cardano --node-env, the config lacks hashes entirely.

In the direct cardano path, createTestnetEnv uses WithHashes, so the config always has hashes. This is an inconsistency between the two paths.

Proposed fix

At the start of cardanoTestnet in Testnet/Start/Cardano.hs (~L241), after reading the config file, check if ByronGenesisHash key is present. If not, call createConfigJson and rewrite configuration.yaml. This is ~15 lines of additive code. If hashes are already present, nothing changes.

Depends on

None (independent)

Type: Consistency fix

Effort: Low (~15 lines)

Risk: Low

Metadata

Metadata

Assignees

Labels

minorfixSomething that needs to be fixed (e.g. a hard-coded constant), but that isnt a bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions