Skip to content

Commit

Permalink
Update default conway genesis value
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimbo4350 authored and mgmeier committed May 8, 2024
1 parent 31828ef commit 898d66f
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
1 change: 1 addition & 0 deletions cardano-testnet/cardano-testnet.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ library
, cardano-ledger-alonzo
, cardano-ledger-conway
, cardano-ledger-core
, cardano-ledger-core:testlib
, cardano-git-rev
, cardano-ledger-core
, cardano-ledger-binary
Expand Down
44 changes: 42 additions & 2 deletions cardano-testnet/src/Testnet/Defaults.hs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE NumericUnderscores #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}


-- | All Byron and Shelley Genesis related functionality
module Testnet.Defaults
( defaultAlonzoGenesis
Expand All @@ -30,6 +32,7 @@ import qualified Cardano.Ledger.BaseTypes as Ledger
import Cardano.Ledger.Binary.Version ()
import Cardano.Ledger.Coin
import Cardano.Ledger.Conway.Genesis
import Cardano.Ledger.Conway.PParams
import qualified Cardano.Ledger.Core as Ledger
import Cardano.Ledger.Crypto (StandardCrypto)
import qualified Cardano.Ledger.Shelley as Ledger
Expand Down Expand Up @@ -58,9 +61,9 @@ import Data.Word
import Lens.Micro
import Numeric.Natural

import Test.Cardano.Ledger.Core.Rational
import Testnet.Start.Types


instance Api.Error AlonzoGenesisError where
prettyError (AlonzoGenErrCostModels e) =
"Error in Alonzo genesis cost models: " <> pshow e
Expand Down Expand Up @@ -160,7 +163,44 @@ defaultAlonzoGenesis = do
]

defaultConwayGenesis :: ConwayGenesis StandardCrypto
defaultConwayGenesis = DefaultClass.def
defaultConwayGenesis =
let upPParams :: UpgradeConwayPParams Identity
upPParams = UpgradeConwayPParams
{ ucppPoolVotingThresholds = poolVotingThresholds
, ucppDRepVotingThresholds = drepVotingThresholds
, ucppCommitteeMinSize = 0
, ucppCommitteeMaxTermLength = EpochInterval 200
, ucppGovActionLifetime = EpochInterval 1 -- One Epoch
, ucppGovActionDeposit = Coin 1_000_000
, ucppDRepDeposit = Coin 1_000_000
, ucppDRepActivity = EpochInterval 100
}
drepVotingThresholds = DRepVotingThresholds
{ dvtMotionNoConfidence = 0 %! 1
, dvtCommitteeNormal = 1 %! 2
, dvtCommitteeNoConfidence = 0 %! 1
, dvtUpdateToConstitution = 0 %! 2 -- TODO: Requires a constitutional committee when non-zero
, dvtHardForkInitiation = 1 %! 2
, dvtPPNetworkGroup = 1 %! 2
, dvtPPEconomicGroup = 1 %! 2
, dvtPPTechnicalGroup = 1 %! 2
, dvtPPGovGroup = 1 %! 2
, dvtTreasuryWithdrawal = 1 %! 2
}
poolVotingThresholds = PoolVotingThresholds
{ pvtMotionNoConfidence = 1 %! 2
, pvtCommitteeNormal = 1 %! 2
, pvtCommitteeNoConfidence = 1 %! 2
, pvtHardForkInitiation = 1 %! 2
, pvtPPSecurityGroup = 1 %! 2
}
in ConwayGenesis
{ cgUpgradePParams = upPParams
, cgConstitution = DefaultClass.def
, cgCommittee = DefaultClass.def
, cgDelegs = mempty
, cgInitialDReps = mempty
}



Expand Down

0 comments on commit 898d66f

Please sign in to comment.