cardano-ledger-conway-1.18.0.0: Cardano ledger with an updated on-chain governance system.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Ledger.Conway.Governance.DRepPulser

Synopsis

Documentation

data DRepPulsingState era Source #

Instances

Instances details
Generic (DRepPulsingState era) Source # 
Instance details

Defined in Cardano.Ledger.Conway.Governance.DRepPulser

Associated Types

type Rep (DRepPulsingState era) ∷ TypeType Source #

EraPParams era ⇒ Show (DRepPulsingState era) Source # 
Instance details

Defined in Cardano.Ledger.Conway.Governance.DRepPulser

EraPParams era ⇒ DecCBOR (DRepPulsingState era) Source # 
Instance details

Defined in Cardano.Ledger.Conway.Governance.DRepPulser

EraPParams era ⇒ DecShareCBOR (DRepPulsingState era) Source # 
Instance details

Defined in Cardano.Ledger.Conway.Governance.DRepPulser

Associated Types

type Share (DRepPulsingState era) Source #

EraPParams era ⇒ EncCBOR (DRepPulsingState era) Source # 
Instance details

Defined in Cardano.Ledger.Conway.Governance.DRepPulser

Methods

encCBORDRepPulsingState era → Encoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy (DRepPulsingState era) → Size Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [DRepPulsingState era] → Size Source #

EraPParams era ⇒ NFData (DRepPulsingState era) Source # 
Instance details

Defined in Cardano.Ledger.Conway.Governance.DRepPulser

Methods

rnfDRepPulsingState era → () Source #

EraPParams era ⇒ Eq (DRepPulsingState era) Source # 
Instance details

Defined in Cardano.Ledger.Conway.Governance.DRepPulser

EraPParams era ⇒ NoThunks (DRepPulsingState era) Source # 
Instance details

Defined in Cardano.Ledger.Conway.Governance.DRepPulser

type Rep (DRepPulsingState era) Source # 
Instance details

Defined in Cardano.Ledger.Conway.Governance.DRepPulser

type Rep (DRepPulsingState era) = D1 ('MetaData "DRepPulsingState" "Cardano.Ledger.Conway.Governance.DRepPulser" "cardano-ledger-conway-1.18.0.0-inplace" 'False) (C1 ('MetaCons "DRPulsing" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (DRepPulser era Identity (RatifyState era)))) :+: C1 ('MetaCons "DRComplete" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PulsingSnapshot era)) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (RatifyState era))))
type Share (DRepPulsingState era) Source # 
Instance details

Defined in Cardano.Ledger.Conway.Governance.DRepPulser

type Share (DRepPulsingState era) = ()

data DRepPulser era (m ∷ TypeType) ans where Source #

The type of a Pulser which uses computeDRepDistr as its underlying function. Note that we use two type equality (~) constraints to fix both the monad m and the ans type, to the context where we will use the type as a Pulser. The type DRepPulser must have m and ans as its last two parameters so we can make a Pulsable instance. We will always use this instantiation (DRepPulser era Identity (RatifyState era))

Constructors

DRepPulser 

Fields

Instances

Instances details
Pulsable (DRepPulser era) Source # 
Instance details

Defined in Cardano.Ledger.Conway.Governance.DRepPulser

Methods

done ∷ ∀ (m ∷ TypeType) ans. DRepPulser era m ans → Bool Source #

current ∷ ∀ (m ∷ TypeType) ans. DRepPulser era m ans → ans Source #

pulseMMonad m ⇒ DRepPulser era m ans → m (DRepPulser era m ans) Source #

completeMMonad m ⇒ DRepPulser era m ans → m ans Source #

(EraPParams era, Show ans) ⇒ Show (DRepPulser era m ans) Source # 
Instance details

Defined in Cardano.Ledger.Conway.Governance.DRepPulser

Methods

showsPrecIntDRepPulser era m ans → ShowS Source #

showDRepPulser era m ans → String Source #

showList ∷ [DRepPulser era m ans] → ShowS Source #

EraPParams era ⇒ NFData (DRepPulser era Identity (RatifyState era)) Source # 
Instance details

Defined in Cardano.Ledger.Conway.Governance.DRepPulser

Methods

rnfDRepPulser era Identity (RatifyState era) → () Source #

EraPParams era ⇒ Eq (DRepPulser era Identity (RatifyState era)) Source # 
Instance details

Defined in Cardano.Ledger.Conway.Governance.DRepPulser

EraPParams era ⇒ NoThunks (DRepPulser era Identity (RatifyState era)) Source # 
Instance details

Defined in Cardano.Ledger.Conway.Governance.DRepPulser

computeDRepDistr ∷ ∀ c. Map (Credential 'Staking c) (CompactForm Coin) → Map (Credential 'DRepRole c) (DRepState c) → Map (Credential 'Staking c) (CompactForm Coin) → PoolDistr c → Map (DRep c) (CompactForm Coin) → Map (Credential 'Staking c) (UMElem c) → (Map (DRep c) (CompactForm Coin), PoolDistr c) Source #

We iterate over a pulse-sized chunk of the UMap.

For each staking credential in the chunk that has delegated to a DRep, add the stake distribution, rewards, and proposal deposits for that credential to the DRep distribution, if the DRep is a DRepCredential (also, AlwaysAbstain or AlwaysNoConfidence) and a member of the registered DReps. If the DRepCredential is not a member of the registered DReps, ignore and skip that DRep.

