From 20e3927216c1491fba505f72c7074c448a153037 Mon Sep 17 00:00:00 2001 From: Jordan Millar Date: Wed, 17 Jul 2024 15:35:37 +0200 Subject: [PATCH 1/4] Make specification of Conway genesis file mandatory again Remove the possibility of declaring protocol version 8 in Conway era --- .../src/Cardano/Node/Configuration/POM.hs | 2 +- .../src/Cardano/Node/Protocol/Cardano.hs | 17 ++++++----------- cardano-node/src/Cardano/Node/Types.hs | 2 +- cardano-node/test/Test/Cardano/Node/POM.hs | 2 +- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/cardano-node/src/Cardano/Node/Configuration/POM.hs b/cardano-node/src/Cardano/Node/Configuration/POM.hs index 0cb4a22c2ef..d9ff4255aad 100644 --- a/cardano-node/src/Cardano/Node/Configuration/POM.hs +++ b/cardano-node/src/Cardano/Node/Configuration/POM.hs @@ -427,7 +427,7 @@ instance FromJSON PartialNodeConfiguration where } parseConwayProtocol v = do - npcConwayGenesisFile <- v .:? "ConwayGenesisFile" + npcConwayGenesisFile <- v .: "ConwayGenesisFile" npcConwayGenesisFileHash <- v .:? "ConwayGenesisHash" pure NodeConwayProtocolConfiguration { npcConwayGenesisFile diff --git a/cardano-node/src/Cardano/Node/Protocol/Cardano.hs b/cardano-node/src/Cardano/Node/Protocol/Cardano.hs index f47f852cee3..9177137f91a 100644 --- a/cardano-node/src/Cardano/Node/Protocol/Cardano.hs +++ b/cardano-node/src/Cardano/Node/Protocol/Cardano.hs @@ -40,8 +40,6 @@ import qualified Ouroboros.Consensus.Shelley.Node.Praos as Praos import Prelude -import Data.Maybe - ------------------------------------------------------------------------------ -- Real Cardano protocol -- @@ -137,7 +135,7 @@ mkSomeConsensusProtocolCardano NodeByronProtocolConfiguration { (conwayGenesis, _conwayGenesisHash) <- firstExceptT CardanoProtocolInstantiationConwayGenesisReadError $ - Conway.readGenesisMaybe npcConwayGenesisFile + Conway.readGenesis npcConwayGenesisFile npcConwayGenesisFileHash shelleyLeaderCredentials <- @@ -241,15 +239,12 @@ mkSomeConsensusProtocolCardano NodeByronProtocolConfiguration { } , paramsConway = Praos.ProtocolParamsConway { - -- If Conway is not enabled, this is the Babbage protocol version. - -- - -- If Conway is enabled, this is the Conway protocol version. + -- ProtVer 9 corresponds to the Conway bootstrap era. + -- ProtVer 10 corresponds to the Conway post bootstrap era. Praos.conwayProtVer = - if isNothing npcConwayGenesisFile - then ProtVer (natVersion @8) 0 - else if npcExperimentalHardForksEnabled - then ProtVer (natVersion @10) 0 - else ProtVer (natVersion @9) 0, + if npcExperimentalHardForksEnabled + then ProtVer (natVersion @10) 0 + else ProtVer (natVersion @9) 0, Praos.conwayMaxTxCapacityOverrides = TxLimits.mkOverrides TxLimits.noOverridesMeasure } diff --git a/cardano-node/src/Cardano/Node/Types.hs b/cardano-node/src/Cardano/Node/Types.hs index f93319556ff..87cc9c72685 100644 --- a/cardano-node/src/Cardano/Node/Types.hs +++ b/cardano-node/src/Cardano/Node/Types.hs @@ -154,7 +154,7 @@ data NodeAlonzoProtocolConfiguration = data NodeConwayProtocolConfiguration = NodeConwayProtocolConfiguration { - npcConwayGenesisFile :: !(Maybe GenesisFile) + npcConwayGenesisFile :: !GenesisFile -- ^ If no conway genesis file is provided, we want -- to enforce a maximum protocol version of 8 to avoid -- a permanent hard fork. diff --git a/cardano-node/test/Test/Cardano/Node/POM.hs b/cardano-node/test/Test/Cardano/Node/POM.hs index 2e16d22037d..20d8c99119f 100644 --- a/cardano-node/test/Test/Cardano/Node/POM.hs +++ b/cardano-node/test/Test/Cardano/Node/POM.hs @@ -75,7 +75,7 @@ testNodeAlonzoProtocolConfiguration = testNodeConwayProtocolConfiguration :: NodeConwayProtocolConfiguration testNodeConwayProtocolConfiguration = NodeConwayProtocolConfiguration - { npcConwayGenesisFile = Just $ GenesisFile "dummmy-genesis-file" + { npcConwayGenesisFile = GenesisFile "dummmy-genesis-file" , npcConwayGenesisFileHash = Nothing } From 1e6f75101b5a637169efd8cb29026ad23ba4a427 Mon Sep 17 00:00:00 2001 From: Samuel Leathers Date: Tue, 23 Jul 2024 10:35:13 -0400 Subject: [PATCH 2/4] report 9.1 in block header --- cardano-node/src/Cardano/Node/Protocol/Cardano.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cardano-node/src/Cardano/Node/Protocol/Cardano.hs b/cardano-node/src/Cardano/Node/Protocol/Cardano.hs index 9177137f91a..c36e9c844d4 100644 --- a/cardano-node/src/Cardano/Node/Protocol/Cardano.hs +++ b/cardano-node/src/Cardano/Node/Protocol/Cardano.hs @@ -233,7 +233,7 @@ mkSomeConsensusProtocolCardano NodeByronProtocolConfiguration { -- version. It is the protocol version that this node will declare -- that it understands during the Babbage era. That is, it is the -- version of protocol /after/ Babbage, i.e. Conway. - Praos.babbageProtVer = ProtVer (natVersion @9) 0, + Praos.babbageProtVer = ProtVer (natVersion @9) 1, Praos.babbageMaxTxCapacityOverrides = TxLimits.mkOverrides TxLimits.noOverridesMeasure } @@ -244,7 +244,7 @@ mkSomeConsensusProtocolCardano NodeByronProtocolConfiguration { Praos.conwayProtVer = if npcExperimentalHardForksEnabled then ProtVer (natVersion @10) 0 - else ProtVer (natVersion @9) 0, + else ProtVer (natVersion @9) 1, Praos.conwayMaxTxCapacityOverrides = TxLimits.mkOverrides TxLimits.noOverridesMeasure } From aa7d3a4b353fb2fdff1e24fe13a370d01bbc9d80 Mon Sep 17 00:00:00 2001 From: Samuel Leathers Date: Tue, 23 Jul 2024 10:34:42 -0400 Subject: [PATCH 3/4] mainnet: add conway genesis --- configuration/cardano/mainnet-config.json | 2 + configuration/cardano/mainnet-config.yaml | 2 + .../cardano/mainnet-conway-genesis.json | 303 ++++++++++++++++++ configuration/cardano/update-config-files.sh | 1 + flake.lock | 6 +- nix/haskell.nix | 3 +- 6 files changed, 312 insertions(+), 5 deletions(-) create mode 100644 configuration/cardano/mainnet-conway-genesis.json diff --git a/configuration/cardano/mainnet-config.json b/configuration/cardano/mainnet-config.json index cb21b2c92f9..388d0c43722 100644 --- a/configuration/cardano/mainnet-config.json +++ b/configuration/cardano/mainnet-config.json @@ -3,6 +3,8 @@ "AlonzoGenesisHash": "7e94a15f55d1e82d10f09203fa1d40f8eede58fd8066542cf6566008068ed874", "ByronGenesisFile": "mainnet-byron-genesis.json", "ByronGenesisHash": "5f20df933584822601f9e3f8c024eb5eb252fe8cefb24d1317dc3d432e940ebb", + "ConwayGenesisFile": "mainnet-conway-genesis.json", + "ConwayGenesisHash": "15a199f895e461ec0ffc6dd4e4028af28a492ab4e806d39cb674c88f7643ef62", "EnableP2P": true, "LastKnownBlockVersion-Alt": 0, "LastKnownBlockVersion-Major": 3, diff --git a/configuration/cardano/mainnet-config.yaml b/configuration/cardano/mainnet-config.yaml index 0bf8428702a..ef803181d62 100644 --- a/configuration/cardano/mainnet-config.yaml +++ b/configuration/cardano/mainnet-config.yaml @@ -7,6 +7,8 @@ AlonzoGenesisFile: mainnet-alonzo-genesis.json AlonzoGenesisHash: 7e94a15f55d1e82d10f09203fa1d40f8eede58fd8066542cf6566008068ed874 ByronGenesisFile: mainnet-byron-genesis.json ByronGenesisHash: 5f20df933584822601f9e3f8c024eb5eb252fe8cefb24d1317dc3d432e940ebb +ConwayGenesisFile: mainnet-conway-genesis.json +ConwayGenesisHash: 15a199f895e461ec0ffc6dd4e4028af28a492ab4e806d39cb674c88f7643ef62 ShelleyGenesisFile: mainnet-shelley-genesis.json ShelleyGenesisHash: 1a3be38bcbb7911969283716ad7aa550250226b76a61fc51cc9a9a35d9276d81 diff --git a/configuration/cardano/mainnet-conway-genesis.json b/configuration/cardano/mainnet-conway-genesis.json new file mode 100644 index 00000000000..760995a34d4 --- /dev/null +++ b/configuration/cardano/mainnet-conway-genesis.json @@ -0,0 +1,303 @@ +{ + "poolVotingThresholds": { + "committeeNormal": 0.51, + "committeeNoConfidence": 0.51, + "hardForkInitiation": 0.51, + "motionNoConfidence": 0.51, + "ppSecurityGroup": 0.51 + }, + "dRepVotingThresholds": { + "motionNoConfidence": 0.67, + "committeeNormal": 0.67, + "committeeNoConfidence": 0.6, + "updateToConstitution": 0.75, + "hardForkInitiation": 0.6, + "ppNetworkGroup": 0.67, + "ppEconomicGroup": 0.67, + "ppTechnicalGroup": 0.67, + "ppGovGroup": 0.75, + "treasuryWithdrawal": 0.67 + }, + "committeeMinSize": 7, + "committeeMaxTermLength": 146, + "govActionLifetime": 6, + "govActionDeposit": 100000000000, + "dRepDeposit": 500000000, + "dRepActivity": 20, + "minFeeRefScriptCostPerByte": 15, + "plutusV3CostModel": [ + 100788, + 420, + 1, + 1, + 1000, + 173, + 0, + 1, + 1000, + 59957, + 4, + 1, + 11183, + 32, + 201305, + 8356, + 4, + 16000, + 100, + 16000, + 100, + 16000, + 100, + 16000, + 100, + 16000, + 100, + 16000, + 100, + 100, + 100, + 16000, + 100, + 94375, + 32, + 132994, + 32, + 61462, + 4, + 72010, + 178, + 0, + 1, + 22151, + 32, + 91189, + 769, + 4, + 2, + 85848, + 123203, + 7305, + -900, + 1716, + 549, + 57, + 85848, + 0, + 1, + 1, + 1000, + 42921, + 4, + 2, + 24548, + 29498, + 38, + 1, + 898148, + 27279, + 1, + 51775, + 558, + 1, + 39184, + 1000, + 60594, + 1, + 141895, + 32, + 83150, + 32, + 15299, + 32, + 76049, + 1, + 13169, + 4, + 22100, + 10, + 28999, + 74, + 1, + 28999, + 74, + 1, + 43285, + 552, + 1, + 44749, + 541, + 1, + 33852, + 32, + 68246, + 32, + 72362, + 32, + 7243, + 32, + 7391, + 32, + 11546, + 32, + 85848, + 123203, + 7305, + -900, + 1716, + 549, + 57, + 85848, + 0, + 1, + 90434, + 519, + 0, + 1, + 74433, + 32, + 85848, + 123203, + 7305, + -900, + 1716, + 549, + 57, + 85848, + 0, + 1, + 1, + 85848, + 123203, + 7305, + -900, + 1716, + 549, + 57, + 85848, + 0, + 1, + 955506, + 213312, + 0, + 2, + 270652, + 22588, + 4, + 1457325, + 64566, + 4, + 20467, + 1, + 4, + 0, + 141992, + 32, + 100788, + 420, + 1, + 1, + 81663, + 32, + 59498, + 32, + 20142, + 32, + 24588, + 32, + 20744, + 32, + 25933, + 32, + 24623, + 32, + 43053543, + 10, + 53384111, + 14333, + 10, + 43574283, + 26308, + 10, + 16000, + 100, + 16000, + 100, + 962335, + 18, + 2780678, + 6, + 442008, + 1, + 52538055, + 3756, + 18, + 267929, + 18, + 76433006, + 8868, + 18, + 52948122, + 18, + 1995836, + 36, + 3227919, + 12, + 901022, + 1, + 166917843, + 4307, + 36, + 284546, + 36, + 158221314, + 26549, + 36, + 74698472, + 36, + 333849714, + 1, + 254006273, + 72, + 2174038, + 72, + 2261318, + 64571, + 4, + 207616, + 8310, + 4, + 1293828, + 28716, + 63, + 0, + 1, + 1006041, + 43623, + 251, + 0, + 1 + ], + "constitution": { + "anchor": { + "dataHash": "ca41a91f399259bcefe57f9858e91f6d00e1a38d6d9c63d4052914ea7bd70cb2", + "url": "ipfs://bafkreifnwj6zpu3ixa4siz2lndqybyc5wnnt3jkwyutci4e2tmbnj3xrdm" + }, + "script": "fa24fb305126805cf2164c161d852a0e7330cf988f1fe558cf7d4a64" + }, + "committee": { + "members": { + "scriptHash-df0e83bde65416dade5b1f97e7f115cc1ff999550ad968850783fe50": 580, + "scriptHash-b6012034ba0a7e4afbbf2c7a1432f8824aee5299a48e38e41a952686": 580, + "scriptHash-ce8b37a72b178a37bbd3236daa7b2c158c9d3604e7aa667e6c6004b7": 580, + "scriptHash-f0dc2c00d92a45521267be2d5de1c485f6f9d14466d7e16062897cf7": 580, + "scriptHash-349e55f83e9af24813e6cb368df6a80d38951b2a334dfcdf26815558": 580, + "scriptHash-84aebcfd3e00d0f87af918fc4b5e00135f407e379893df7e7d392c6a": 580, + "scriptHash-e8165b3328027ee0d74b1f07298cb092fd99aa7697a1436f5997f625": 580 + }, + "threshold": { + "numerator": 2, + "denominator": 3 + } + } +} diff --git a/configuration/cardano/update-config-files.sh b/configuration/cardano/update-config-files.sh index 9e81b72b84a..dcb306f3790 100755 --- a/configuration/cardano/update-config-files.sh +++ b/configuration/cardano/update-config-files.sh @@ -18,6 +18,7 @@ echo "#################" copyFile "mainnet-alonzo-genesis.json" copyFile "mainnet-byron-genesis.json" +copyFile "mainnet-conway-genesis.json" copyFile "mainnet-config.json" copyFile "mainnet-shelley-genesis.json" copyFile "mainnet-topology.json" diff --git a/flake.lock b/flake.lock index ef9defc4c11..f28128d62f2 100644 --- a/flake.lock +++ b/flake.lock @@ -856,11 +856,11 @@ "sodium": "sodium" }, "locked": { - "lastModified": 1720729907, - "narHash": "sha256-V4GLBT8JdRiucMHnsZM23H0vUOsc3FYe/4ozHcblGwY=", + "lastModified": 1721825987, + "narHash": "sha256-PPcma4tjozwXJAWf+YtHUQUulmxwulVlwSQzKItx/n8=", "owner": "input-output-hk", "repo": "iohk-nix", - "rev": "7c47f37a9e6494dce0a81eb40badc7eaca2e4728", + "rev": "eb61f2c14e1f610ec59117ad40f8690cddbf80cb", "type": "github" }, "original": { diff --git a/nix/haskell.nix b/nix/haskell.nix index ab23d4e0db7..cf21a4cfd12 100644 --- a/nix/haskell.nix +++ b/nix/haskell.nix @@ -195,8 +195,7 @@ let "configuration/cardano/mainnet-byron-genesis.json" "configuration/cardano/mainnet-shelley-genesis.json" "configuration/cardano/mainnet-alonzo-genesis.json" - # uncomment after mainnet conway genesis is finalized - #"configuration/cardano/mainnet-conway-genesis.json" + "configuration/cardano/mainnet-conway-genesis.json" ]; cardanoTestnetGoldenFiles = [ "configuration/defaults/byron-mainnet" From ad7286dd875f93a117cead6e04bcabba9589822b Mon Sep 17 00:00:00 2001 From: Samuel Leathers Date: Wed, 24 Jul 2024 01:29:21 -0400 Subject: [PATCH 4/4] release cardano-node 9.1 --- cardano-node-chairman/cardano-node-chairman.cabal | 2 +- cardano-node/cardano-node.cabal | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cardano-node-chairman/cardano-node-chairman.cabal b/cardano-node-chairman/cardano-node-chairman.cabal index da2de91c8d9..d1f9daecb0a 100644 --- a/cardano-node-chairman/cardano-node-chairman.cabal +++ b/cardano-node-chairman/cardano-node-chairman.cabal @@ -44,7 +44,7 @@ executable cardano-node-chairman build-depends: cardano-api , cardano-crypto-class , cardano-git-rev ^>=0.2.2 - , cardano-node ^>= 9.0 + , cardano-node ^>= 9.1 , cardano-prelude , containers , contra-tracer diff --git a/cardano-node/cardano-node.cabal b/cardano-node/cardano-node.cabal index 87bfb369d78..9eea3235821 100644 --- a/cardano-node/cardano-node.cabal +++ b/cardano-node/cardano-node.cabal @@ -1,7 +1,7 @@ cabal-version: 3.0 name: cardano-node -version: 9.0.0 +version: 9.1.0 synopsis: The cardano full node description: The cardano full node. category: Cardano,