diff --git a/bench/cardano-profile/cardano-profile.cabal b/bench/cardano-profile/cardano-profile.cabal index a9550d9a2af..fa5692ca1ea 100644 --- a/bench/cardano-profile/cardano-profile.cabal +++ b/bench/cardano-profile/cardano-profile.cabal @@ -42,6 +42,7 @@ common project-config -Wpartial-fields -Wredundant-constraints -Wwarn=deprecations + -fdefer-typed-holes -Wno-typed-holes library import: project-config diff --git a/bench/cardano-profile/src/Cardano/Benchmarking/Profile.hs b/bench/cardano-profile/src/Cardano/Benchmarking/Profile.hs index 59f2c7b2ceb..c15796e0722 100644 --- a/bench/cardano-profile/src/Cardano/Benchmarking/Profile.hs +++ b/bench/cardano-profile/src/Cardano/Benchmarking/Profile.hs @@ -202,7 +202,7 @@ overlay profile = -- "derive" needs above "shelley", "alonzo" and "conway" properties. derive :: Types.Profile -> Types.Profile derive p@(Types.Profile _ _ _ comp _era gsis _ n gtor _ _ _ ana _ _ _ _) = - let + let -- Absolute/epoch durations: ---------------------------- slot_duration = Types.slot_duration gsis -- NominalDiffTime @@ -403,7 +403,7 @@ cliArgs p@(Types.Profile _ _ _ comp __ gsis _ _ _ _ _ _ _ dved _ _ _) = ++ if Types.dense_pool_density comp /= 1 then - [ + [ Aeson.String "--bulk-pool-cred-files", Aeson.Number $ fromInteger $ Types.n_dense_hosts comp , Aeson.String "--bulk-pools-per-file", Aeson.Number $ fromInteger $ Types.dense_pool_density comp ] @@ -480,12 +480,13 @@ addEras :: Map.Map String Types.Profile -> Map.Map String Types.Profile addEras = foldMap (\profile -> Map.fromList $ catMaybes - [ addEra profile Types.Shelley "shey" - , addEra profile Types.Allegra "alra" - , addEra profile Types.Mary "mary" - , addEra profile Types.Alonzo "alzo" - , addEra profile Types.Babbage "bage" - , addEra profile Types.Conway "coay" + [ addEra profile Types.Shelley "shey" + , addEra profile Types.Allegra "alra" + , addEra profile Types.Mary "mary" + , addEra profile Types.Alonzo "alzo" + , addEra profile Types.Babbage "bage" + , addEra profile Types.Conway "coay" + , addEra profile Types.Dijkstra "dira" ] ) diff --git a/bench/cardano-profile/src/Cardano/Benchmarking/Profile/Primitives.hs b/bench/cardano-profile/src/Cardano/Benchmarking/Profile/Primitives.hs index dcbc2535f6f..3fa878f2cb0 100644 --- a/bench/cardano-profile/src/Cardano/Benchmarking/Profile/Primitives.hs +++ b/bench/cardano-profile/src/Cardano/Benchmarking/Profile/Primitives.hs @@ -157,6 +157,7 @@ empty = Types.Profile { , Types.shelley = mempty , Types.alonzo = mempty , Types.conway = Nothing + , Types.dijkstra = Nothing , Types.slot_duration = 0 , Types.epoch_length = 0 , Types.active_slots_coeff = 0 diff --git a/bench/cardano-profile/src/Cardano/Benchmarking/Profile/Types.hs b/bench/cardano-profile/src/Cardano/Benchmarking/Profile/Types.hs index 18397b1712f..e5d6cf5cfa0 100644 --- a/bench/cardano-profile/src/Cardano/Benchmarking/Profile/Types.hs +++ b/bench/cardano-profile/src/Cardano/Benchmarking/Profile/Types.hs @@ -247,30 +247,33 @@ instance Aeson.FromJSON Topology where -------------------------------------------------------------------------------- -data Era = Shelley | Allegra | Mary | Alonzo | Babbage | Conway +data Era = Shelley | Allegra | Mary | Alonzo | Babbage | Conway | Dijkstra deriving (Show, Eq, Ord, Generic) instance Aeson.ToJSON Era where - toJSON Allegra = Aeson.toJSON ("allegra" :: Text.Text) - toJSON Shelley = Aeson.toJSON ("shelley" :: Text.Text) - toJSON Mary = Aeson.toJSON ("mary" :: Text.Text) - toJSON Alonzo = Aeson.toJSON ("alonzo" :: Text.Text) - toJSON Babbage = Aeson.toJSON ("babbage" :: Text.Text) - toJSON Conway = Aeson.toJSON ("conway" :: Text.Text) + toJSON Allegra = Aeson.toJSON ("allegra" :: Text.Text) + toJSON Shelley = Aeson.toJSON ("shelley" :: Text.Text) + toJSON Mary = Aeson.toJSON ("mary" :: Text.Text) + toJSON Alonzo = Aeson.toJSON ("alonzo" :: Text.Text) + toJSON Babbage = Aeson.toJSON ("babbage" :: Text.Text) + toJSON Conway = Aeson.toJSON ("conway" :: Text.Text) + toJSON Dijkstra = Aeson.toJSON ("dijkstra" :: Text.Text) instance Aeson.FromJSON Era where parseJSON = Aeson.withText "Era" $ \t -> case t of - "allegra" -> return Allegra - "shelley" -> return Shelley - "mary" -> return Mary - "alonzo" -> return Alonzo - "babbage" -> return Babbage - "conway" -> return Conway - _ -> fail $ "Unknown Era: \"" ++ Text.unpack t ++ "\"" + "allegra" -> return Allegra + "shelley" -> return Shelley + "mary" -> return Mary + "alonzo" -> return Alonzo + "babbage" -> return Babbage + "conway" -> return Conway + "dijkstra" -> return Dijkstra + _ -> fail $ "Unknown Era: \"" ++ Text.unpack t ++ "\"" -- | Minimal major protocol version per era firstEraForMajorVersion :: Int -> Era firstEraForMajorVersion pv + | pv >= 11 = Dijkstra -- TODO: Once Dijkstra era is out, re-check the value | pv >= 9 = Conway | pv >= 7 = Babbage | pv >= 5 = Alonzo @@ -311,6 +314,7 @@ data Genesis = Genesis , shelley :: KM.KeyMap Aeson.Value , alonzo :: KM.KeyMap Aeson.Value , conway :: Maybe (KM.KeyMap Aeson.Value) -- TODO: Remove the null. + , dijkstra :: Maybe (KM.KeyMap Aeson.Value) -- Absolute durations: , slot_duration :: Time.NominalDiffTime @@ -367,7 +371,7 @@ instance Aeson.FromJSON ChainDB where (Aeson.defaultOptions {Aeson.rejectUnknownFields = True}) data Chunks = Chunks - { + { chaindb_server :: Integer , explorer_chunk :: Integer } @@ -390,7 +394,7 @@ instance Aeson.FromJSON Chunks where -------------------------------------------------------------------------------- data Node = Node - { + { utxo_lmdb :: Bool , ssd_directory :: Maybe String diff --git a/nix/nixos/tx-generator-service.nix b/nix/nixos/tx-generator-service.nix index e276e43a7b4..a53aa7d3b12 100644 --- a/nix/nixos/tx-generator-service.nix +++ b/nix/nixos/tx-generator-service.nix @@ -18,7 +18,14 @@ let inherit (cfg.plutus) limitExecutionMem limitExecutionSteps; }; targetNodes = targetNodesList cfg.targetNodes; - era = capitalise cfg.era; + era = capitalise + ( + if cfg.era == "dijkstra" + then # TODO: (@russoul) Get rid of this once tx-generator supports dijkstra + builtins.trace "Falling back to conway era in place of dijkstra for now..." "conway" + else + cfg.era + ); inherit add_tx_size debugMode @@ -123,6 +130,7 @@ in pkgs.commonLib.defServiceModule "alonzo" "babbage" "conway" + "dijkstra" ]) "mary" "Cardano era to generate transactions for."; diff --git a/nix/workbench/genesis/genesis.sh b/nix/workbench/genesis/genesis.sh index 15f4e09a165..848806c0b63 100644 --- a/nix/workbench/genesis/genesis.sh +++ b/nix/workbench/genesis/genesis.sh @@ -77,7 +77,7 @@ case "$op" in if genesis cache-test "$cache_path"; then cache_hit=t cache_hit_desc='hit' - else + else cache_hit= cache_hit_desc='miss' fi @@ -691,6 +691,11 @@ genesis-create-testnet-data() { --out-dir "$dir" "${args[@]}" ) + if [ "$era" = "dijkstra" ]; then + era="conway" # TODO: (@russoul) Get rid of this once cardano-cli supports dijkstra + warn genesis "Falling back to conway in place of dijkstra for the time being..." + fi + # TODO Just fallback to conway + print a message to not forget to implement dira progress genesis "$(colorise cardano-cli "$era" create-testnet-data "${create_testnet_data_args[@]}")" cardano-cli "$era" genesis create-testnet-data "${create_testnet_data_args[@]}" diff --git a/nix/workbench/service/nodes.nix b/nix/workbench/service/nodes.nix index 82e1fd6e994..a2d6af197e0 100644 --- a/nix/workbench/service/nodes.nix +++ b/nix/workbench/service/nodes.nix @@ -32,6 +32,7 @@ let "alonzo" "babbage" "conway" + "dijkstra" ]; configHardforksIntoEra = era: @@ -41,13 +42,14 @@ let then ret else go ret (__head rest) (__tail rest); eraSetupHardforks = { - byron = {}; - shelley = { TestShelleyHardForkAtEpoch = 0; }; - allegra = { TestAllegraHardForkAtEpoch = 0; }; - mary = { TestMaryHardForkAtEpoch = 0; }; - alonzo = { TestAlonzoHardForkAtEpoch = 0; }; - babbage = { TestBabbageHardForkAtEpoch = 0; }; - conway = { TestConwayHardForkAtEpoch = 0; }; + byron = {}; + shelley = { TestShelleyHardForkAtEpoch = 0; }; + allegra = { TestAllegraHardForkAtEpoch = 0; }; + mary = { TestMaryHardForkAtEpoch = 0; }; + alonzo = { TestAlonzoHardForkAtEpoch = 0; }; + babbage = { TestBabbageHardForkAtEpoch = 0; }; + conway = { TestConwayHardForkAtEpoch = 0; }; + dijkstra = { TestDijktraHardForkAtEpoch = 0; }; }; in if __hasAttr era eraSetupHardforks then go {} (__head eras) (__tail eras)