-
Notifications
You must be signed in to change notification settings - Fork 749
Open
Labels
Description
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:
- Call
createTestnetEnv(producing aTestnetEnv) - Call
cardanoTestneton the resultingTestnetEnv
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
- cardano-testnet: Default to UpdateTimestamps in the UserProvidedEnv branch #6455 (UpdateTimestamps default)
- cardano-testnet: Recompute genesis hashes in configuration.yaml if missing #6456 (genesis hashes recomputation)
- cardano-testnet: Wrap env into opaque TestnetEnv type with smart constructors #6463 (opaque TestnetEnv — so both paths use the same types)
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)
Reactions are currently unavailable