Skip to content

Commit b19c292

Browse files
committed
Basic Dijkstra era prep in cardano-profile
1 parent 0614f23 commit b19c292

File tree

2 files changed

+22
-16
lines changed

2 files changed

+22
-16
lines changed

bench/cardano-profile/cardano-profile.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ common project-config
4242
-Wpartial-fields
4343
-Wredundant-constraints
4444
-Wwarn=deprecations
45+
-fdefer-typed-holes -Wno-typed-holes
4546

4647
library
4748
import: project-config

bench/cardano-profile/src/Cardano/Benchmarking/Profile/Types.hs

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -247,30 +247,33 @@ instance Aeson.FromJSON Topology where
247247

248248
--------------------------------------------------------------------------------
249249

250-
data Era = Shelley | Allegra | Mary | Alonzo | Babbage | Conway
250+
data Era = Shelley | Allegra | Mary | Alonzo | Babbage | Conway | Dijkstra
251251
deriving (Show, Eq, Ord, Generic)
252252

253253
instance Aeson.ToJSON Era where
254-
toJSON Allegra = Aeson.toJSON ("allegra" :: Text.Text)
255-
toJSON Shelley = Aeson.toJSON ("shelley" :: Text.Text)
256-
toJSON Mary = Aeson.toJSON ("mary" :: Text.Text)
257-
toJSON Alonzo = Aeson.toJSON ("alonzo" :: Text.Text)
258-
toJSON Babbage = Aeson.toJSON ("babbage" :: Text.Text)
259-
toJSON Conway = Aeson.toJSON ("conway" :: Text.Text)
254+
toJSON Allegra = Aeson.toJSON ("allegra" :: Text.Text)
255+
toJSON Shelley = Aeson.toJSON ("shelley" :: Text.Text)
256+
toJSON Mary = Aeson.toJSON ("mary" :: Text.Text)
257+
toJSON Alonzo = Aeson.toJSON ("alonzo" :: Text.Text)
258+
toJSON Babbage = Aeson.toJSON ("babbage" :: Text.Text)
259+
toJSON Conway = Aeson.toJSON ("conway" :: Text.Text)
260+
toJSON Dijkstra = Aeson.toJSON ("dijkstra" :: Text.Text)
260261

261262
instance Aeson.FromJSON Era where
262263
parseJSON = Aeson.withText "Era" $ \t -> case t of
263-
"allegra" -> return Allegra
264-
"shelley" -> return Shelley
265-
"mary" -> return Mary
266-
"alonzo" -> return Alonzo
267-
"babbage" -> return Babbage
268-
"conway" -> return Conway
269-
_ -> fail $ "Unknown Era: \"" ++ Text.unpack t ++ "\""
264+
"allegra" -> return Allegra
265+
"shelley" -> return Shelley
266+
"mary" -> return Mary
267+
"alonzo" -> return Alonzo
268+
"babbage" -> return Babbage
269+
"conway" -> return Conway
270+
"dijkstra" -> return Dijkstra
271+
_ -> fail $ "Unknown Era: \"" ++ Text.unpack t ++ "\""
270272

271273
-- | Minimal major protocol version per era
272274
firstEraForMajorVersion :: Int -> Era
273275
firstEraForMajorVersion pv
276+
| pv >= _ = Dijkstra -- TODO: (@russoul)
274277
| pv >= 9 = Conway
275278
| pv >= 7 = Babbage
276279
| pv >= 5 = Alonzo
@@ -296,6 +299,7 @@ cf. https://github.com/cardano-foundation/CIPs/blob/master/CIP-0059/feature-tabl
296299
| 2024/09 | Voltaire | Conway | 133660855 | 507 | 9,0 | Praos | Ouroboros Genesis/Praos | Chang HF |
297300
| 2025/01 | Voltaire | Conway | 146620809 | 537 | 10,0 | Praos | Ouroboros Genesis/Praos | Plomin HF |
298301
-}
302+
-- TODO: Update the table (@russoul)
299303

300304
--------------------------------------------------------------------------------
301305

@@ -311,6 +315,7 @@ data Genesis = Genesis
311315
, shelley :: KM.KeyMap Aeson.Value
312316
, alonzo :: KM.KeyMap Aeson.Value
313317
, conway :: Maybe (KM.KeyMap Aeson.Value) -- TODO: Remove the null.
318+
-- TODO: Should anything be added for Dijkstra (@russoul)?
314319

315320
-- Absolute durations:
316321
, slot_duration :: Time.NominalDiffTime
@@ -367,7 +372,7 @@ instance Aeson.FromJSON ChainDB where
367372
(Aeson.defaultOptions {Aeson.rejectUnknownFields = True})
368373

369374
data Chunks = Chunks
370-
{
375+
{
371376
chaindb_server :: Integer
372377
, explorer_chunk :: Integer
373378
}
@@ -390,7 +395,7 @@ instance Aeson.FromJSON Chunks where
390395
--------------------------------------------------------------------------------
391396

392397
data Node = Node
393-
{
398+
{
394399
utxo_lmdb :: Bool
395400
, ssd_directory :: Maybe String
396401

0 commit comments

Comments
 (0)