Skip to content

Commit

Permalink
try take into account variable k
Browse files Browse the repository at this point in the history
  • Loading branch information
carbolymer committed Sep 19, 2024
1 parent d2f62a9 commit 371e557
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions cardano-testnet/src/Testnet/Defaults.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ module Testnet.Defaults
, plutusV3Script
) where

import Cardano.Api (CardanoEra (..), File (..), pshow, ShelleyBasedEra (..),
toCardanoEra, unsafeBoundedRational, AnyShelleyBasedEra (..))
import Cardano.Api (AnyShelleyBasedEra (..), CardanoEra (..), File (..),
ShelleyBasedEra (..), pshow, toCardanoEra, unsafeBoundedRational)
import qualified Cardano.Api.Shelley as Api

import Cardano.Ledger.Alonzo.Core (PParams (..))
Expand Down Expand Up @@ -433,7 +433,7 @@ defaultShelleyGenesis asbe startTime maxSupply options = do
activeSlotsCoeff = round (shelleyActiveSlotsCoeff * 100) % 100
-- make security param k satisfy: epochLength = 10 * k / f
-- TODO: find out why this actually degrates network stability - turned off for now
-- securityParam = ceiling $ fromIntegral epochLength * cardanoActiveSlotsCoeff / 10
securityParam = ceiling $ fromIntegral epochLength * shelleyActiveSlotsCoeff / 10
pVer = eraToProtocolVersion asbe
protocolParams = Api.sgProtocolParams Api.shelleyGenesisDefaults
protocolParamsWithPVer = protocolParams & ppProtocolVersionL' .~ pVer
Expand All @@ -444,7 +444,7 @@ defaultShelleyGenesis asbe startTime maxSupply options = do
, Api.sgNetworkMagic = fromIntegral magic
, Api.sgProtocolParams = protocolParamsWithPVer
-- using default from shelley genesis k = 2160
-- , Api.sgSecurityParam = securityParam
, Api.sgSecurityParam = securityParam
, Api.sgSlotLength = secondsToNominalDiffTimeMicro $ realToFrac slotLength
, Api.sgSystemStart = startTime
}
Expand Down
6 changes: 3 additions & 3 deletions cardano-testnet/src/Testnet/Start/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ data ShelleyTestnetOptions = ShelleyTestnetOptions
instance Default ShelleyTestnetOptions where
def = ShelleyTestnetOptions
{ shelleyTestnetMagic = 42
, shelleyEpochLength = 500
, shelleySlotLength = 0.1
, shelleyActiveSlotsCoeff = 0.05
, shelleyEpochLength = 150_000
, shelleySlotLength = 0.15
, shelleyActiveSlotsCoeff = 0.1
}

-- | Specify a BFT node (Pre-Babbage era only) or an SPO (Shelley era onwards only)
Expand Down

0 comments on commit 371e557

Please sign in to comment.