Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
55a93a6
WIP: don't include cache-entry in the genesis tar file
fmaste Apr 27, 2026
82c0379
wb | extract genesis mechanisms into two different files
fmaste Apr 27, 2026
43e4915
wb | centralize dispatch of genesis backends
fmaste Jun 2, 2026
4193656
wb | move the cache reuse logic into backends
fmaste Jun 2, 2026
13be532
wb | centralize dispatch of genesis from preset
fmaste Jun 4, 2026
f06ff12
wb | remove support for genesis creation using `create-staked`
fmaste May 28, 2026
741e2c4
wb | use byron genesis from `create-testnet-data` output
fmaste Jun 2, 2026
44eb2b9
wb | keep genesis cache on-disk genesis layout consistent with `creat…
fmaste Jun 2, 2026
d2b6284
wb | remove genesis pools metadata (--relays)
fmaste Jun 3, 2026
7ba0855
wb | new genesis "ripper" backend separating dataset from protocol
fmaste Apr 21, 2026
a73a974
wb | restore previously removed extra cost models in epoch-timeline.json
fmaste May 21, 2026
3c8eba6
wb | new epoch-timeline.json format
fmaste May 21, 2026
a8633e6
wb | support any cost models through alonzo genesis
fmaste May 29, 2026
11c9d8e
wb | epoch-timeline fixes to follow mainnet as much as possible
fmaste May 22, 2026
d291fc1
wb | remove genesis specs and use the profile contents
fmaste Jun 5, 2026
2f6b4a1
wb | add PV 11 preview and dijkstra support to cardano-profile
fmaste May 29, 2026
27d2432
WIP: ERA decision
fmaste Jun 10, 2026
24442e2
wb | new all-profiles.json
fmaste Jun 10, 2026
441f8a0
wb | drop per-call "using <backend>" announcement in genesis()
fmaste Jun 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ include nix.mk
PROJECT_NAME = cardano-node
NUM_PROC = $(nproc --all)

## One of: shey alra mary alzo bage coay
ERA ?= coay

PROFILE ?= default-${ERA}
PROFILE ?= default
## One of: shelley allegra mary alonzo babbage conway dijkstra
ERA ?= conway
BACKEND ?= supervisor
REV ?= master
ITER ?=
Expand Down Expand Up @@ -66,8 +65,8 @@ workbench-internals-walkthrough:
##
## Base targets:
##
shell: ## Nix shell, (workbench from /nix/store), vars: PROFILE, CMD, RUN
nix-shell -A 'workbench-shell' --max-jobs 8 --cores 0 --show-trace --argstr profileName ${PROFILE} --argstr backendName ${BACKEND} ${ARGS} ${if ${CMD},--command "${CMD}"} ${if ${RUN},--run "${RUN}"}
shell: ## Nix shell, (workbench from /nix/store), vars: PROFILE, ERA, CMD, RUN
nix-shell -A 'workbench-shell' --max-jobs 8 --cores 0 --show-trace --argstr profileName ${PROFILE} --argstr eraName ${ERA} --argstr backendName ${BACKEND} ${ARGS} ${if ${CMD},--command "${CMD}"} ${if ${RUN},--run "${RUN}"}
shell-dev shell-prof shell-nix: shell
shell-nix: ARGS += --arg 'useCabalRun' false ## Nix shell, (workbench from Nix store), vars: PROFILE, CMD, RUN
shell-prof: ARGS += --arg 'profiledBuild' true --arg 'profilingType' '"space-heap"' ## Nix shell, everything Haskell built profiled and run with `-hT`.
Expand Down Expand Up @@ -96,7 +95,7 @@ $(eval $(call define_profile_targets_nomadcloud,$(CLOUD_PROFILES)))

# Dynamic local/supervisor profile targets.
playground-%:
nix-shell -A 'workbench-shell' --max-jobs 8 --cores 0 --show-trace --argstr profileName $*-${ERA} --argstr backendName supervisor
nix-shell -A 'workbench-shell' --max-jobs 8 --cores 0 --show-trace --argstr profileName $* --argstr eraName ${ERA} --argstr backendName supervisor

###
### Misc
Expand Down
155 changes: 72 additions & 83 deletions bench/cardano-profile/app/cardano-profile.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

--------------------------------------------------------------------------------

-- base.
import Prelude

import Data.Bool (bool)
import System.Environment (lookupEnv)
import GHC.Stack (HasCallStack)
-- Package: aeson.
Expand All @@ -24,61 +23,64 @@ import qualified Cardano.Benchmarking.Profile.NodeSpecs as NodeSpecs
import qualified Cardano.Benchmarking.Profile.Types as Types
-- Profiles to export!
-- Static / built-in / profiles part of the test-suite.
import Cardano.Benchmarking.Profile.Builtin.Cloud (profilesNoEraCloud)
import Cardano.Benchmarking.Profile.Builtin.Empty (profilesNoEraEmpty)
import Cardano.Benchmarking.Profile.Builtin.ForgeStress (profilesNoEraForgeStress)
import Cardano.Benchmarking.Profile.Builtin.K3 (profilesNoEraK3)
import Cardano.Benchmarking.Profile.Builtin.Legacy.Dense (profilesNoEraDense)
import Cardano.Benchmarking.Profile.Builtin.Legacy.Dish (profilesNoEraDish)
import Cardano.Benchmarking.Profile.Builtin.Miniature (profilesNoEraMiniature)
import Cardano.Benchmarking.Profile.Builtin.Model (profilesNoEraModel)
import Cardano.Benchmarking.Profile.Builtin.Plutuscall (profilesNoEraPlutuscall)
import Cardano.Benchmarking.Profile.Builtin.Scenario.Chainsync (profilesNoEraChainsync)
import Cardano.Benchmarking.Profile.Builtin.Scenario.Idle (profilesNoEraIdle)
import Cardano.Benchmarking.Profile.Builtin.Scenario.TracerOnly (profilesNoEraTracerOnly)
import Cardano.Benchmarking.Profile.Extra.Scaling (profilesNoEraScalingLocal, profilesNoEraScalingCloud)
import Cardano.Benchmarking.Profile.Builtin.Cloud (profilesCloud)
import Cardano.Benchmarking.Profile.Builtin.Empty (profilesEmpty)
import Cardano.Benchmarking.Profile.Builtin.ForgeStress (profilesForgeStress)
import Cardano.Benchmarking.Profile.Builtin.K3 (profilesK3)
import Cardano.Benchmarking.Profile.Builtin.Legacy.Dense (profilesDense)
import Cardano.Benchmarking.Profile.Builtin.Legacy.Dish (profilesDish)
import Cardano.Benchmarking.Profile.Builtin.Miniature (profilesMiniature)
import Cardano.Benchmarking.Profile.Builtin.Model (profilesModel)
import Cardano.Benchmarking.Profile.Builtin.Plutuscall (profilesPlutuscall)
import Cardano.Benchmarking.Profile.Builtin.Scenario.Chainsync (profilesChainsync)
import Cardano.Benchmarking.Profile.Builtin.Scenario.Idle (profilesIdle)
import Cardano.Benchmarking.Profile.Builtin.Scenario.TracerOnly (profilesTracerOnly)
import Cardano.Benchmarking.Profile.Extra.Scaling (profilesScalingLocal, profilesScalingCloud)
-- Dynamic profiles.
import Cardano.Benchmarking.Profile.Playground (profilesNoEraPlayground)
import Cardano.Benchmarking.Profile.Playground (profilesPlayground)

--------------------------------------------------------------------------------

allProfiles :: [Types.Profile]
allProfiles = performanceAndTracingProfiles ++ playgroundProfiles

cloudProfiles :: [Types.Profile]
cloudProfiles = profilesNoEraCloud
cloudProfiles = profilesCloud

-- "families" of profiles. Grouped by common properties or intentions.
performanceAndTracingProfiles :: [Types.Profile]
performanceAndTracingProfiles =
cloudProfiles
++ profilesNoEraEmpty -- Empty datasets running `FixedLoaded`.
++ profilesNoEraForgeStress -- All the "forge-stress*" profiles.
++ profilesNoEraK3 -- K3
-- Empty datasets running `FixedLoaded`.
++ profilesEmpty
-- All the "forge-stress*" profiles.
++ profilesForgeStress
-- K3.
++ profilesK3
-- Legacy.
++ profilesNoEraDense
++ profilesNoEraDish
++ profilesNoEraMiniature
++ profilesNoEraModel --
++ profilesNoEraPlutuscall --
++ profilesDense
++ profilesDish
-- Light dataset.
++ profilesMiniature
++ profilesModel
++ profilesPlutuscall
-- Empty datasets not running `FixedLoaded`.
++ profilesNoEraChainsync -- Scenario `Chainsync`
++ profilesNoEraIdle -- Scenario `Idle`
++ profilesNoEraTracerOnly -- Scenario `TracerOnly`
-- Extra modules
++ profilesNoEraScalingLocal
++ profilesNoEraScalingCloud
++ profilesChainsync -- Scenario `Chainsync`
++ profilesIdle -- Scenario `Idle`
++ profilesTracerOnly -- Scenario `TracerOnly`
-- Extra profiles.
++ profilesScalingLocal
++ profilesScalingCloud

-- Have fun!
playgroundProfiles :: [Types.Profile]
playgroundProfiles = profilesNoEraPlayground
playgroundProfiles = profilesPlayground

--------------------------------------------------------------------------------

data Cli =
NamesNoEra
| NamesCloudNoEra
| Names
Names
| NamesCloud
| All [CliOptions]
| ByName [CliOptions] String
| LibMK
Expand All @@ -89,13 +91,13 @@ data Cli =

data CliOptions =
OptPrettyPrint
| OptWithEra
| OptWithPlayground
deriving Eq

--------------------------------------------------------------------------------

-- | Construct Map with profile name as key, without eras (in name and object).
-- | Construct Map of `Profile` with the key being the profile name after
-- applying an optional overlay.
toMap :: HasCallStack => Maybe Aeson.Object -> [Types.Profile] -> Map.Map String Types.Profile
toMap maybeObj ps = Map.fromList $ map
(\p ->
Expand Down Expand Up @@ -125,28 +127,27 @@ main :: IO ()
main = do
cli <- getOpts
case cli of
-- Print all profile names without the era suffix (does not apply overlays).
NamesNoEra -> BSL8.putStrLn $ Aeson.encode $ map Types.name allProfiles
-- Print all cloud profile (-nomadperf) names (does not apply overlays).
NamesCloudNoEra -> BSL8.putStrLn $ Aeson.encode $ map Types.name cloudProfiles
-- Print all profile names (applies overlays!!!!!).
-- Print all profile names, with an optional overlay.
Names -> do
maybeObj <- lookupOverlay -- Ignored by `NamesNoEra` and `NamesCloudNoEra`.
BSL8.putStrLn $ Aeson.encode $ Map.keys $ Profile.addEras $ toMap maybeObj allProfiles
maybeObj <- lookupOverlay -- Ignored by `NamesCloud`.
BSL8.putStrLn $ Aeson.encode $ Map.keys $ toMap maybeObj allProfiles
-- Print all cloud (-nomadperf) profile names, does not apply overlays.
NamesCloud -> BSL8.putStrLn $ Aeson.encode $ map Types.name cloudProfiles
-- Print a map with all profiles, with an optional overlay.
All cliOptions -> do
let
targetProfiles = if OptWithPlayground `elem` cliOptions then allProfiles else performanceAndTracingProfiles
targetProfiles = if OptWithPlayground `elem` cliOptions
then allProfiles
else performanceAndTracingProfiles
enc = encoder cliOptions
withEraSuffs = OptWithEra `elem` cliOptions
maybeObj <- lookupOverlay -- Ignored by `NamesNoEra` and `NamesCloudNoEra`.
BSL8.putStrLn $ enc $ bool id Profile.addEras withEraSuffs $ toMap maybeObj targetProfiles
maybeObj <- lookupOverlay -- Ignored by `NamesCloud`.
BSL8.putStrLn $ enc $ toMap maybeObj targetProfiles
-- Print a single profiles, with an optional overlay.
ByName cliOptions profileName -> do
maybeObj <- lookupOverlay -- Ignored by `NamesNoEra` and `NamesCloudNoEra`.
maybeObj <- lookupOverlay -- Ignored by `NamesCloud`.
let
enc = encoder cliOptions
profiles = Profile.addEras $ toMap maybeObj allProfiles
profiles = toMap maybeObj allProfiles
case Map.lookup profileName profiles of
Nothing -> error $ "No profile named \"" ++ profileName ++ "\""
Just profile -> BSL8.putStrLn $ enc profile
Expand Down Expand Up @@ -199,40 +200,28 @@ getOpts = OA.execParser $

cliParser :: OA.Parser Cli
cliParser = OA.hsubparser $
OA.command "names-noera"
(OA.info
(pure NamesNoEra)
(OA.fullDesc <> OA.header "names-noera" <> OA.progDesc "All profiles names (no era suffix)")
)
<>
OA.command "names-cloud-noera"
(OA.info
(pure NamesCloudNoEra)
(OA.fullDesc <> OA.header "names-cloud-noera" <> OA.progDesc "All cloud profiles names (no era suffix)")
)
<>
OA.command "names"
(OA.info
(pure Names)
(OA.fullDesc <> OA.header "names" <> OA.progDesc "All profiles names")
)
<>
OA.command "all"
OA.command "names-cloud"
(OA.info
(pure $ All [OptWithEra, OptWithPlayground])
(OA.fullDesc <> OA.header "all" <> OA.progDesc "Create all profiles")
(pure NamesCloud)
(OA.fullDesc <> OA.header "names-cloud" <> OA.progDesc "All cloud profiles names")
)
<>
OA.command "all-noera"
OA.command "all"
(OA.info
(pure $ All [OptWithPlayground])
(OA.fullDesc <> OA.header "all-noera" <> OA.progDesc "Create all profiles (no era suffix)")
(OA.fullDesc <> OA.header "all" <> OA.progDesc "Create all profiles")
)
<>
OA.command "allpt-noera"
OA.command "allpt"
(OA.info
(pure $ All [OptPrettyPrint])
(OA.fullDesc <> OA.header "allpt-noera" <> OA.progDesc "Create P&T profiles (no era suffix)")
(OA.fullDesc <> OA.header "allpt" <> OA.progDesc "Create P&T profiles")
)
<>
OA.command "by-name"
Expand Down Expand Up @@ -289,28 +278,28 @@ libMKLocations =
-- Local profiles.
("LOCAL_PROFILES", [
-- Families of local profiles.
("PROFILES_EMPTY" , profilesNoEraEmpty)
, ("PROFILES_MINIATURE" , profilesNoEraMiniature)
, ("PROFILES_FORGE_STRESS" , profilesNoEraForgeStress)
, ("PROFILES_PLUTUSCALL" , profilesNoEraPlutuscall)
, ("PROFILES_MODEL" , profilesNoEraModel)
, ("PROFILES_K3" , profilesNoEraK3)
("PROFILES_EMPTY" , profilesEmpty)
, ("PROFILES_MINIATURE" , profilesMiniature)
, ("PROFILES_FORGE_STRESS" , profilesForgeStress)
, ("PROFILES_PLUTUSCALL" , profilesPlutuscall)
, ("PROFILES_MODEL" , profilesModel)
, ("PROFILES_K3" , profilesK3)
, ("PROFILES_SCENARIOS" ,
profilesNoEraChainsync
++ profilesNoEraIdle
++ profilesNoEraTracerOnly
profilesChainsync
++ profilesIdle
++ profilesTracerOnly
)
, ("PROFILES_LEGACY" ,
profilesNoEraDense
++ profilesNoEraDish
profilesDense
++ profilesDish
)
, ("PROFILES_SCALING" , profilesNoEraScalingLocal)
, ("PROFILES_SCALING" , profilesScalingLocal)
])
-- Cloud profiles.
, ("CLOUD_PROFILES", [
-- Families of cloud profiles.
("PROFILES_NOMAD_PERF" , profilesNoEraCloud)
, ("PROFILES_NOMAD_PERFSSD", profilesNoEraScalingCloud)
("PROFILES_NOMAD_PERF" , profilesCloud)
, ("PROFILES_NOMAD_PERFSSD", profilesScalingCloud)
])
]

Expand Down
11 changes: 8 additions & 3 deletions bench/cardano-profile/app/cardano-timeline.hs
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
{-# LANGUAGE OverloadedStrings #-}

{-- Create a delta timeline with each parameters and cost changes that happened
in an epoch using "epoch_param" and "cost_model" db-sync tables.
--}
{- Per-epoch delta of protocol parameters and cost models, built from the raw
`epoch_param` and `cost_model` tables of a mainnet db-sync database.

Result is written to stdout. A snapshot of a previous run is kept at
`data/db-sync/timeline-2025-03-01.json` (and similar dated files) for
reference. The runtime timeline at `data/genesis/epoch-timeline.json` is
hand-curated and is not touched by this tool.
-}
--------------------------------------------------------------------------------

module Main where
Expand Down
2 changes: 1 addition & 1 deletion bench/cardano-profile/cardano-profile.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ license: Apache-2.0
license-files: LICENSE
NOTICE
build-type: Simple
data-files: data/all-profiles-coay.json
data-files: data/all-profiles.json
data/db-sync/epoch_param.json
data/db-sync/cost_model.json
data/genesis/epoch-timeline.json
Expand Down
Loading
Loading