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 20, 2024
1 parent 314caf3 commit 25bebb3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 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
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ Available options:
Enable new epoch state logging to
logs/ledger-epoch-state.log
--testnet-magic INT Specify a testnet magic id.
--epoch-length SLOTS Epoch length, in number of slots (default: 500)
--slot-length SECONDS Slot length (default: 0.1)
--epoch-length SLOTS Epoch length, in number of slots (default: 150000)
--slot-length SECONDS Slot length (default: 0.15)
--active-slots-coeff DOUBLE
Active slots co-efficient (default: 5.0e-2)
Active slots co-efficient (default: 0.1)
-h,--help Show this help text

0 comments on commit 25bebb3

Please sign in to comment.