For each staking credential in the chunk that has delegated to an SPO, add only the proposal deposits for that credential to the stake pool distribution, since the rewards and stake are already added to it by the SNAP rule.

Give or take, this operation has roughly O (a * (log(b) + log(c) + log(d) + log(e) + log(f))) complexity, where, (a) is the size of the chunk of the UMap, which is the pulse-size, iterate over (b) is the size of the StakeDistr, lookup (c) is the size of the DRepDistr, insertWith (d) is the size of the dpProposalDeposits, lookup (e) is the size of the registered DReps, lookup (f) is the size of the PoolDistr, insert

psDRepDistrGSimpleGetter (DRepPulsingState era) (Map (DRep (EraCrypto era)) (CompactForm Coin)) Source #

This is potentially an expensive getter. Make sure not to use it in the first 80% of the epoch.

data PulsingSnapshot era Source #

A snapshot of information from the previous epoch stored inside the Pulser. After the pulser completes, but before the epoch turns, this information is store in the DRComplete constructor of the DRepPulsingState These are the values at the start of the current epoch. This allows the API To access these "previous" values, both during and after pulsing.

Instances

Instances details
EraPParams era ⇒ ToJSON (PulsingSnapshot era) Source # 
Instance details

Defined in Cardano.Ledger.Conway.Governance.DRepPulser

Generic (PulsingSnapshot era) Source # 
Instance details

Defined in Cardano.Ledger.Conway.Governance.DRepPulser

Associated Types

type Rep (PulsingSnapshot era) ∷ TypeType Source #

EraPParams era ⇒ Show (PulsingSnapshot era) Source # 
Instance details

Defined in Cardano.Ledger.Conway.Governance.DRepPulser

EraPParams era ⇒ FromCBOR (PulsingSnapshot era) Source # 
Instance details

Defined in Cardano.Ledger.Conway.Governance.DRepPulser

EraPParams era ⇒ ToCBOR (PulsingSnapshot era) Source # 
Instance details

Defined in Cardano.Ledger.Conway.Governance.DRepPulser

Methods

toCBORPulsingSnapshot era → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (PulsingSnapshot era) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [PulsingSnapshot era] → Size Source #

EraPParams era ⇒ DecCBOR (PulsingSnapshot era) Source # 
Instance details

Defined in Cardano.Ledger.Conway.Governance.DRepPulser

EraPParams era ⇒ DecShareCBOR (PulsingSnapshot era) Source # 
Instance details

Defined in Cardano.Ledger.Conway.Governance.DRepPulser

Associated Types

type Share (PulsingSnapshot era) Source #

EraPParams era ⇒ EncCBOR (PulsingSnapshot era) Source # 
Instance details

Defined in Cardano.Ledger.Conway.Governance.DRepPulser

Methods

encCBORPulsingSnapshot era → Encoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy (PulsingSnapshot era) → Size Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [PulsingSnapshot era] → Size Source #

Default (PulsingSnapshot era) Source # 
Instance details

Defined in Cardano.Ledger.Conway.Governance.DRepPulser

Methods

defPulsingSnapshot era Source #

EraPParams era ⇒ NFData (PulsingSnapshot era) Source # 
Instance details

Defined in Cardano.Ledger.Conway.Governance.DRepPulser

Methods

rnfPulsingSnapshot era → () Source #

EraPParams era ⇒ Eq (PulsingSnapshot era) Source # 
Instance details

Defined in Cardano.Ledger.Conway.Governance.DRepPulser

EraPParams era ⇒ NoThunks (PulsingSnapshot era) Source # 
Instance details

Defined in Cardano.Ledger.Conway.Governance.DRepPulser

type Rep (PulsingSnapshot era) Source # 
Instance details

Defined in Cardano.Ledger.Conway.Governance.DRepPulser

type Rep (PulsingSnapshot era) = D1 ('MetaData "PulsingSnapshot" "Cardano.Ledger.Conway.Governance.DRepPulser" "cardano-ledger-conway-1.18.0.0-inplace" 'False) (C1 ('MetaCons "PulsingSnapshot" 'PrefixI 'True) ((S1 ('MetaSel ('Just "psProposals") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StrictSeq (GovActionState era))) :*: S1 ('MetaSel ('Just "psDRepDistr") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (DRep (EraCrypto era)) (CompactForm Coin)))) :*: (S1 ('MetaSel ('Just "psDRepState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (Credential 'DRepRole (EraCrypto era)) (DRepState (EraCrypto era)))) :*: S1 ('MetaSel ('Just "psPoolDistr") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map (KeyHash 'StakePool (EraCrypto era)) (CompactForm Coin))))))
type Share (PulsingSnapshot era) Source # 
Instance details

Defined in Cardano.Ledger.Conway.Governance.DRepPulser

type Share (PulsingSnapshot era) = ()

class (STS (ConwayRATIFY era), Signal (ConwayRATIFY era) ~ RatifySignal era, BaseM (ConwayRATIFY era) ~ Reader Globals, Environment (ConwayRATIFY era) ~ RatifyEnv era, State (ConwayRATIFY era) ~ RatifyState era, PredicateFailure (ConwayRATIFY era) ~ Void) ⇒ RunConwayRatify era where Source #

Minimal complete definition

Nothing

Methods

runConwayRatifyGlobalsRatifyEnv era → RatifyState era → RatifySignal era → RatifyState era Source #

Instances

Instances details
Crypto c ⇒ RunConwayRatify (ConwayEra c) Source # 
Instance details

Defined in Cardano.Ledger.Conway