@@ -34,7 +34,8 @@ import Cardano.Tracing.OrphanInstances.Network ()
34
34
import Ouroboros.Consensus.Mempool (MempoolCapacityBytes (.. ),
35
35
MempoolCapacityBytesOverride (.. ))
36
36
import qualified Ouroboros.Consensus.Node as Consensus (NetworkP2PMode (.. ))
37
- import Ouroboros.Consensus.Storage.LedgerDB.DiskPolicy (SnapshotInterval (.. ))
37
+ import Ouroboros.Consensus.Storage.LedgerDB.DiskPolicy (NumOfDiskSnapshots (.. ),
38
+ SnapshotInterval (.. ))
38
39
import Ouroboros.Network.NodeToNode (AcceptedConnectionsLimit (.. ), DiffusionMode (.. ))
39
40
import Ouroboros.Network.PeerSelection.PeerSharing (PeerSharing (.. ))
40
41
@@ -101,8 +102,9 @@ data NodeConfiguration
101
102
, ncProtocolConfig :: ! NodeProtocolConfiguration
102
103
103
104
-- Node parameters, not protocol-specific:
104
- , ncDiffusionMode :: ! DiffusionMode
105
- , ncSnapshotInterval :: ! SnapshotInterval
105
+ , ncDiffusionMode :: ! DiffusionMode
106
+ , ncNumOfDiskSnapshots :: ! NumOfDiskSnapshots
107
+ , ncSnapshotInterval :: ! SnapshotInterval
106
108
107
109
-- | During the development and integration of new network protocols
108
110
-- (node-to-node and node-to-client) we wish to be able to test them
@@ -182,8 +184,9 @@ data PartialNodeConfiguration
182
184
, pncProtocolConfig :: ! (Last NodeProtocolConfiguration )
183
185
184
186
-- Node parameters, not protocol-specific:
185
- , pncDiffusionMode :: ! (Last DiffusionMode )
186
- , pncSnapshotInterval :: ! (Last SnapshotInterval )
187
+ , pncDiffusionMode :: ! (Last DiffusionMode )
188
+ , pncNumOfDiskSnapshots :: ! (Last NumOfDiskSnapshots )
189
+ , pncSnapshotInterval :: ! (Last SnapshotInterval )
187
190
, pncExperimentalProtocolsEnabled :: ! (Last Bool )
188
191
189
192
-- BlockFetch configuration
@@ -241,6 +244,8 @@ instance FromJSON PartialNodeConfiguration where
241
244
pncSocketPath <- Last <$> v .:? " SocketPath"
242
245
pncDiffusionMode
243
246
<- Last . fmap getDiffusionMode <$> v .:? " DiffusionMode"
247
+ pncNumOfDiskSnapshots
248
+ <- Last . fmap RequestedNumOfDiskSnapshots <$> v .:? " NumOfDiskSnapshots"
244
249
pncSnapshotInterval
245
250
<- Last . fmap RequestedSnapshotInterval <$> v .:? " SnapshotInterval"
246
251
pncExperimentalProtocolsEnabled <- fmap Last $ do
@@ -320,6 +325,7 @@ instance FromJSON PartialNodeConfiguration where
320
325
pncProtocolConfig
321
326
, pncSocketConfig = Last . Just $ SocketConfig mempty mempty mempty pncSocketPath
322
327
, pncDiffusionMode
328
+ , pncNumOfDiskSnapshots
323
329
, pncSnapshotInterval
324
330
, pncExperimentalProtocolsEnabled
325
331
, pncMaxConcurrencyBulkSync
@@ -490,6 +496,7 @@ defaultPartialNodeConfiguration =
490
496
, pncLoggingSwitch = Last $ Just True
491
497
, pncSocketConfig = Last . Just $ SocketConfig mempty mempty mempty mempty
492
498
, pncDiffusionMode = Last $ Just InitiatorAndResponderDiffusionMode
499
+ , pncNumOfDiskSnapshots = Last $ Just DefaultNumOfDiskSnapshots
493
500
, pncSnapshotInterval = Last $ Just DefaultSnapshotInterval
494
501
, pncExperimentalProtocolsEnabled = Last $ Just False
495
502
, pncTopologyFile = Last . Just $ TopologyFile " configuration/cardano/mainnet-topology.json"
@@ -541,6 +548,7 @@ makeNodeConfiguration pnc = do
541
548
logMetrics <- lastToEither " Missing LogMetrics" $ pncLogMetrics pnc
542
549
traceConfig <- first Text. unpack $ partialTraceSelectionToEither $ pncTraceConfig pnc
543
550
diffusionMode <- lastToEither " Missing DiffusionMode" $ pncDiffusionMode pnc
551
+ numOfDiskSnapshots <- lastToEither " Missing NumOfDiskSnapshots" $ pncNumOfDiskSnapshots pnc
544
552
snapshotInterval <- lastToEither " Missing SnapshotInterval" $ pncSnapshotInterval pnc
545
553
shutdownConfig <- lastToEither " Missing ShutdownConfig" $ pncShutdownConfig pnc
546
554
socketConfig <- lastToEither " Missing SocketConfig" $ pncSocketConfig pnc
@@ -609,6 +617,7 @@ makeNodeConfiguration pnc = do
609
617
, ncProtocolConfig = protocolConfig
610
618
, ncSocketConfig = socketConfig
611
619
, ncDiffusionMode = diffusionMode
620
+ , ncNumOfDiskSnapshots = numOfDiskSnapshots
612
621
, ncSnapshotInterval = snapshotInterval
613
622
, ncExperimentalProtocolsEnabled = experimentalProtocols
614
623
, ncMaxConcurrencyBulkSync = getLast $ pncMaxConcurrencyBulkSync pnc
0 commit comments