Skip to content

Commit

Permalink
Genesis parameters yielding positive reserves
Browse files Browse the repository at this point in the history
  • Loading branch information
carbolymer committed Jan 12, 2024
1 parent d439882 commit a10ca6e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cardano-api/internal/Cardano/Api/Genesis.hs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ import qualified Ouroboros.Consensus.Shelley.Eras as Shelley
import Data.ByteString (ByteString)
import qualified Data.ListMap as ListMap
import qualified Data.Map.Strict as Map
import Data.Maybe (fromMaybe)
import Data.Maybe
import Data.Ratio
import Data.Text (Text)
import qualified Data.Time as Time
import Lens.Micro
Expand Down Expand Up @@ -121,6 +122,10 @@ shelleyGenesisDefaults =
& ppEMaxL .~ 18
& ppMinFeeAL .~ Coin 1 -- The linear factor for the minimum fee calculation
& ppMinFeeBL .~ Coin 0 -- The constant factor for the minimum fee calculation
& ppRhoL .~ unsafeUI (1 % 10)
& ppTauL .~ unsafeUI (1 % 10)
-- TODO maxLovelaceSupply - this value seemed to be too low resulting in negative reserves
-- TODO activeSlotCoeff - this needed to be > 0.3 for my case- TBD why

-- genesis keys and initial funds
, sgGenDelegs = Map.empty
Expand All @@ -129,6 +134,8 @@ shelleyGenesisDefaults =
, sgMaxLovelaceSupply = 0
}
where
unsafeUI :: Rational -> Ledger.UnitInterval
unsafeUI = fromJust . Ledger.boundRational
k = 2160
zeroTime = Time.UTCTime (Time.fromGregorian 1970 1 1) 0 -- tradition

0 comments on commit a10ca6e

Please sign in to comment.