Documentation ¶
Index ¶
- Constants
- func GetIprpcRewardIDBytes(id uint64) []byte
- func GetIprpcRewardIDFromBytes(bz []byte) uint64
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type Keeper
- func (k Keeper) AggregateCU(ctx sdk.Context, subscription, provider string, chainID string, cu uint64)
- func (k Keeper) AggregateRewards(ctx sdk.Context, provider, chainid string, adjustment sdk.Dec, ...)
- func (k Keeper) AllocationPoolMonthsLeft(ctx sdk.Context) int64
- func (k Keeper) BeginBlock(ctx sdk.Context)
- func (k Keeper) BlockReward(goCtx context.Context, req *types.QueryBlockRewardRequest) (*types.QueryBlockRewardResponse, error)
- func (k Keeper) BlocksToNextTimerExpiry(ctx sdk.Context) int64
- func (k Keeper) BondedTargetFactor(ctx sdk.Context) cosmosMath.LegacyDec
- func (k Keeper) BurnPoolTokens(ctx sdk.Context, pool types.Pool, amt math.Int, denom string) error
- func (k Keeper) CalculateContributionPercentages(ctx sdk.Context, reward math.Int) (validatorsParticipation math.LegacyDec, communityParticipation math.LegacyDec, ...)
- func (k Keeper) CalculateValidatorsAndCommunityParticipationRewards(ctx sdk.Context, reward sdk.Coin) (validatorsCoins sdk.Coins, communityCoins sdk.Coins, err error)
- func (k Keeper) ContributeToValidatorsAndCommunityPool(ctx sdk.Context, reward sdk.Coin, senderModule string) (updatedReward sdk.Coin, err error)
- func (k Keeper) DistributeBlockReward(ctx sdk.Context)
- func (k Keeper) DistributeMonthlyBonusRewards(ctx sdk.Context)
- func (k Keeper) ExportRewardsRefillTS(ctx sdk.Context) timerstoretypes.GenesisState
- func (k Keeper) FundCommunityPoolFromModule(ctx sdk.Context, amount sdk.Coins, senderModule string) error
- func (k Keeper) FundIprpc(ctx sdk.Context, creator string, duration uint64, fund sdk.Coins, spec string) error
- func (k Keeper) GetAllBasePay(ctx sdk.Context) (list []types.BasePayWithIndex)
- func (k Keeper) GetAllIprpcReward(ctx sdk.Context) (list []types.IprpcReward)
- func (k Keeper) GetAllIprpcSubscription(ctx sdk.Context) []string
- func (k Keeper) GetCommunityTax(ctx sdk.Context) math.LegacyDec
- func (k Keeper) GetCurrentIprpcReward(ctx sdk.Context) (types.IprpcReward, bool)
- func (k Keeper) GetIprpcReward(ctx sdk.Context, id uint64) (val types.IprpcReward, found bool)
- func (k Keeper) GetIprpcRewardsCurrentId(ctx sdk.Context) uint64
- func (k Keeper) GetLastRewardsBlock(ctx sdk.Context) (rewardsDistributionBlock uint64, after24HoursBlock uint64, err error)
- func (k Keeper) GetMinIprpcCost(ctx sdk.Context) sdk.Coin
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k Keeper) InitRewardsRefillTS(ctx sdk.Context, gs timerstoretypes.GenesisState)
- func (k Keeper) IprpcProviderRewardEstimation(goCtx context.Context, req *types.QueryIprpcProviderRewardEstimationRequest) (*types.QueryIprpcProviderRewardEstimationResponse, error)
- func (k Keeper) IprpcSpecReward(goCtx context.Context, req *types.QueryIprpcSpecRewardRequest) (*types.QueryIprpcSpecRewardResponse, error)
- func (k Keeper) IsIprpcSubscription(ctx sdk.Context, address string) bool
- func (k Keeper) LeftoverBurnRate(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) LowFactor(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) MaxBondedTarget(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) MaxRewardBoost(ctx sdk.Context) (res uint64)
- func (k Keeper) MinBondedTarget(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) MovePoolToPool(ctx sdk.Context, from types.Pool, to types.Pool)
- func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) Pools(goCtx context.Context, req *types.QueryPoolsRequest) (*types.QueryPoolsResponse, error)
- func (k Keeper) PopIprpcReward(ctx sdk.Context) (types.IprpcReward, bool)
- func (k Keeper) RefillRewardsPools(ctx sdk.Context, _ []byte, data []byte)
- func (k Keeper) RemoveIprpcReward(ctx sdk.Context, id uint64)
- func (k Keeper) RemoveIprpcSubscription(ctx sdk.Context, address string)
- func (k Keeper) SetAllBasePay(ctx sdk.Context, list []types.BasePayWithIndex)
- func (k Keeper) SetIprpcData(ctx sdk.Context, cost sdk.Coin, subs []string) error
- func (k Keeper) SetIprpcReward(ctx sdk.Context, iprpcReward types.IprpcReward)
- func (k Keeper) SetIprpcRewardsCurrentId(ctx sdk.Context, current uint64)
- func (k Keeper) SetIprpcSubscription(ctx sdk.Context, address string)
- func (k Keeper) SetLastRewardsBlock(ctx sdk.Context) error
- func (k Keeper) SetMinIprpcCost(ctx sdk.Context, cost sdk.Coin)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) ShowIprpcData(goCtx context.Context, req *types.QueryShowIprpcDataRequest) (*types.QueryShowIprpcDataResponse, error)
- func (k Keeper) SpecEmissionParts(ctx sdk.Context) (emissions []types.SpecEmissionPart)
- func (k Keeper) SpecTotalPayout(ctx sdk.Context, totalMonthlyPayout math.Int, ...) math.LegacyDec
- func (k Keeper) SpecTrackedInfo(goCtx context.Context, req *types.QuerySpecTrackedInfoRequest) (*types.QuerySpecTrackedInfoResponse, error)
- func (k Keeper) TimeToNextTimerExpiry(ctx sdk.Context) int64
- func (k Keeper) TotalPoolTokens(ctx sdk.Context, pool types.Pool) sdk.Coins
- func (k Keeper) ValidatorsSubscriptionParticipation(ctx sdk.Context) (res sdk.Dec)
- type Migrator
Constants ¶
const DAY_SECONDS = 60 * 60 * 24
Variables ¶
This section is empty.
Functions ¶
func GetIprpcRewardIDBytes ¶
GetIprpcRewardIDBytes returns the byte representation of the ID
func GetIprpcRewardIDFromBytes ¶
GetIprpcRewardIDFromBytes returns ID in uint64 format from a byte array
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeKey, memKey storetypes.StoreKey, ps paramtypes.Subspace, bankKeeper types.BankKeeper, accountKeeper types.AccountKeeper, specKeeper types.SpecKeeper, epochStorageKeeper types.EpochstorageKeeper, downtimeKeeper types.DowntimeKeeper, stakingKeeper types.StakingKeeper, dualstakingKeeper types.DualStakingKeeper, distributionKeeper types.DistributionKeeper, feeCollectorName string, timerStoreKeeper types.TimerStoreKeeper, authority string, ) *Keeper
func (Keeper) AggregateCU ¶
func (Keeper) AggregateRewards ¶
func (Keeper) AllocationPoolMonthsLeft ¶
AllocationPoolMonthsLeft returns the amount of months the allocation pools have left before all their are depleted
func (Keeper) BeginBlock ¶
redeclaring BeginBlock for testing (this is not called outside of unit tests)
func (Keeper) BlockReward ¶
func (k Keeper) BlockReward(goCtx context.Context, req *types.QueryBlockRewardRequest) (*types.QueryBlockRewardResponse, error)
func (Keeper) BlocksToNextTimerExpiry ¶
BlocksToNextTimerExpiry extracts the timer's expiry block from the timer's subkey and returns the amount of blocks remaining (according to the current block height) the calculated blocks are multiplied with a slack factor (for error margin)
func (Keeper) BondedTargetFactor ¶
func (k Keeper) BondedTargetFactor(ctx sdk.Context) cosmosMath.LegacyDec
BondedTargetFactor calculates the bonded target factor which is used to calculate the validators block rewards
func (Keeper) BurnPoolTokens ¶
BurnPoolTokens removes coins from a pool module account
func (Keeper) CalculateContributionPercentages ¶
func (k Keeper) CalculateContributionPercentages(ctx sdk.Context, reward math.Int) (validatorsParticipation math.LegacyDec, communityParticipation math.LegacyDec, err error)
CalculateContributionPercentages calculates the providers' rewards participation to the validators and community pool
func (Keeper) CalculateValidatorsAndCommunityParticipationRewards ¶
func (Keeper) ContributeToValidatorsAndCommunityPool ¶
func (k Keeper) ContributeToValidatorsAndCommunityPool(ctx sdk.Context, reward sdk.Coin, senderModule string) (updatedReward sdk.Coin, err error)
ContributeToValidatorsAndCommunityPool transfers some of the providers' rewards to the validators and community pool the function return the updated reward after the participation deduction
func (Keeper) DistributeBlockReward ¶
func (Keeper) DistributeMonthlyBonusRewards ¶
Distribute bonus rewards to providers across all chains based on performance
func (Keeper) ExportRewardsRefillTS ¶
func (k Keeper) ExportRewardsRefillTS(ctx sdk.Context) timerstoretypes.GenesisState
ExportRewardsRefillTS exports refill pools timers data (for genesis)
func (Keeper) FundCommunityPoolFromModule ¶
func (Keeper) GetAllBasePay ¶
func (k Keeper) GetAllBasePay(ctx sdk.Context) (list []types.BasePayWithIndex)
GetAllBasePay returns all BasePay
func (Keeper) GetAllIprpcReward ¶
func (k Keeper) GetAllIprpcReward(ctx sdk.Context) (list []types.IprpcReward)
GetAllIprpcReward returns all IprpcReward
func (Keeper) GetAllIprpcSubscription ¶
GetAllIprpcSubscription returns all subscription from the IprpcSubscription store
func (Keeper) GetCurrentIprpcReward ¶
GetCurrentIprpcReward gets the lowest id IprpcReward object
func (Keeper) GetIprpcReward ¶
GetIprpcReward returns a IprpcReward from its id
func (Keeper) GetIprpcRewardsCurrentId ¶
GetIprpcRewardsCurrentId get the total number of IprpcReward
func (Keeper) GetLastRewardsBlock ¶
func (k Keeper) GetLastRewardsBlock(ctx sdk.Context) (rewardsDistributionBlock uint64, after24HoursBlock uint64, err error)
GetLastRewardsBlock returns the last block in which the IPRPC rewards were distributed and the block height of 24 hours later. This is used by the subscription module's estimate-rewards query
func (Keeper) GetMinIprpcCost ¶
GetMinIprpcCost gets the min iprpc cost
func (Keeper) InitRewardsRefillTS ¶
func (k Keeper) InitRewardsRefillTS(ctx sdk.Context, gs timerstoretypes.GenesisState)
InitRewardsRefillTS initializes the refill pools' timer store
func (Keeper) IprpcProviderRewardEstimation ¶
func (k Keeper) IprpcProviderRewardEstimation(goCtx context.Context, req *types.QueryIprpcProviderRewardEstimationRequest) (*types.QueryIprpcProviderRewardEstimationResponse, error)
func (Keeper) IprpcSpecReward ¶
func (k Keeper) IprpcSpecReward(goCtx context.Context, req *types.QueryIprpcSpecRewardRequest) (*types.QueryIprpcSpecRewardResponse, error)
func (Keeper) IsIprpcSubscription ¶
IsIprpcSubscription checks whether a subscription is IPRPC eligible subscription
func (Keeper) LeftoverBurnRate ¶
LeftoverBurnRate returns the LeftoverBurnRate param
func (Keeper) MaxBondedTarget ¶
MaxBondedTarget returns the MaxBondedTarget param
func (Keeper) MaxRewardBoost ¶
MaxRewardBoost returns the MaxRewardBoost param
func (Keeper) MinBondedTarget ¶
MinBondedTarget returns the MinBondedTarget param
func (Keeper) MovePoolToPool ¶
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) Pools ¶
func (k Keeper) Pools(goCtx context.Context, req *types.QueryPoolsRequest) (*types.QueryPoolsResponse, error)
func (Keeper) PopIprpcReward ¶
PopIprpcReward gets the lowest id IprpcReward object and removes it
func (Keeper) RefillRewardsPools ¶
RefillRewardsPools is called once a month (as a timer callback). it does the following for validators:
- burns the current token in the validators distribution pool by the burn rate
- transfers the monthly tokens quota from the validators allocation pool to the validators distribution pool
- opens a new timer for the next month (and encodes the expiry block and months left to allocation pool in it)
for providers: TBD
func (Keeper) RemoveIprpcReward ¶
RemoveIprpcReward removes a IprpcReward from the store
func (Keeper) RemoveIprpcSubscription ¶
RemoveIprpcSubscription removes a subscription from the IprpcSubscription store
func (Keeper) SetAllBasePay ¶
func (k Keeper) SetAllBasePay(ctx sdk.Context, list []types.BasePayWithIndex)
SetAllBasePay sets all BasePay
func (Keeper) SetIprpcData ¶
func (Keeper) SetIprpcReward ¶
func (k Keeper) SetIprpcReward(ctx sdk.Context, iprpcReward types.IprpcReward)
SetIprpcReward set a specific IprpcReward in the store
func (Keeper) SetIprpcRewardsCurrentId ¶
SetIprpcRewardsCurrentId set the total number of IprpcReward
func (Keeper) SetIprpcSubscription ¶
SetIprpcSubscription set a subscription in the IprpcSubscription store
func (Keeper) SetLastRewardsBlock ¶
SetLastRewardsBlock sets the lastRewardsBlock as the current height
func (Keeper) SetMinIprpcCost ¶
SetMinIprpcCost sets the min iprpc cost
func (Keeper) ShowIprpcData ¶
func (k Keeper) ShowIprpcData(goCtx context.Context, req *types.QueryShowIprpcDataRequest) (*types.QueryShowIprpcDataResponse, error)
func (Keeper) SpecEmissionParts ¶
func (k Keeper) SpecEmissionParts(ctx sdk.Context) (emissions []types.SpecEmissionPart)
func (Keeper) SpecTotalPayout ¶
func (k Keeper) SpecTotalPayout(ctx sdk.Context, totalMonthlyPayout math.Int, totalProvidersBaseRewards sdk.Dec, spec types.SpecEmissionPart) math.LegacyDec
SpecTotalPayout calculates the total bonus for a specific spec specPayoutAllocation: maximum rewards that the spec can have rewardBoost: bonus based on the total rewards providers got factored by maxboost diminishingRewards: makes sure to diminish the bonuses in case there are enough consumers on the chain
func (Keeper) SpecTrackedInfo ¶
func (k Keeper) SpecTrackedInfo(goCtx context.Context, req *types.QuerySpecTrackedInfoRequest) (*types.QuerySpecTrackedInfoResponse, error)
func (Keeper) TimeToNextTimerExpiry ¶
TimeToNextTimerExpiry returns the time in which the timer will expire (according to the current block time)
func (Keeper) TotalPoolTokens ¶
TotalPoolTokens gets the total tokens supply from a pool
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
func NewMigrator ¶
Source Files ¶
- base_pay.go
- grpc_query.go
- grpc_query_block_reward.go
- grpc_query_iprpc_provider_reward.go
- grpc_query_iprpc_spec_reward.go
- grpc_query_params.go
- grpc_query_pools.go
- grpc_query_show_iprpc_data.go
- grpc_query_spec_tracked_info.go
- iprpc.go
- iprpc_data.go
- iprpc_reward.go
- keeper.go
- migrations.go
- msg_server.go
- msg_server_fund_iprpc.go
- msg_server_set_iprpc_data.go
- params.go
- pool.go
- providers.go
- rewards.go