Skip to content

Commit 6c0373b

Browse files
authored
Merge pull request #6466 from IntersectMBO/default-to-update-timestamps
cardano-testnet: Default to `--update-time` and add `--no-update-time` flag
2 parents 51b6046 + 2344c52 commit 6c0373b

4 files changed

Lines changed: 21 additions & 9 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
### Added
2+
3+
- Added `--preserve-timestamps` flag. When set, genesis file timestamps are kept as-is.
4+
5+
### Changed
6+
7+
- Timestamps in genesis files are now updated to the current date by default.
8+
- The `--update-time` flag is now internal (hidden, kept for backward compatibility).
9+

cardano-testnet/src/Parsers/Cardano.hs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,14 @@ pMainnetParams = OA.flag' OnChainParamsMainnet
134134
)
135135

136136
pUpdateTimestamps :: Parser UpdateTimestamps
137-
pUpdateTimestamps = OA.flag DontUpdateTimestamps UpdateTimestamps
138-
( OA.long "update-time"
139-
<> OA.help "Update the time stamps in genesis files to current date"
140-
<> OA.showDefault
141-
)
137+
pUpdateTimestamps =
138+
-- Default to UpdateTimestamps, because when using the two-step flow
139+
-- (cardano-testnet create-env → cardano-testnet cardano --node-env),
140+
-- genesis timestamps can become stale.
141+
-- See https://github.com/IntersectMBO/cardano-node/issues/6455
142+
OA.flag' UpdateTimestamps (OA.long "update-time" <> OA.help "Update the time stamps in genesis files to current date (default, kept for backward compatibility)" <> OA.internal)
143+
<|> OA.flag' DontUpdateTimestamps (OA.long "preserve-timestamps" <> OA.help "Do not update the time stamps in genesis files to current date.")
144+
<|> pure UpdateTimestamps
142145

143146
pEnvOutputDir :: Parser FilePath
144147
pEnvOutputDir = OA.strOption

cardano-testnet/test/cardano-testnet-golden/files/golden/help.cli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Usage: cardano-testnet cardano [--num-pool-nodes COUNT]
1313
[--slot-length SECONDS]
1414
[--active-slots-coeff DOUBLE]
1515
[--node-env FILEPATH]
16-
[--update-time]
16+
[--preserve-timestamps]
1717
[--params-file FILEPATH | --params-mainnet]
1818

1919
Start a testnet and keep it running until stopped

cardano-testnet/test/cardano-testnet-golden/files/golden/help/cardano.cli

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Usage: cardano-testnet cardano [--num-pool-nodes COUNT]
1111
[--slot-length SECONDS]
1212
[--active-slots-coeff DOUBLE]
1313
[--node-env FILEPATH]
14-
[--update-time]
14+
[--preserve-timestamps]
1515
[--params-file FILEPATH | --params-mainnet]
1616

1717
Start a testnet and keep it running until stopped
@@ -51,8 +51,8 @@ Available options:
5151
otherwise). You can generate a default environment
5252
with the 'create-env' command, then modify it and
5353
pass it with this argument.
54-
--update-time Update the time stamps in genesis files to current
55-
date
54+
--preserve-timestamps Do not update the time stamps in genesis files to
55+
current date.
5656
--params-file FILEPATH File containing custom on-chain parameters in
5757
Blockfrost format:
5858
https://docs.blockfrost.io/#tag/cardano--epochs/GET/epochs/latest/parameters

0 commit comments

Comments
 (0)