Skip to content

cardano-testnet: Unify direct cardano path to structurally match create-env + cardano --node-env #6464

@palas

Description

@palas

Problem

The direct cardano path (no --node-env) and the two-step path (create-env then cardano --node-env) are implemented as separate code branches in Parsers/Run.hs. Even after the earlier consistency fixes, they can drift again over time as maintenance adds new features to one branch but not the other.

Proposed fix

Replace the NoUserProvidedEnv branch in runCardanoOptions so that it structurally performs the same sequence as the two-step path:

  1. Call createTestnetEnv (producing a TestnetEnv)
  2. Call cardanoTestnet on the resulting TestnetEnv

This makes the direct path literally "create-env then run" in one process. The code becomes:

NoUserProvidedEnv -> do
  env <- createTestnetEnv ...
  cardanoTestnet runtimeOpts env

~5 lines changed in Parsers/Run.hs. After this, there is only one implementation of each phase, and the direct path is just "both phases back-to-back."

Depends on

Type: Refactoring

Effort: Low (~5 lines)

Risk: Medium (changes observable behaviour of direct path — hashes now computed at boot, timestamps may shift; needs integration testing)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions