Skip to content

Commit 8e05252

Browse files
committed
Add EnableFutureGenesis to db-sync config
Fixes #1674
1 parent d5e5b84 commit 8e05252

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

cardano-db-sync/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
## Next
44
* Added an optional feature to store CBOR serialized transactions in `tx_cbor` table [#1723]
55

6+
## 13.2.0.2
7+
* Support node 8.9.x
8+
* Add a new db-sync config field `EnableFutureGenesis`. When false or missing, the conway genesis file is ignored
9+
610
## 13.2.0.1
711
* Added a new table `epoch_stake_progress` which indicates when `epoch_stake` is completed
812
* Uses the cache for the computation of `epoch` table when following

cardano-db-sync/src/Cardano/DbSync/Config.hs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,13 @@ coalesceConfig pcfg ncfg adjustGenesisPath = do
7676
, dncAlonzoGenesisFile = adjustGenesisFilePath adjustGenesisPath (ncAlonzoGenesisFile ncfg)
7777
, dncAlonzoGenesisHash = ncAlonzoGenesisHash ncfg
7878
, dncConwayGenesisFile =
79-
adjustGenesisFilePath adjustGenesisPath <$> ncConwayGenesisFile ncfg
80-
, dncConwayGenesisHash = ncConwayGenesisHash ncfg
79+
if pcEnableFutureGenesis pcfg
80+
then adjustGenesisFilePath adjustGenesisPath <$> ncConwayGenesisFile ncfg
81+
else Nothing
82+
, dncConwayGenesisHash =
83+
if pcEnableFutureGenesis pcfg
84+
then ncConwayGenesisHash ncfg
85+
else Nothing
8186
, dncByronProtocolVersion = ncByronProtocolVersion ncfg
8287
, dncShelleyHardFork = ncShelleyHardFork ncfg
8388
, dncAllegraHardFork = ncAllegraHardFork ncfg

cardano-db-sync/src/Cardano/DbSync/Config/Types.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ data SyncPreConfig = SyncPreConfig
141141
{ pcNetworkName :: !NetworkName
142142
, pcLoggingConfig :: !Logging.Representation
143143
, pcNodeConfigFile :: !NodeConfigFile
144+
, pcEnableFutureGenesis :: !Bool
144145
, pcEnableLogging :: !Bool
145146
, pcEnableMetrics :: !Bool
146147
, pcPrometheusPort :: !Int
@@ -366,6 +367,7 @@ parseGenSyncNodeConfig o =
366367
<$> fmap NetworkName (o .: "NetworkName")
367368
<*> parseJSON (Object o)
368369
<*> fmap NodeConfigFile (o .: "NodeConfigFile")
370+
<*> fmap (fromMaybe False) (o .:? "EnableFutureGenesis")
369371
<*> o .: "EnableLogging"
370372
<*> o .: "EnableLogMetrics"
371373
<*> fmap (fromMaybe 8080) (o .:? "PrometheusPort")

0 commit comments

Comments
 (0)