cardano-ledger-shelley-1.16.0.0: Shelley Ledger Executable Model
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Ledger.Shelley.RewardUpdate

Description

How to compute the reward update compuation. Also, how to spread the compuation over many blocks, once the chain reaches a stability point.

Synopsis

Documentation

data RewardAns Source #

The result of reward calculation is a pair of aggregate Maps. One for the accumulated answer, and one for the answer since the last pulse

Instances

Instances details
Generic RewardAns Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Associated Types

type Rep RewardAnsTypeType Source #

Show RewardAns Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

DecCBOR Pulser Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

DecCBOR RewardAns Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

EncCBOR Pulser Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

encCBORPulserEncoding Source #

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

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

EncCBOR RewardAns Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

encCBORRewardAnsEncoding Source #

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

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

NFData Pulser Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

rnfPulser → () Source #

NFData RewardAns Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

rnfRewardAns → () Source #

Eq RewardAns Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

NoThunks Pulser Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

NoThunks RewardAns Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

type Rep RewardAns Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

type Rep RewardAns = D1 ('MetaData "RewardAns" "Cardano.Ledger.Shelley.RewardUpdate" "cardano-ledger-shelley-1.16.0.0-inplace" 'False) (C1 ('MetaCons "RewardAns" 'PrefixI 'True) (S1 ('MetaSel ('Just "accumRewardAns") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (Credential 'Staking) Reward)) :*: S1 ('MetaSel ('Just "recentRewardAns") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 RewardEvent)))

type Pulser = RewardPulser ShelleyBase RewardAns Source #

The type of RewardPulser we pulse on.

data RewardUpdate Source #

The ultimate goal of a reward update computation. Aggregating rewards for each staking credential.

Constructors

RewardUpdate 

Instances

Instances details
ToJSON RewardUpdate Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Generic RewardUpdate Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Associated Types

type Rep RewardUpdateTypeType Source #

Show RewardUpdate Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

DecCBOR RewardUpdate Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

EncCBOR RewardUpdate Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

NFData RewardUpdate Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

rnfRewardUpdate → () Source #

Eq RewardUpdate Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

NoThunks RewardUpdate Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

type Rep RewardUpdate Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

type Rep RewardUpdate = D1 ('MetaData "RewardUpdate" "Cardano.Ledger.Shelley.RewardUpdate" "cardano-ledger-shelley-1.16.0.0-inplace" 'False) (C1 ('MetaCons "RewardUpdate" 'PrefixI 'True) ((S1 ('MetaSel ('Just "deltaT") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 DeltaCoin) :*: S1 ('MetaSel ('Just "deltaR") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 DeltaCoin)) :*: (S1 ('MetaSel ('Just "rs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (Credential 'Staking) (Set Reward))) :*: (S1 ('MetaSel ('Just "deltaF") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 DeltaCoin) :*: S1 ('MetaSel ('Just "nonMyopic") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NonMyopic)))))

data RewardSnapShot Source #

To complete the reward update, we need a snap shot of the EpochState particular to this computation

Instances

Instances details
Generic RewardSnapShot Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Associated Types

type Rep RewardSnapShotTypeType Source #

Show RewardSnapShot Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

DecCBOR RewardSnapShot Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

EncCBOR RewardSnapShot Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

NFData RewardSnapShot Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

rnfRewardSnapShot → () Source #

Eq RewardSnapShot Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

NoThunks RewardSnapShot Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

type Rep RewardSnapShot Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

