cardano-ledger-shelley-1.15.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 c 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

Constructors

RewardAns 

Instances

Instances details
Generic (RewardAns c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Associated Types

type Rep (RewardAns c) ∷ TypeType Source #

Methods

fromRewardAns c → Rep (RewardAns c) x Source #

toRep (RewardAns c) x → RewardAns c Source #

Show (RewardAns c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Crypto c ⇒ DecCBOR (Pulser c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

decCBORDecoder s (Pulser c) Source #

dropCBORProxy (Pulser c) → Decoder s () Source #

labelProxy (Pulser c) → Text Source #

Crypto c ⇒ DecCBOR (RewardAns c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Crypto c ⇒ EncCBOR (Pulser c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

encCBORPulser c → Encoding Source #

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

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

Crypto c ⇒ EncCBOR (RewardAns c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

encCBORRewardAns c → Encoding Source #

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

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

NFData (Pulser c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

rnfPulser c → () Source #

NFData (RewardAns c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

rnfRewardAns c → () Source #

Eq (RewardAns c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

(==)RewardAns c → RewardAns c → Bool Source #

(/=)RewardAns c → RewardAns c → Bool Source #

Typeable c ⇒ NoThunks (Pulser c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

NoThunks (RewardAns c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

type Rep (RewardAns c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

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

type Pulser c = RewardPulser c ShelleyBase (RewardAns c) Source #

The type of RewardPulser we pulse on.

data RewardUpdate c Source #

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

Constructors

RewardUpdate 

Fields

Instances

Instances details
Crypto c ⇒ ToJSON (RewardUpdate c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Generic (RewardUpdate c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Associated Types

type Rep (RewardUpdate c) ∷ TypeType Source #

Show (RewardUpdate c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Crypto c ⇒ DecCBOR (RewardUpdate c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Crypto c ⇒ EncCBOR (RewardUpdate c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

encCBORRewardUpdate c → Encoding Source #

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

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

NFData (RewardUpdate c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

rnfRewardUpdate c → () Source #

Eq (RewardUpdate c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

NoThunks (RewardUpdate c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

type Rep (RewardUpdate c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

type Rep (RewardUpdate c) = D1 ('MetaData "RewardUpdate" "Cardano.Ledger.Shelley.RewardUpdate" "cardano-ledger-shelley-1.15.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 c) (Set (Reward c)))) :*: (S1 ('MetaSel ('Just "deltaF") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 DeltaCoin) :*: S1 ('MetaSel ('Just "nonMyopic") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (NonMyopic c))))))

data RewardSnapShot c Source #

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

Instances

Instances details
Generic (RewardSnapShot c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Associated Types

type Rep (RewardSnapShot c) ∷ TypeType Source #

Show (RewardSnapShot c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Crypto c ⇒ DecCBOR (RewardSnapShot c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Crypto c ⇒ EncCBOR (RewardSnapShot c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

encCBORRewardSnapShot c → Encoding Source #

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

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

NFData (RewardSnapShot c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

rnfRewardSnapShot c → () Source #

Eq (RewardSnapShot c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Typeable c ⇒ NoThunks (RewardSnapShot c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

type Rep (RewardSnapShot c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

type Rep (RewardSnapShot c) = D1 ('MetaData "RewardSnapShot" "Cardano.Ledger.Shelley.RewardUpdate" "cardano-ledger-shelley-1.15.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 c)) :*: 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 c) Likelihood)) :*: S1 ('MetaSel ('Just "rewLeaders") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (Credential 'Staking c) (Set (Reward c))))))))

data FreeVars c Source #

Instances

Instances details
Generic (FreeVars c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Associated Types

type Rep (FreeVars c) ∷ TypeType Source #

Methods

fromFreeVars c → Rep (FreeVars c) x Source #

toRep (FreeVars c) x → FreeVars c Source #

Show (FreeVars c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Crypto c ⇒ DecCBOR (FreeVars c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Crypto c ⇒ EncCBOR (FreeVars c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

encCBORFreeVars c → Encoding Source #

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

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

NFData (FreeVars c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

rnfFreeVars c → () Source #

Eq (FreeVars c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

(==)FreeVars c → FreeVars c → Bool Source #

(/=)FreeVars c → FreeVars c → Bool Source #

Typeable c ⇒ NoThunks (FreeVars c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

type Rep (FreeVars c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

type Rep (FreeVars c) = D1 ('MetaData "FreeVars" "Cardano.Ledger.Shelley.RewardUpdate" "cardano-ledger-shelley-1.15.0.0-inplace" 'False) (C1 ('MetaCons "FreeVars" 'PrefixI 'True) ((S1 ('MetaSel ('Just "fvDelegs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (VMap VB VB (Credential 'Staking c) (KeyHash 'StakePool c))) :*: S1 ('MetaSel ('Just "fvAddrsRew") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set (Credential 'Staking c)))) :*: (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 c) (PoolRewardInfo c)))))))

rewardStakePoolMemberFreeVars c → RewardAns c → Credential 'Staking c → CompactForm CoinRewardAns c Source #

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

data RewardPulser c (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 c, m ~ ShelleyBase) ⇒ !Int → !(FreeVars c) → !(VMap VB VP (Credential 'Staking c) (CompactForm Coin)) → !ans → RewardPulser c m ans 

Instances

Instances details
Pulsable (RewardPulser c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

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

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

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

completeMMonad m ⇒ RewardPulser c m ans → m ans Source #

Crypto c ⇒ DecCBOR (Pulser c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

decCBORDecoder s (Pulser c) Source #

dropCBORProxy (Pulser c) → Decoder s () Source #

labelProxy (Pulser c) → Text Source #

Crypto c ⇒ EncCBOR (Pulser c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

encCBORPulser c → Encoding Source #

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

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

NFData (Pulser c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

rnfPulser c → () Source #

Typeable c ⇒ NoThunks (Pulser c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

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

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

showsPrecIntRewardPulser c m ans → ShowS Source #

showRewardPulser c m ans → String Source #

showList ∷ [RewardPulser c m ans] → ShowS Source #

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

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

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

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

data PulsingRewUpdate c Source #

The state used in the STS rules

Constructors

Pulsing !(RewardSnapShot c) !(Pulser c) 
Complete !(RewardUpdate c) 

Instances

Instances details
Crypto c ⇒ ToJSON (PulsingRewUpdate c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Generic (PulsingRewUpdate c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Associated Types

type Rep (PulsingRewUpdate c) ∷ TypeType Source #

Show (PulsingRewUpdate c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Crypto c ⇒ DecCBOR (PulsingRewUpdate c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Crypto c ⇒ EncCBOR (PulsingRewUpdate c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

NFData (PulsingRewUpdate c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

rnfPulsingRewUpdate c → () Source #

Eq (PulsingRewUpdate c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Typeable c ⇒ NoThunks (PulsingRewUpdate c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

type Rep (PulsingRewUpdate c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

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