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 a TestnetEnv)
- 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)