type Rep RewardSnapShot = D1 ('MetaData "RewardSnapShot" "Cardano.Ledger.Shelley.RewardUpdate" "cardano-ledger-shelley-1.16.0.0-inplace" 'False) (C1 ('MetaCons "RewardSnapShot" 'PrefixI 'True) (((S1 ('MetaSel ('Just "rewFees") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin) :*: S1 ('MetaSel ('Just "rewProtocolVersion") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ProtVer)) :*: (S1 ('MetaSel ('Just "rewNonMyopic") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NonMyopic) :*: S1 ('MetaSel ('Just "rewDeltaR1") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin))) :*: ((S1 ('MetaSel ('Just "rewR") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin) :*: S1 ('MetaSel ('Just "rewDeltaT1") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin)) :*: (S1 ('MetaSel ('Just "rewLikelihoods") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'StakePool) Likelihood)) :*: S1 ('MetaSel ('Just "rewLeaders") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (Credential 'Staking) (Set Reward)))))))

data FreeVars Source #

Instances

Instances details
Generic FreeVars Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Associated Types

type Rep FreeVarsTypeType Source #

Show FreeVars Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

DecCBOR FreeVars Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

EncCBOR FreeVars Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

encCBORFreeVarsEncoding Source #

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

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

NFData FreeVars Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

rnfFreeVars → () Source #

Eq FreeVars Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

NoThunks FreeVars Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

type Rep FreeVars Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

type Rep FreeVars = D1 ('MetaData "FreeVars" "Cardano.Ledger.Shelley.RewardUpdate" "cardano-ledger-shelley-1.16.0.0-inplace" 'False) (C1 ('MetaCons "FreeVars" 'PrefixI 'True) ((S1 ('MetaSel ('Just "fvDelegs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (VMap VB VB (Credential 'Staking) (KeyHash 'StakePool))) :*: S1 ('MetaSel ('Just "fvAddrsRew") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set (Credential 'Staking)))) :*: (S1 ('MetaSel ('Just "fvTotalStake") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin) :*: (S1 ('MetaSel ('Just "fvProtVer") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ProtVer) :*: S1 ('MetaSel ('Just "fvPoolRewardInfo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'StakePool) PoolRewardInfo))))))

rewardStakePoolMemberFreeVarsRewardAnsCredential 'StakingCompactForm CoinRewardAns Source #

The function to call on each reward update pulse. Called by the pulser.

data RewardPulser (m ∷ TypeType) ans where Source #

The type of a Pulser which uses rewardStakePoolMember as its underlying function. rewardStakePool will be partially applied to the component of type (FreeVars c) when pulsing. 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 must have m and ans as its last two parameters so we can make a Pulsable instance. RSLP = Reward Serializable Listbased Pulser

Constructors

RSLP ∷ (ans ~ RewardAns, m ~ ShelleyBase) ⇒ !Int → !FreeVars → !(VMap VB VP (Credential 'Staking) (CompactForm Coin)) → !ans → RewardPulser m ans 

Instances

Instances details
Pulsable RewardPulser Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

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

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

pulseMMonad m ⇒ RewardPulser m ans → m (RewardPulser m ans) Source #

completeMMonad m ⇒ RewardPulser m ans → m ans Source #

DecCBOR Pulser Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

EncCBOR Pulser Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

encCBORPulserEncoding Source #

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

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

NFData Pulser Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

rnfPulser → () Source #

NoThunks Pulser Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Show ans ⇒ Show (RewardPulser m ans) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

showsPrecIntRewardPulser m ans → ShowS Source #

showRewardPulser m ans → String Source #

showList ∷ [RewardPulser m ans] → ShowS Source #

Eq ans ⇒ Eq (RewardPulser m ans) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

(==)RewardPulser m ans → RewardPulser m ans → Bool Source #

(/=)RewardPulser m ans → RewardPulser m ans → Bool Source #

data PulsingRewUpdate Source #

The state used in the STS rules

Instances

Instances details
ToJSON PulsingRewUpdate Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Generic PulsingRewUpdate Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Associated Types

type Rep PulsingRewUpdateTypeType Source #

Show PulsingRewUpdate Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

DecCBOR PulsingRewUpdate Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

EncCBOR PulsingRewUpdate Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

NFData PulsingRewUpdate Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

rnfPulsingRewUpdate → () Source #

Eq PulsingRewUpdate Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

NoThunks PulsingRewUpdate Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

type Rep PulsingRewUpdate Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

type Rep PulsingRewUpdate = D1 ('MetaData "PulsingRewUpdate" "Cardano.Ledger.Shelley.RewardUpdate" "cardano-ledger-shelley-1.16.0.0-inplace" 'False) (C1 ('MetaCons "Pulsing" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 RewardSnapShot) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Pulser)) :+: C1 ('MetaCons "Complete" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 RewardUpdate)))