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) ContributeToValidatorsAndCommunityPool(ctx sdk.Context, reward sdk.Coin, senderModule string) (updatedReward sdk.Coin, err error)
- func (k Keeper) DistributeBlockReward(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.BasePayGenesis)
- func (k Keeper) GetAllIprpcReward(ctx sdk.Context) (list []types.IprpcReward)
- func (k Keeper) GetAllIprpcSubscription(ctx sdk.Context) []string
- 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) 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) 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) ProviderReward(goCtx context.Context, req *types.QueryProviderRewardRequest) (*types.QueryProviderRewardResponse, error)
- 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.BasePayGenesis)
- 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) 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) 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) 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) 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.BasePayGenesis)
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) 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) 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) ProviderReward ¶
func (k Keeper) ProviderReward(goCtx context.Context, req *types.QueryProviderRewardRequest) (*types.QueryProviderRewardResponse, error)
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.BasePayGenesis)
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) 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) 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_provider_reward.go
- grpc_query_show_iprpc_data.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