Documentation ¶
Index ¶
- Constants
- func AllInvariants(k Keeper) sdk.Invariant
- func GetLowestScoreFromAllForecasters(ctx context.Context, k *Keeper, topicId TopicId, forecasterAddresses []string) (lowScore types.Score, err error)
- func GetLowestScoreFromAllInferers(ctx context.Context, k *Keeper, topicId TopicId, infererAddresses []string) (lowScore types.Score, err error)
- func GetLowestScoreFromAllReputers(ctx context.Context, k *Keeper, topicId TopicId, reputerAddresses []string) (lowScore types.Score, err error)
- func NewDoublePrefixedQuadrupleRange[K1, K2, K3, K4 any](k1 K1, k2 K2) collections.Ranger[Quadruple[K1, K2, K3, K4]]
- func NewSinglePrefixUntilQuadrupleRange[K1, K2, K3, K4 any](k1 K1) collections.Ranger[Quadruple[K1, K2, K3, K4]]
- func NewSinglePrefixedQuadrupleRange[K1, K2, K3, K4 any](k1 K1) collections.Ranger[Quadruple[K1, K2, K3, K4]]
- func NewTriplePrefixedQuadrupleRange[K1, K2, K3, K4 any](k1 K1, k2 K2, k3 K3) collections.Ranger[Quadruple[K1, K2, K3, K4]]
- func QuadrupleKeyCodec[K1, K2, K3, K4 any](keyCodec1 codec.KeyCodec[K1], keyCodec2 codec.KeyCodec[K2], ...) codec.KeyCodec[Quadruple[K1, K2, K3, K4]]
- func RegisterInvariants(ir sdk.InvariantRegistry, k *Keeper)
- func StakingInvariantDelegatedStakes(k Keeper) sdk.Invariant
- func StakingInvariantLenStakeRemovalsSame(k Keeper) sdk.Invariant
- func StakingInvariantPendingRewardForDelegatorsGreaterThanRewardPerShareMinusRewardDebt(k Keeper) sdk.Invariant
- func StakingInvariantSumStakeFromStakeReputerAuthorityEqualTotalStakeAndTopicStake(k Keeper) sdk.Invariant
- func StakingInvariantTotalStakeEqualAlloraStakingBankBalance(k Keeper) sdk.Invariant
- func UpdateLowestScoreFromForecasterAddresses(ctx context.Context, k *Keeper, topicId TopicId, forecasterAddresses []string, ...) error
- func UpdateLowestScoreFromInfererAddresses(ctx context.Context, k *Keeper, topicId TopicId, infererAddresses []string, ...) error
- func UpdateLowestScoreFromReputerAddresses(ctx context.Context, k *Keeper, topicId TopicId, reputerAddresses []string, ...) error
- type AccountKeeper
- type ActorId
- type BankKeeper
- type BlockHeight
- type Delegator
- type Keeper
- func (k *Keeper) ActivateTopic(ctx context.Context, topicId TopicId) error
- func (k *Keeper) AddActiveForecaster(ctx context.Context, topicId TopicId, forecaster ActorId) error
- func (k *Keeper) AddActiveInferer(ctx context.Context, topicId TopicId, inferer ActorId) error
- func (k *Keeper) AddActiveReputer(ctx context.Context, topicId TopicId, reputer ActorId) error
- func (k *Keeper) AddDelegateStake(ctx context.Context, topicId TopicId, delegator ActorId, reputer ActorId, ...) error
- func (k *Keeper) AddReputerNonce(ctx context.Context, topicId TopicId, nonce *types.Nonce) error
- func (k *Keeper) AddReputerStake(ctx context.Context, topicId TopicId, reputer ActorId, ...) error
- func (k *Keeper) AddToGlobalWhitelist(ctx context.Context, actor ActorId) error
- func (k *Keeper) AddToTopicCreatorWhitelist(ctx context.Context, actor ActorId) error
- func (k *Keeper) AddToTopicReputerWhitelist(ctx context.Context, topicId TopicId, actor ActorId) error
- func (k *Keeper) AddToTopicWorkerWhitelist(ctx context.Context, topicId TopicId, actor ActorId) error
- func (k *Keeper) AddTopicFeeRevenue(ctx context.Context, topicId TopicId, amount cosmosMath.Int) error
- func (k *Keeper) AddWhitelistAdmin(ctx context.Context, admin ActorId) error
- func (k *Keeper) AddWorkerNonce(ctx context.Context, topicId TopicId, nonce *types.Nonce) error
- func (k *Keeper) AddWorkerWindowTopicId(ctx sdk.Context, height BlockHeight, topicId TopicId) error
- func (k *Keeper) AppendForecast(ctx sdk.Context, topic types.Topic, nonceBlockHeight BlockHeight, ...) error
- func (k *Keeper) AppendInference(ctx sdk.Context, topic types.Topic, nonceBlockHeight BlockHeight, ...) error
- func (k *Keeper) AppendReputerLoss(ctx sdk.Context, topic types.Topic, moduleParams types.Params, ...) error
- func (k *Keeper) AttemptTopicReactivation(ctx context.Context, topicId TopicId) error
- func (k *Keeper) BlockWithinReputerSubmissionWindowOfNonce(topic types.Topic, nonce types.ReputerRequestNonce, blockHeight int64) bool
- func (k *Keeper) BlockWithinWorkerSubmissionWindowOfNonce(topic types.Topic, nonce types.Nonce, blockHeight int64) bool
- func (k *Keeper) CalcAndSaveForecasterScoreEmaForActiveSet(ctx context.Context, topic types.Topic, block types.BlockHeight, ...) (types.Score, error)
- func (k *Keeper) CalcAndSaveForecasterScoreEmaWithLastSavedTopicQuantile(ctx sdk.Context, topic types.Topic, block types.BlockHeight, ...) error
- func (k *Keeper) CalcAndSaveInfererScoreEmaForActiveSet(ctx context.Context, topic types.Topic, block types.BlockHeight, ...) (types.Score, error)
- func (k *Keeper) CalcAndSaveInfererScoreEmaWithLastSavedTopicQuantile(ctx sdk.Context, topic types.Topic, block types.BlockHeight, ...) error
- func (k *Keeper) CalcAndSaveReputerScoreEmaForActiveSet(ctx context.Context, topic types.Topic, block types.BlockHeight, ...) (types.Score, error)
- func (k *Keeper) CalcAndSaveReputerScoreEmaWithLastSavedTopicQuantile(ctx sdk.Context, topic types.Topic, block types.BlockHeight, ...) error
- func (k Keeper) CalcAppropriatePaginationForUint64Cursor(ctx context.Context, pagination *types.SimpleCursorPaginationRequest) (uint64, uint64, error)
- func (k *Keeper) CanAddReputerStake(ctx context.Context, topicId TopicId, actor ActorId) (bool, error)
- func (k *Keeper) CanCreateTopic(ctx context.Context, actor ActorId) (bool, error)
- func (k *Keeper) CanSubmitReputerPayload(ctx context.Context, topicId TopicId, actor ActorId) (bool, error)
- func (k *Keeper) CanSubmitWorkerPayload(ctx context.Context, topicId TopicId, actor ActorId) (bool, error)
- func (k *Keeper) CanUpdateGlobalWhitelists(ctx context.Context, actor ActorId) (bool, error)
- func (k *Keeper) CanUpdateParams(ctx context.Context, actor ActorId) (bool, error)
- func (k *Keeper) CanUpdateTopicCreatorWhitelist(ctx context.Context, actor ActorId) (bool, error)
- func (k *Keeper) CanUpdateTopicWhitelist(ctx context.Context, topicId TopicId, actor ActorId) (bool, error)
- func (k *Keeper) DeleteDelegateStakeRemoval(ctx context.Context, blockHeight BlockHeight, topicId TopicId, reputer ActorId, ...) error
- func (k *Keeper) DeleteStakeRemoval(ctx context.Context, blockHeight BlockHeight, topicId TopicId, address ActorId) error
- func (k *Keeper) DeleteTopicRewardNonce(ctx context.Context, topicId TopicId) error
- func (k *Keeper) DeleteUnfulfilledReputerNonces(ctx context.Context, topicId TopicId) error
- func (k *Keeper) DeleteUnfulfilledWorkerNonces(ctx context.Context, topicId TopicId) error
- func (k *Keeper) DeleteWorkerWindowBlockHeight(ctx sdk.Context, height BlockHeight) error
- func (k *Keeper) DisableTopicReputerWhitelist(ctx context.Context, topicId TopicId) error
- func (k *Keeper) DisableTopicWorkerWhitelist(ctx context.Context, topicId TopicId) error
- func (k *Keeper) DripTopicFeeRevenue(ctx sdk.Context, topicId TopicId, block BlockHeight) error
- func (k *Keeper) EnableTopicReputerWhitelist(ctx context.Context, topicId TopicId) error
- func (k *Keeper) EnableTopicWorkerWhitelist(ctx context.Context, topicId TopicId) error
- func (k *Keeper) ExportGenesis(ctx context.Context) (*types.GenesisState, error)
- func (k *Keeper) FulfillReputerNonce(ctx context.Context, topicId TopicId, nonce *types.Nonce) (bool, error)
- func (k *Keeper) FulfillWorkerNonce(ctx context.Context, topicId TopicId, nonce *types.Nonce) (bool, error)
- func (k *Keeper) GetActiveForecastersForTopic(ctx context.Context, topicId TopicId) ([]ActorId, error)
- func (k *Keeper) GetActiveInferersForTopic(ctx context.Context, topicId TopicId) ([]ActorId, error)
- func (k *Keeper) GetActiveReputersForTopic(ctx context.Context, topicId TopicId) ([]ActorId, error)
- func (k *Keeper) GetActiveTopicIdsAtBlock(ctx context.Context, block BlockHeight) (types.TopicIds, error)
- func (k *Keeper) GetBankBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin
- func (k *Keeper) GetBinaryCodec() codec.BinaryCodec
- func (k *Keeper) GetCountForecasterInclusionsInTopic(ctx context.Context, topicId TopicId, forecaster ActorId) (uint64, error)
- func (k *Keeper) GetCountInfererInclusionsInTopic(ctx context.Context, topicId TopicId, inferer ActorId) (uint64, error)
- func (k *Keeper) GetCurrentTopicWeight(ctx context.Context, topicId TopicId, topicEpochLength BlockHeight, ...) (weight alloraMath.Dec, topicRevenue cosmosMath.Int, err error)
- func (k *Keeper) GetDelegateRewardPerShare(ctx context.Context, topicId TopicId, reputer ActorId) (alloraMath.Dec, error)
- func (k *Keeper) GetDelegateStakePlacement(ctx context.Context, topicId TopicId, delegator ActorId, target ActorId) (types.DelegatorInfo, error)
- func (k Keeper) GetDelegateStakeRemoval(ctx context.Context, blockHeight BlockHeight, topicId TopicId, ...) (types.DelegateStakeRemovalInfo, error)
- func (k *Keeper) GetDelegateStakeRemovalForDelegatorReputerAndTopicId(ctx sdk.Context, delegator string, reputer string, topicId uint64) (removal types.DelegateStakeRemovalInfo, found bool, err error)
- func (k *Keeper) GetDelegateStakeRemovalsUpUntilBlock(ctx context.Context, blockHeight BlockHeight, limit uint64) (ret []types.DelegateStakeRemovalInfo, limitHit bool, err error)
- func (k *Keeper) GetDelegateStakeUponReputer(ctx context.Context, topicId TopicId, target ActorId) (cosmosMath.Int, error)
- func (k *Keeper) GetForecastScoresUntilBlock(ctx context.Context, topicId TopicId, blockHeight BlockHeight) ([]*types.Score, error)
- func (k *Keeper) GetForecasterNetworkRegret(ctx context.Context, topicId TopicId, worker ActorId) (regret types.TimestampedValue, noPrior bool, err error)
- func (k *Keeper) GetForecasterScoreEma(ctx context.Context, topicId TopicId, worker ActorId) (types.Score, error)
- func (k *Keeper) GetForecastsAtBlock(ctx context.Context, topicId TopicId, block BlockHeight) (*types.Forecasts, error)
- func (k *Keeper) GetInferenceScoresUntilBlock(ctx context.Context, topicId TopicId, blockHeight BlockHeight) ([]*types.Score, error)
- func (k *Keeper) GetInferencesAtBlock(ctx context.Context, topicId TopicId, block BlockHeight) (*types.Inferences, error)
- func (k *Keeper) GetInfererNetworkRegret(ctx context.Context, topicId TopicId, worker ActorId) (regret types.TimestampedValue, noPrior bool, err error)
- func (k *Keeper) GetInfererScoreEma(ctx context.Context, topicId TopicId, worker ActorId) (types.Score, error)
- func (k *Keeper) GetLastDripBlock(ctx context.Context, topicId TopicId) (BlockHeight, error)
- func (k *Keeper) GetLatestNetworkLossBundle(ctx context.Context, topicId TopicId) (*types.ValueBundle, error)
- func (k *Keeper) GetLatestTopicInferences(ctx context.Context, topicId TopicId) (*types.Inferences, BlockHeight, error)
- func (k *Keeper) GetListeningCoefficient(ctx context.Context, topicId TopicId, reputer ActorId) (types.ListeningCoefficient, error)
- func (k *Keeper) GetLowestActiveTopicWeightAtBlock(ctx context.Context, block BlockHeight) (topicIdAndWeight types.TopicIdWeightPair, noPrior bool, err error)
- func (k *Keeper) GetLowestForecasterScoreEma(ctx context.Context, topicId TopicId) (types.Score, bool, error)
- func (k *Keeper) GetLowestInfererScoreEma(ctx context.Context, topicId TopicId) (types.Score, bool, error)
- func (k *Keeper) GetLowestReputerScoreEma(ctx context.Context, topicId TopicId) (types.Score, bool, error)
- func (k *Keeper) GetNaiveInfererNetworkRegret(ctx context.Context, topicId TopicId, inferer ActorId) (regret types.TimestampedValue, noPrior bool, err error)
- func (k *Keeper) GetNetworkLossBundleAtBlock(ctx context.Context, topicId TopicId, block BlockHeight) (*types.ValueBundle, error)
- func (k *Keeper) GetNextPossibleChurningBlockByTopicId(ctx context.Context, topicId TopicId) (BlockHeight, bool, error)
- func (k *Keeper) GetNextTopicId(ctx context.Context) (TopicId, error)
- func (k *Keeper) GetOneInForecasterNetworkRegret(ctx context.Context, topicId TopicId, oneInForecaster ActorId, inferer ActorId) (regret types.TimestampedValue, noPrior bool, err error)
- func (k *Keeper) GetOneOutForecasterForecasterNetworkRegret(ctx context.Context, topicId TopicId, oneOutForecaster ActorId, ...) (regret types.TimestampedValue, noPrior bool, err error)
- func (k *Keeper) GetOneOutForecasterInfererNetworkRegret(ctx context.Context, topicId TopicId, oneOutForecaster ActorId, ...) (regret types.TimestampedValue, noPrior bool, err error)
- func (k *Keeper) GetOneOutInfererForecasterNetworkRegret(ctx context.Context, topicId TopicId, oneOutInferer ActorId, ...) (regret types.TimestampedValue, noPrior bool, err error)
- func (k *Keeper) GetOneOutInfererInfererNetworkRegret(ctx context.Context, topicId TopicId, oneOutInferer ActorId, inferer ActorId) (regret types.TimestampedValue, noPrior bool, err error)
- func (k Keeper) GetParams(ctx context.Context) (types.Params, error)
- func (k *Keeper) GetPreviousForecastRewardFraction(ctx context.Context, topicId TopicId, worker ActorId) (previousForecastRewardFraction alloraMath.Dec, noPrior bool, err error)
- func (k *Keeper) GetPreviousForecasterScoreRatio(ctx context.Context, topicId TopicId) (alloraMath.Dec, error)
- func (k *Keeper) GetPreviousInferenceRewardFraction(ctx context.Context, topicId TopicId, worker ActorId) (previousInferenceRewardFraction alloraMath.Dec, noPrior bool, err error)
- func (k Keeper) GetPreviousPercentageRewardToStakedReputers(ctx context.Context) (alloraMath.Dec, error)
- func (k *Keeper) GetPreviousReputerRewardFraction(ctx context.Context, topicId TopicId, reputer ActorId) (previousReputerRewardFraction alloraMath.Dec, noPrior bool, err error)
- func (k *Keeper) GetPreviousTopicQuantileForecasterScoreEma(ctx context.Context, topicId TopicId) (alloraMath.Dec, error)
- func (k *Keeper) GetPreviousTopicQuantileInfererScoreEma(ctx context.Context, topicId TopicId) (alloraMath.Dec, error)
- func (k *Keeper) GetPreviousTopicQuantileReputerScoreEma(ctx context.Context, topicId TopicId) (alloraMath.Dec, error)
- func (k *Keeper) GetPreviousTopicWeight(ctx context.Context, topicId TopicId) (topicWeight alloraMath.Dec, noPrior bool, err error)
- func (k *Keeper) GetReputerInfo(ctx sdk.Context, reputerKey ActorId) (types.OffchainNode, error)
- func (k *Keeper) GetReputerLatestLossByTopicId(ctx context.Context, topicId TopicId, reputer ActorId) (types.ReputerValueBundle, error)
- func (k *Keeper) GetReputerLossBundlesAtBlock(ctx context.Context, topicId TopicId, block BlockHeight) (*types.ReputerValueBundles, error)
- func (k *Keeper) GetReputerScoreEma(ctx context.Context, topicId TopicId, reputer ActorId) (types.Score, error)
- func (k *Keeper) GetReputerTopicLastCommit(ctx context.Context, topic TopicId) (types.TimestampedActorNonce, error)
- func (k *Keeper) GetReputersScoresAtBlock(ctx context.Context, topicId TopicId, block BlockHeight) (types.Scores, error)
- func (k *Keeper) GetRewardCurrentBlockEmission(ctx context.Context) (cosmosMath.Int, error)
- func (k *Keeper) GetStakeFromDelegatorInTopic(ctx context.Context, topicId TopicId, delegator ActorId) (cosmosMath.Int, error)
- func (k Keeper) GetStakeRemoval(ctx context.Context, BlockHeight int64, topicId TopicId, reputer ActorId) (types.StakeRemovalInfo, error)
- func (k *Keeper) GetStakeRemovalForReputerAndTopicId(ctx sdk.Context, reputer string, topicId uint64) (removal types.StakeRemovalInfo, found bool, err error)
- func (k *Keeper) GetStakeRemovalsUpUntilBlock(ctx context.Context, blockHeight BlockHeight, limit uint64) (ret []types.StakeRemovalInfo, anyLeft bool, err error)
- func (k *Keeper) GetStakeReputerAuthority(ctx context.Context, topicId TopicId, reputer ActorId) (cosmosMath.Int, error)
- func (k *Keeper) GetStorageService() coreStore.KVStoreService
- func (k *Keeper) GetTargetWeight(topicStake alloraMath.Dec, topicEpochLength int64, ...) (alloraMath.Dec, error)
- func (k *Keeper) GetTopic(ctx context.Context, topicId TopicId) (types.Topic, error)
- func (k *Keeper) GetTopicFeeRevenue(ctx context.Context, topicId TopicId) (cosmosMath.Int, error)
- func (k *Keeper) GetTopicRewardNonce(ctx context.Context, topicId TopicId) (BlockHeight, error)
- func (k *Keeper) GetTopicStake(ctx context.Context, topicId TopicId) (cosmosMath.Int, error)
- func (k *Keeper) GetTopicWeightFromTopicId(ctx context.Context, topicId types.TopicId) (alloraMath.Dec, error)
- func (k *Keeper) GetTotalRewardToDistribute(ctx context.Context) (alloraMath.Dec, error)
- func (k Keeper) GetTotalStake(ctx context.Context) (cosmosMath.Int, error)
- func (k *Keeper) GetTotalSumPreviousTopicWeights(ctx context.Context) (alloraMath.Dec, error)
- func (k *Keeper) GetUnfulfilledReputerNonces(ctx context.Context, topicId TopicId) (types.ReputerRequestNonces, error)
- func (k *Keeper) GetUnfulfilledWorkerNonces(ctx context.Context, topicId TopicId) (types.Nonces, error)
- func (k *Keeper) GetWorkerForecastScoresAtBlock(ctx context.Context, topicId TopicId, block BlockHeight) (types.Scores, error)
- func (k *Keeper) GetWorkerInferenceScoresAtBlock(ctx context.Context, topicId TopicId, block BlockHeight) (types.Scores, error)
- func (k *Keeper) GetWorkerInfo(ctx sdk.Context, workerKey ActorId) (types.OffchainNode, error)
- func (k *Keeper) GetWorkerLatestForecastByTopicId(ctx context.Context, topicId TopicId, worker ActorId) (types.Forecast, error)
- func (k *Keeper) GetWorkerLatestInferenceByTopicId(ctx context.Context, topicId TopicId, worker ActorId) (types.Inference, error)
- func (k *Keeper) GetWorkerTopicLastCommit(ctx context.Context, topic TopicId) (types.TimestampedActorNonce, error)
- func (k *Keeper) GetWorkerWindowTopicIds(ctx sdk.Context, height BlockHeight) types.TopicIds
- func (k *Keeper) InactivateTopic(ctx context.Context, topicId TopicId) error
- func (k *Keeper) IncrementCountForecasterInclusionsInTopic(ctx context.Context, topicId TopicId, forecaster ActorId) error
- func (k *Keeper) IncrementCountInfererInclusionsInTopic(ctx context.Context, topicId TopicId, inferer ActorId) error
- func (k *Keeper) IncrementTopicId(ctx context.Context) (TopicId, error)
- func (k *Keeper) InitGenesis(ctx context.Context, data *types.GenesisState) error
- func (k *Keeper) InsertActiveForecasts(ctx context.Context, topicId TopicId, nonceBlockHeight BlockHeight, ...) error
- func (k *Keeper) InsertActiveInferences(ctx context.Context, topicId TopicId, nonceBlockHeight BlockHeight, ...) error
- func (k *Keeper) InsertActiveReputerLosses(ctx context.Context, topicId TopicId, block BlockHeight, ...) error
- func (k *Keeper) InsertForecast(ctx context.Context, topicId TopicId, forecast types.Forecast) error
- func (k *Keeper) InsertInference(ctx context.Context, topicId TopicId, inference types.Inference) error
- func (k *Keeper) InsertNetworkLossBundleAtBlock(ctx context.Context, topicId TopicId, block BlockHeight, ...) error
- func (k *Keeper) InsertReputer(ctx context.Context, topicId TopicId, reputer ActorId, ...) error
- func (k *Keeper) InsertReputerLoss(ctx context.Context, topicId TopicId, reputerLoss types.ReputerValueBundle) error
- func (k *Keeper) InsertReputerScore(ctx context.Context, topicId TopicId, blockHeight BlockHeight, ...) error
- func (k *Keeper) InsertWorker(ctx context.Context, topicId TopicId, worker ActorId, ...) error
- func (k *Keeper) InsertWorkerForecastScore(ctx context.Context, topicId TopicId, blockHeight BlockHeight, ...) error
- func (k *Keeper) InsertWorkerInferenceScore(ctx context.Context, topicId TopicId, blockHeight BlockHeight, ...) error
- func (k *Keeper) IsActiveForecaster(ctx context.Context, topicId TopicId, forecaster ActorId) (bool, error)
- func (k *Keeper) IsActiveInferer(ctx context.Context, topicId TopicId, inferer ActorId) (bool, error)
- func (k *Keeper) IsActiveReputer(ctx context.Context, topicId TopicId, reputer ActorId) (bool, error)
- func (k *Keeper) IsEnabledGlobalActor(ctx context.Context, actor ActorId) (bool, error)
- func (k *Keeper) IsEnabledTopicReputer(ctx context.Context, topicId TopicId, actor ActorId) (bool, error)
- func (k *Keeper) IsEnabledTopicWorker(ctx context.Context, topicId TopicId, actor ActorId) (bool, error)
- func (k *Keeper) IsEnabledWhitelistedTopicCreator(ctx context.Context, actor ActorId) (bool, error)
- func (k *Keeper) IsReputerNonceUnfulfilled(ctx context.Context, topicId TopicId, nonce *types.Nonce) (isUnfulfilled bool, err error)
- func (k *Keeper) IsReputerRegisteredInTopic(ctx context.Context, topicId TopicId, reputer ActorId) (bool, error)
- func (k *Keeper) IsTopicActive(ctx context.Context, topicId TopicId) (bool, error)
- func (k *Keeper) IsTopicReputerWhitelistEnabled(ctx context.Context, topicId TopicId) (bool, error)
- func (k *Keeper) IsTopicWorkerWhitelistEnabled(ctx context.Context, topicId TopicId) (bool, error)
- func (k Keeper) IsWhitelistAdmin(ctx context.Context, admin ActorId) (bool, error)
- func (k *Keeper) IsWhitelistedGlobalActor(ctx context.Context, actor ActorId) (bool, error)
- func (k *Keeper) IsWhitelistedTopicCreator(ctx context.Context, actor ActorId) (bool, error)
- func (k *Keeper) IsWhitelistedTopicReputer(ctx context.Context, topicId TopicId, actor ActorId) (bool, error)
- func (k *Keeper) IsWhitelistedTopicWorker(ctx context.Context, topicId TopicId, actor ActorId) (bool, error)
- func (k *Keeper) IsWorkerNonceUnfulfilled(ctx context.Context, topicId TopicId, nonce *types.Nonce) (isUnfulfilled bool, err error)
- func (k *Keeper) IsWorkerRegisteredInTopic(ctx context.Context, topicId TopicId, worker ActorId) (bool, error)
- func (k *Keeper) PruneRecordsAfterRewards(ctx context.Context, topicId TopicId, blockHeight int64) error
- func (k *Keeper) PruneReputerNonces(ctx context.Context, topicId uint64, blockHeightThreshold int64) error
- func (k *Keeper) PruneTopicActivationDataAtBlock(ctx context.Context, block BlockHeight) error
- func (k *Keeper) PruneWorkerNonces(ctx context.Context, topicId uint64, blockHeightThreshold int64) error
- func (k *Keeper) RemoveActiveForecaster(ctx context.Context, topicId TopicId, forecaster ActorId) error
- func (k *Keeper) RemoveActiveInferer(ctx context.Context, topicId TopicId, inferer ActorId) error
- func (k *Keeper) RemoveActiveReputer(ctx context.Context, topicId TopicId, reputer ActorId) error
- func (k *Keeper) RemoveDelegateStake(ctx context.Context, stakeRemovalBlockHeight BlockHeight, topicId TopicId, ...) error
- func (k *Keeper) RemoveForecast(ctx context.Context, topicId TopicId, forecaster ActorId) error
- func (k *Keeper) RemoveFromGlobalWhitelist(ctx context.Context, actor ActorId) error
- func (k *Keeper) RemoveFromTopicCreatorWhitelist(ctx context.Context, actor ActorId) error
- func (k *Keeper) RemoveFromTopicReputerWhitelist(ctx context.Context, topicId TopicId, actor ActorId) error
- func (k *Keeper) RemoveFromTopicWorkerWhitelist(ctx context.Context, topicId TopicId, actor ActorId) error
- func (k *Keeper) RemoveInference(ctx context.Context, topicId TopicId, inferer ActorId) error
- func (k *Keeper) RemoveReputer(ctx context.Context, topicId TopicId, reputer ActorId) error
- func (k *Keeper) RemoveReputerLoss(ctx context.Context, topicId TopicId, reputer ActorId) error
- func (k *Keeper) RemoveReputerStake(ctx context.Context, blockHeight BlockHeight, topicId TopicId, reputer ActorId, ...) error
- func (k *Keeper) RemoveWhitelistAdmin(ctx context.Context, admin ActorId) error
- func (k *Keeper) RemoveWorker(ctx context.Context, topicId TopicId, worker ActorId) error
- func (k *Keeper) ResetActiveReputersForTopic(ctx context.Context, topicId TopicId) error
- func (k *Keeper) ResetActiveWorkersForTopic(ctx context.Context, topicId TopicId) error
- func (k *Keeper) ResetLowestActiveTopicWeightAtBlock(ctx context.Context, block BlockHeight) error
- func (k *Keeper) ResetReputersIndividualSubmissionsForTopic(ctx context.Context, topicId TopicId) error
- func (k *Keeper) ResetWorkersIndividualSubmissionsForTopic(ctx context.Context, topicId TopicId) error
- func (k *Keeper) SendCoinsFromAccountToModule(ctx context.Context, sender ActorId, recipientModule string, amt sdk.Coins) error
- func (k *Keeper) SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipient ActorId, amt sdk.Coins) error
- func (k *Keeper) SendCoinsFromModuleToModule(ctx context.Context, senderModule, recipientModule string, amt sdk.Coins) error
- func (k *Keeper) SetActiveTopics(ctx context.Context, topicId TopicId) error
- func (k *Keeper) SetBlockToActiveTopics(ctx context.Context, block BlockHeight, topicIds types.TopicIds) error
- func (k *Keeper) SetBlockToLowestActiveTopicWeight(ctx context.Context, block BlockHeight, weightPair types.TopicIdWeightPair) error
- func (k *Keeper) SetDelegateRewardPerShare(ctx context.Context, topicId TopicId, reputer ActorId, share alloraMath.Dec) error
- func (k *Keeper) SetDelegateStakePlacement(ctx context.Context, topicId TopicId, delegator ActorId, target ActorId, ...) error
- func (k *Keeper) SetDelegateStakeRemoval(ctx context.Context, removalInfo types.DelegateStakeRemovalInfo) error
- func (k *Keeper) SetDelegateStakeUponReputer(ctx context.Context, topicId TopicId, target ActorId, stake cosmosMath.Int) error
- func (k *Keeper) SetForecasterNetworkRegret(ctx context.Context, topicId TopicId, worker ActorId, ...) error
- func (k *Keeper) SetForecasterScoreEma(ctx context.Context, topicId TopicId, worker ActorId, score types.Score) error
- func (k *Keeper) SetInfererNetworkRegret(ctx context.Context, topicId TopicId, worker ActorId, ...) error
- func (k *Keeper) SetInfererScoreEma(ctx context.Context, topicId TopicId, worker ActorId, score types.Score) error
- func (k *Keeper) SetLastDripBlock(ctx context.Context, topicId TopicId, block BlockHeight) error
- func (k *Keeper) SetListeningCoefficient(ctx context.Context, topicId TopicId, reputer ActorId, ...) error
- func (k *Keeper) SetLowestForecasterScoreEma(ctx context.Context, topicId TopicId, lowestScore types.Score) error
- func (k *Keeper) SetLowestInfererScoreEma(ctx context.Context, topicId TopicId, lowestScore types.Score) error
- func (k *Keeper) SetLowestReputerScoreEma(ctx context.Context, topicId TopicId, lowestScore types.Score) error
- func (k *Keeper) SetNaiveInfererNetworkRegret(ctx context.Context, topicId TopicId, inferer ActorId, ...) error
- func (k *Keeper) SetOneInForecasterNetworkRegret(ctx context.Context, topicId TopicId, oneInForecaster ActorId, inferer ActorId, ...) error
- func (k *Keeper) SetOneOutForecasterForecasterNetworkRegret(ctx context.Context, topicId TopicId, oneOutForecaster ActorId, ...) error
- func (k *Keeper) SetOneOutForecasterInfererNetworkRegret(ctx context.Context, topicId TopicId, oneOutForecaster ActorId, ...) error
- func (k *Keeper) SetOneOutInfererForecasterNetworkRegret(ctx context.Context, topicId TopicId, oneOutInferer ActorId, ...) error
- func (k *Keeper) SetOneOutInfererInfererNetworkRegret(ctx context.Context, topicId TopicId, oneOutInferer ActorId, inferer ActorId, ...) error
- func (k Keeper) SetParams(ctx context.Context, params types.Params) error
- func (k *Keeper) SetPreviousForecastRewardFraction(ctx context.Context, topicId TopicId, worker ActorId, reward alloraMath.Dec) error
- func (k *Keeper) SetPreviousForecasterScoreRatio(ctx context.Context, topicId TopicId, forecasterScoreRatio alloraMath.Dec) error
- func (k *Keeper) SetPreviousInferenceRewardFraction(ctx context.Context, topicId TopicId, worker ActorId, reward alloraMath.Dec) error
- func (k *Keeper) SetPreviousPercentageRewardToStakedReputers(ctx context.Context, percentageRewardToStakedReputers alloraMath.Dec) error
- func (k *Keeper) SetPreviousReputerRewardFraction(ctx context.Context, topicId TopicId, reputer ActorId, reward alloraMath.Dec) error
- func (k *Keeper) SetPreviousTopicQuantileForecasterScoreEma(ctx context.Context, topicId TopicId, score alloraMath.Dec) error
- func (k *Keeper) SetPreviousTopicQuantileInfererScoreEma(ctx context.Context, topicId TopicId, score alloraMath.Dec) error
- func (k *Keeper) SetPreviousTopicQuantileReputerScoreEma(ctx context.Context, topicId TopicId, score alloraMath.Dec) error
- func (k *Keeper) SetPreviousTopicWeight(ctx context.Context, topicId TopicId, weight alloraMath.Dec) error
- func (k *Keeper) SetReputerScoreEma(ctx context.Context, topicId TopicId, reputer ActorId, score types.Score) error
- func (k *Keeper) SetReputerTopicLastCommit(ctx context.Context, topic types.TopicId, blockHeight int64, ...) error
- func (k Keeper) SetRewardCurrentBlockEmission(ctx context.Context, emission cosmosMath.Int) error
- func (k *Keeper) SetStakeFromDelegator(ctx context.Context, topicId TopicId, delegator ActorId, stake cosmosMath.Int) error
- func (k *Keeper) SetStakeRemoval(ctx context.Context, removalInfo types.StakeRemovalInfo) error
- func (k *Keeper) SetStakeReputerAuthority(ctx context.Context, topicId TopicId, reputer ActorId, amount cosmosMath.Int) error
- func (k *Keeper) SetTopic(ctx context.Context, topicId TopicId, topic types.Topic) error
- func (k *Keeper) SetTopicRewardNonce(ctx context.Context, topicId TopicId, nonce BlockHeight) error
- func (k *Keeper) SetTopicStake(ctx context.Context, topicId TopicId, stake cosmosMath.Int) error
- func (k *Keeper) SetTopicToNextPossibleChurningBlock(ctx context.Context, topicId TopicId, block BlockHeight) error
- func (k *Keeper) SetTotalStake(ctx context.Context, totalStake cosmosMath.Int) error
- func (k *Keeper) SetTotalSumPreviousTopicWeights(ctx context.Context, weight alloraMath.Dec) error
- func (k *Keeper) SetWorkerTopicLastCommit(ctx context.Context, topic types.TopicId, blockHeight int64, ...) error
- func (k *Keeper) TopicExists(ctx context.Context, topicId TopicId) (bool, error)
- func (k *Keeper) UpdateTopicEpochLastEnded(ctx context.Context, topicId TopicId, epochLastEnded BlockHeight) error
- func (k *Keeper) UpdateTopicInitialRegret(ctx context.Context, topicId TopicId, initialRegret alloraMath.Dec) error
- func (k *Keeper) UpdateTotalSumPreviousTopicWeights(ctx context.Context, topicId TopicId, newWeight alloraMath.Dec) error
- func (k *Keeper) ValidateStringIsBech32(actor ActorId) error
- type LibP2pKey
- type Quadruple
- func Join4[K1, K2, K3, K4 any](k1 K1, k2 K2, k3 K3, k4 K4) Quadruple[K1, K2, K3, K4]
- func QuadrupleDoublePrefix[K1, K2, K3, K4 any](k1 K1, k2 K2) Quadruple[K1, K2, K3, K4]
- func QuadrupleSinglePrefix[K1, K2, K3, K4 any](k1 K1) Quadruple[K1, K2, K3, K4]
- func QuadrupleTriplePrefix[K1, K2, K3, K4 any](k1 K1, k2 K2, k3 K3) Quadruple[K1, K2, K3, K4]
- type Reputer
- type TopicId
Constants ¶
const RESERVED_BLOCK = 0
Variables ¶
This section is empty.
Functions ¶
func AllInvariants ¶ added in v0.0.1337
AllInvariants is a convience function to run all invariants in the emissions module.
func GetLowestScoreFromAllForecasters ¶ added in v0.0.1337
func GetLowestScoreFromAllForecasters( ctx context.Context, k *Keeper, topicId TopicId, forecasterAddresses []string, ) (lowScore types.Score, err error)
Get lowest score from all forecasters
func GetLowestScoreFromAllInferers ¶ added in v0.0.1337
func GetLowestScoreFromAllInferers( ctx context.Context, k *Keeper, topicId TopicId, infererAddresses []string, ) (lowScore types.Score, err error)
Get lowest score from all inferers
func GetLowestScoreFromAllReputers ¶ added in v0.0.1337
func GetLowestScoreFromAllReputers( ctx context.Context, k *Keeper, topicId TopicId, reputerAddresses []string, ) (lowScore types.Score, err error)
Get lowest score from all reputers
func NewDoublePrefixedQuadrupleRange ¶ added in v0.0.1337
func NewDoublePrefixedQuadrupleRange[K1, K2, K3, K4 any](k1 K1, k2 K2) collections.Ranger[Quadruple[K1, K2, K3, K4]]
NewDoublePrefixedQuadrupleRange provides a Range for all keys prefixed with the given first and second parts of the Quadruple key.
func NewSinglePrefixUntilQuadrupleRange ¶ added in v0.0.1337
func NewSinglePrefixUntilQuadrupleRange[K1, K2, K3, K4 any](k1 K1) collections.Ranger[Quadruple[K1, K2, K3, K4]]
NewSinglePrefixUntilQuadrupleRange defines a collection query which ranges until the provided Pair prefix. Unstable: this API might change in the future.
func NewSinglePrefixedQuadrupleRange ¶ added in v0.0.1337
func NewSinglePrefixedQuadrupleRange[K1, K2, K3, K4 any](k1 K1) collections.Ranger[Quadruple[K1, K2, K3, K4]]
NewSinglePrefixedQuadrupleRange provides a Range for all keys prefixed with the given first part of the Quadruple key.
func NewTriplePrefixedQuadrupleRange ¶ added in v0.0.1337
func NewTriplePrefixedQuadrupleRange[K1, K2, K3, K4 any](k1 K1, k2 K2, k3 K3) collections.Ranger[Quadruple[K1, K2, K3, K4]]
NewTriplePrefixedQuadrupleRange provides a Range for all keys prefixed with the given first, second, and third parts of the Quadruple key.
func QuadrupleKeyCodec ¶ added in v0.0.1337
func QuadrupleKeyCodec[K1, K2, K3, K4 any]( keyCodec1 codec.KeyCodec[K1], keyCodec2 codec.KeyCodec[K2], keyCodec3 codec.KeyCodec[K3], keyCodec4 codec.KeyCodec[K4], ) codec.KeyCodec[Quadruple[K1, K2, K3, K4]]
QuadrupleKeyCodec instantiates a new KeyCodec instance that can encode the Quadruple, given the KeyCodecs of the three parts of the key, in order.
func RegisterInvariants ¶ added in v0.0.1337
func RegisterInvariants(ir sdk.InvariantRegistry, k *Keeper)
RegisterInvariants registers the emissions module invariants.
func StakingInvariantDelegatedStakes ¶ added in v0.0.1337
stakeSumFromDelegator = Sum(delegatedStakes[topicid, delegator, all reputers]) stakeFromDelegatorsUponReputer = Sum(delegatedStakes[topicid, all delegators, reputer])
func StakingInvariantLenStakeRemovalsSame ¶ added in v0.0.1337
the number of values in the stakeRemovalsByBlock map should always equal the number of values in the stakeRemovalsByActor map
func StakingInvariantPendingRewardForDelegatorsGreaterThanRewardPerShareMinusRewardDebt ¶ added in v0.0.1337
func StakingInvariantSumStakeFromStakeReputerAuthorityEqualTotalStakeAndTopicStake ¶ added in v0.0.1337
func StakingInvariantTotalStakeEqualAlloraStakingBankBalance ¶ added in v0.0.1337
StakingInvariantTotalStakeEqualAlloraStakingBankBalance checks that the total stake in the emissions module is equal to the balance of the Allora staking bank account.
func UpdateLowestScoreFromForecasterAddresses ¶ added in v0.0.1337
func UpdateLowestScoreFromForecasterAddresses( ctx context.Context, k *Keeper, topicId TopicId, forecasterAddresses []string, addedForecaster string, removedForecasterAddress string, ) error
Update lowest score from new forecaster addresses set
Types ¶
type AccountKeeper ¶
type AccountKeeper interface { AddressCodec() address.Codec GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI GetModuleAddress(name string) sdk.AccAddress GetModuleAccount(ctx context.Context, name string) sdk.ModuleAccountI SetModuleAccount(context.Context, sdk.ModuleAccountI) }
AccountKeeper defines the expected account keeper used for simulations (noalias)
type BankKeeper ¶
type BankKeeper interface { MintCoins(ctx context.Context, moduleName string, amt sdk.Coins) error GetAllBalances(ctx context.Context, addr sdk.AccAddress) sdk.Coins GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins SendCoinsFromModuleToModule(ctx context.Context, senderModule, recipientModule string, amt sdk.Coins) error SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error BlockedAddr(addr sdk.AccAddress) bool }
BankKeeper defines the expected interface needed to retrieve account balances.
type BlockHeight ¶ added in v0.0.1337
type BlockHeight = int64
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, addressCodec address.Codec, storeService coreStore.KVStoreService, ak AccountKeeper, bk BankKeeper, feeCollectorName string, ) Keeper
func (*Keeper) ActivateTopic ¶ added in v0.0.1337
Set a topic to active if the topic exists, else does nothing
func (*Keeper) AddActiveForecaster ¶ added in v0.0.1337
func (k *Keeper) AddActiveForecaster(ctx context.Context, topicId TopicId, forecaster ActorId) error
AddActiveForecaster adds a forecaster to the active forecasters set for a topic
func (*Keeper) AddActiveInferer ¶ added in v0.0.1337
AddActiveInferer adds an inferer to the active inferers set for a topic
func (*Keeper) AddActiveReputer ¶ added in v0.0.1337
AddActiveReputer adds a reputer to the active reputers set for a topic
func (*Keeper) AddDelegateStake ¶ added in v0.0.1337
func (k *Keeper) AddDelegateStake( ctx context.Context, topicId TopicId, delegator ActorId, reputer ActorId, stakeToAdd cosmosMath.Int, ) error
adds stake to the system from a delegator adds to: totalStake, topicStake, stakeReputerAuthority,
stakeSumFromDelegator, delegatedStakes, stakeFromDelegatorsUponReputer
func (*Keeper) AddReputerNonce ¶ added in v0.0.1337
Adds a nonce to the unfulfilled nonces for the topic if it is not yet added (idempotent). If the max number of nonces is reached, then the function removes the oldest nonce and adds the new nonce.
func (*Keeper) AddReputerStake ¶ added in v0.0.1337
func (k *Keeper) AddReputerStake( ctx context.Context, topicId TopicId, reputer ActorId, stakeToAdd cosmosMath.Int, ) error
Adds stake to the system for a given topic and reputer Adds to: totalStake, topicStake, stakeReputerAuthority,
func (*Keeper) AddToGlobalWhitelist ¶ added in v0.0.1337
func (*Keeper) AddToTopicCreatorWhitelist ¶ added in v0.0.1337
func (*Keeper) AddToTopicReputerWhitelist ¶ added in v0.0.1337
func (*Keeper) AddToTopicWorkerWhitelist ¶ added in v0.0.1337
func (*Keeper) AddTopicFeeRevenue ¶ added in v0.0.1337
func (k *Keeper) AddTopicFeeRevenue(ctx context.Context, topicId TopicId, amount cosmosMath.Int) error
Add to the fee revenue collected by a topic
func (*Keeper) AddWhitelistAdmin ¶ added in v0.0.1
func (*Keeper) AddWorkerNonce ¶ added in v0.0.1337
Adds a nonce to the unfulfilled nonces for the topic if it is not yet added (idempotent). If the max number of nonces is reached, then the function removes the oldest nonce and adds the new nonce.
func (*Keeper) AddWorkerWindowTopicId ¶ added in v0.0.1337
SetTopicId appends a new TopicId to the list of TopicIds for a given BlockHeight. If no entry exists for the BlockHeight, it creates a new entry with the TopicId.
func (*Keeper) AppendForecast ¶ added in v0.0.1337
func (k *Keeper) AppendForecast( ctx sdk.Context, topic types.Topic, nonceBlockHeight BlockHeight, forecast *types.Forecast, maxTopForecastersToReward uint64, ) error
Append individual forecast for a topic/block
func (*Keeper) AppendInference ¶ added in v0.0.1337
func (k *Keeper) AppendInference( ctx sdk.Context, topic types.Topic, nonceBlockHeight BlockHeight, inference *types.Inference, maxTopInferersToReward uint64, ) error
Append individual inference for a topic/block
func (*Keeper) AppendReputerLoss ¶ added in v0.0.1337
func (k *Keeper) AppendReputerLoss( ctx sdk.Context, topic types.Topic, moduleParams types.Params, nonceBlockHeight BlockHeight, reputerLoss *types.ReputerValueBundle, ) error
Append loss bundle for a topic and blockHeight
func (*Keeper) AttemptTopicReactivation ¶ added in v0.0.1337
If the topic weight is not less than lowest weight keep it as activated
func (*Keeper) BlockWithinReputerSubmissionWindowOfNonce ¶ added in v0.0.1337
func (k *Keeper) BlockWithinReputerSubmissionWindowOfNonce(topic types.Topic, nonce types.ReputerRequestNonce, blockHeight int64) bool
Return true if the nonce is within the worker submission window for the topic Inclusive of the start block height and of the end block height
func (*Keeper) BlockWithinWorkerSubmissionWindowOfNonce ¶ added in v0.0.1337
func (k *Keeper) BlockWithinWorkerSubmissionWindowOfNonce(topic types.Topic, nonce types.Nonce, blockHeight int64) bool
Return true if the nonce is within the worker submission window for the topic Inclusive of the start block height and exclusive of the end block height
func (*Keeper) CalcAndSaveForecasterScoreEmaForActiveSet ¶ added in v0.0.1337
func (k *Keeper) CalcAndSaveForecasterScoreEmaForActiveSet( ctx context.Context, topic types.Topic, block types.BlockHeight, worker ActorId, newScore types.Score, ) (types.Score, error)
Calculates and saves the EMA scores for a active set worker and topic. By assuming worker is in active set, we know to calculate the EMA with a new, passed-in score.
func (*Keeper) CalcAndSaveForecasterScoreEmaWithLastSavedTopicQuantile ¶ added in v0.0.1337
func (k *Keeper) CalcAndSaveForecasterScoreEmaWithLastSavedTopicQuantile( ctx sdk.Context, topic types.Topic, block types.BlockHeight, previousForecasterScore types.Score, ) error
Calculates and saves the EMA scores for a given forecaster and topic. Uses the last saved topic quantile score to calculate the EMA. This is useful for updating EMAs of forecasters in the passive set.
func (*Keeper) CalcAndSaveInfererScoreEmaForActiveSet ¶ added in v0.0.1337
func (k *Keeper) CalcAndSaveInfererScoreEmaForActiveSet( ctx context.Context, topic types.Topic, block types.BlockHeight, worker ActorId, newScore types.Score, ) (types.Score, error)
Calculates and saves the EMA scores for a active set worker and topic. By assuming worker is in active set, we know to calculate the EMA with a new, passed-in score.
func (*Keeper) CalcAndSaveInfererScoreEmaWithLastSavedTopicQuantile ¶ added in v0.0.1337
func (k *Keeper) CalcAndSaveInfererScoreEmaWithLastSavedTopicQuantile( ctx sdk.Context, topic types.Topic, block types.BlockHeight, previousInfererScore types.Score, ) error
Calculates and saves the EMA scores for a given worker and topic. Uses the last saved topic quantile score to calculate the EMA. This is useful for updating EMAs of workers in the passive set.
func (*Keeper) CalcAndSaveReputerScoreEmaForActiveSet ¶ added in v0.0.1337
func (k *Keeper) CalcAndSaveReputerScoreEmaForActiveSet( ctx context.Context, topic types.Topic, block types.BlockHeight, reputer ActorId, newScore types.Score, ) (types.Score, error)
Calculates and saves the EMA scores for a given reputer and topic. By assuming reputer is in active set, we know to calculate the EMA with a new, passed-in score.
func (*Keeper) CalcAndSaveReputerScoreEmaWithLastSavedTopicQuantile ¶ added in v0.0.1337
func (k *Keeper) CalcAndSaveReputerScoreEmaWithLastSavedTopicQuantile( ctx sdk.Context, topic types.Topic, block types.BlockHeight, previousReputerScore types.Score, ) error
Calculates and saves the EMA scores for a given reputer and topic. Uses the last saved topic quantile score to calculate the EMA. This is useful for updating EMAs of reputers in the passive set.
func (Keeper) CalcAppropriatePaginationForUint64Cursor ¶ added in v0.0.1337
func (k Keeper) CalcAppropriatePaginationForUint64Cursor(ctx context.Context, pagination *types.SimpleCursorPaginationRequest) (uint64, uint64, error)
Convert pagination.key from []bytes to uint64, if pagination is nil or [], len = 0 Get the limit from the pagination request, within acceptable bounds and defaulting as necessary
func (*Keeper) CanAddReputerStake ¶ added in v0.0.1337
func (k *Keeper) CanAddReputerStake(ctx context.Context, topicId TopicId, actor ActorId) (bool, error)
An actor can submit a reputer payload if they are topic reputer whitelisted or if they are globally whitelisted
func (*Keeper) CanCreateTopic ¶ added in v0.0.1337
An actor can create a topic if they are topic creator whitelisted or if they are globally whitelisted
func (*Keeper) CanSubmitReputerPayload ¶ added in v0.0.1337
func (k *Keeper) CanSubmitReputerPayload(ctx context.Context, topicId TopicId, actor ActorId) (bool, error)
An actor can submit a reputer payload if they are topic reputer whitelisted or if they are globally whitelisted
func (*Keeper) CanSubmitWorkerPayload ¶ added in v0.0.1337
func (k *Keeper) CanSubmitWorkerPayload(ctx context.Context, topicId TopicId, actor ActorId) (bool, error)
An actor can submit a worker payload if they are topic worker whitelisted or if they are globally whitelisted
func (*Keeper) CanUpdateGlobalWhitelists ¶ added in v0.7.0
Whitelist admins can update global whitelists including adding/removing from the global actor and whitelist admin lists
func (*Keeper) CanUpdateParams ¶ added in v0.0.1337
Whitelist admins can update global parameters
func (*Keeper) CanUpdateTopicCreatorWhitelist ¶ added in v0.0.1337
Whitelist admins can update the topic creator whitelist
func (*Keeper) CanUpdateTopicWhitelist ¶ added in v0.0.1337
func (k *Keeper) CanUpdateTopicWhitelist(ctx context.Context, topicId TopicId, actor ActorId) (bool, error)
Whitelist admins and topic creators can update topic whitelists Updating the whitelist includes adding/removing from the whitelist and enabling/disabling the whitelist
func (*Keeper) DeleteDelegateStakeRemoval ¶ added in v0.0.1337
func (k *Keeper) DeleteDelegateStakeRemoval( ctx context.Context, blockHeight BlockHeight, topicId TopicId, reputer ActorId, delegator ActorId, ) error
remove a stake removal from the queue
func (*Keeper) DeleteStakeRemoval ¶ added in v0.0.1337
func (k *Keeper) DeleteStakeRemoval( ctx context.Context, blockHeight BlockHeight, topicId TopicId, address ActorId, ) error
remove a stake removal from the queue
func (*Keeper) DeleteTopicRewardNonce ¶ added in v0.0.1337
DeleteTopicRewardNonce removes the reward nonce entry for a given topic ID.
func (*Keeper) DeleteUnfulfilledReputerNonces ¶ added in v0.0.1337
func (*Keeper) DeleteUnfulfilledWorkerNonces ¶ added in v0.0.1337
func (*Keeper) DeleteWorkerWindowBlockHeight ¶ added in v0.0.1337
func (k *Keeper) DeleteWorkerWindowBlockHeight(ctx sdk.Context, height BlockHeight) error
func (*Keeper) DisableTopicReputerWhitelist ¶ added in v0.0.1337
func (*Keeper) DisableTopicWorkerWhitelist ¶ added in v0.0.1337
func (*Keeper) DripTopicFeeRevenue ¶ added in v0.0.1337
Drop the fee revenue by the global Ecosystem bucket drip amount in the paper we say that ∆ C_{t,i} = N_{epochs,w} * C_{t,i} where C_{t,i} is the topic fee revenue and N_{epochs,w} is the number of epochs per week and this decay or drip happens each epoch
func (*Keeper) EnableTopicReputerWhitelist ¶ added in v0.0.1337
func (*Keeper) EnableTopicWorkerWhitelist ¶ added in v0.0.1337
func (*Keeper) ExportGenesis ¶
ExportGenesis exports the module state to a genesis state.
func (*Keeper) FulfillReputerNonce ¶ added in v0.0.1337
func (k *Keeper) FulfillReputerNonce(ctx context.Context, topicId TopicId, nonce *types.Nonce) (bool, error)
Attempts to fulfill an unfulfilled nonce. If the nonce is present, then it is removed from the unfulfilled nonces and this function returns true. If the nonce is not present, then the function returns false.
func (*Keeper) FulfillWorkerNonce ¶ added in v0.0.1337
func (k *Keeper) FulfillWorkerNonce(ctx context.Context, topicId TopicId, nonce *types.Nonce) (bool, error)
Attempts to fulfill an unfulfilled nonce. If the nonce is present, then it is removed from the unfulfilled nonces and this function returns true. If the nonce is not present, then the function returns false.
func (*Keeper) GetActiveForecastersForTopic ¶ added in v0.0.1337
func (k *Keeper) GetActiveForecastersForTopic(ctx context.Context, topicId TopicId) ([]ActorId, error)
GetActiveForecastersForTopic returns all active forecasters for a specific topic
func (*Keeper) GetActiveInferersForTopic ¶ added in v0.0.1337
GetActiveInferersForTopic returns all active inferers for a specific topic
func (*Keeper) GetActiveReputersForTopic ¶ added in v0.0.1337
GetActiveReputersForTopic returns all active reputers for a specific topic
func (*Keeper) GetActiveTopicIdsAtBlock ¶ added in v0.0.1337
func (k *Keeper) GetActiveTopicIdsAtBlock(ctx context.Context, block BlockHeight) (types.TopicIds, error)
It is assumed the size of the outputted array has been bounded as it was constructed => can be safely handled in memory.
func (*Keeper) GetBankBalance ¶ added in v0.0.1337
wrapper around bank keeper GetBalance
func (*Keeper) GetBinaryCodec ¶ added in v0.0.1337
func (k *Keeper) GetBinaryCodec() codec.BinaryCodec
func (*Keeper) GetCountForecasterInclusionsInTopic ¶ added in v0.0.1337
func (k *Keeper) GetCountForecasterInclusionsInTopic(ctx context.Context, topicId TopicId, forecaster ActorId) (uint64, error)
Get the count of forecaster inclusions in topic active set
func (*Keeper) GetCountInfererInclusionsInTopic ¶ added in v0.0.1337
func (k *Keeper) GetCountInfererInclusionsInTopic(ctx context.Context, topicId TopicId, inferer ActorId) (uint64, error)
Get the count of inferer inclusions in topic active set
func (*Keeper) GetCurrentTopicWeight ¶ added in v0.0.1337
func (k *Keeper) GetCurrentTopicWeight( ctx context.Context, topicId TopicId, topicEpochLength BlockHeight, topicRewardAlpha alloraMath.Dec, stakeImportance alloraMath.Dec, feeImportance alloraMath.Dec, ) (weight alloraMath.Dec, topicRevenue cosmosMath.Int, err error)
func (*Keeper) GetDelegateRewardPerShare ¶ added in v0.0.1337
func (k *Keeper) GetDelegateRewardPerShare(ctx context.Context, topicId TopicId, reputer ActorId) (alloraMath.Dec, error)
Returns the share of reward by a specific topic and reputer
func (*Keeper) GetDelegateStakePlacement ¶ added in v0.0.1337
func (k *Keeper) GetDelegateStakePlacement(ctx context.Context, topicId TopicId, delegator ActorId, target ActorId) (types.DelegatorInfo, error)
Returns the amount of stake placed by a specific delegator on a specific target.
func (Keeper) GetDelegateStakeRemoval ¶ added in v0.0.1337
func (k Keeper) GetDelegateStakeRemoval( ctx context.Context, blockHeight BlockHeight, topicId TopicId, delegator ActorId, reputer ActorId, ) (types.DelegateStakeRemovalInfo, error)
get info about a removal
func (*Keeper) GetDelegateStakeRemovalForDelegatorReputerAndTopicId ¶ added in v0.0.1337
func (k *Keeper) GetDelegateStakeRemovalForDelegatorReputerAndTopicId( ctx sdk.Context, delegator string, reputer string, topicId uint64, ) (removal types.DelegateStakeRemovalInfo, found bool, err error)
return the first found stake removal object for a delegator, reputer, and topicId
func (*Keeper) GetDelegateStakeRemovalsUpUntilBlock ¶ added in v0.0.1337
func (k *Keeper) GetDelegateStakeRemovalsUpUntilBlock( ctx context.Context, blockHeight BlockHeight, limit uint64, ) (ret []types.DelegateStakeRemovalInfo, limitHit bool, err error)
get a list of stake removals that are valid for removal before and including this block.
func (*Keeper) GetDelegateStakeUponReputer ¶ added in v0.0.1337
func (k *Keeper) GetDelegateStakeUponReputer(ctx context.Context, topicId TopicId, target ActorId) (cosmosMath.Int, error)
Returns the amount of stake placed upon a reputer by delegators within that topic
func (*Keeper) GetForecastScoresUntilBlock ¶ added in v0.0.1337
func (*Keeper) GetForecasterNetworkRegret ¶ added in v0.0.1337
func (k *Keeper) GetForecasterNetworkRegret( ctx context.Context, topicId TopicId, worker ActorId) ( regret types.TimestampedValue, noPrior bool, err error)
Returns the regret of a forecaster from comparing loss of forecaster relative to loss of other forecasters Returns (0, true) if no regret is found
func (*Keeper) GetForecasterScoreEma ¶ added in v0.0.1337
func (*Keeper) GetForecastsAtBlock ¶ added in v0.0.1337
func (*Keeper) GetInferenceScoresUntilBlock ¶ added in v0.0.1337
func (*Keeper) GetInferencesAtBlock ¶ added in v0.0.1337
func (k *Keeper) GetInferencesAtBlock(ctx context.Context, topicId TopicId, block BlockHeight) (*types.Inferences, error)
func (*Keeper) GetInfererNetworkRegret ¶ added in v0.0.1337
func (k *Keeper) GetInfererNetworkRegret( ctx context.Context, topicId TopicId, worker ActorId) ( regret types.TimestampedValue, noPrior bool, err error)
Returns the regret of a inferer from comparing loss of inferer relative to loss of other inferers Returns (0, true) if no regret is found
func (*Keeper) GetInfererScoreEma ¶ added in v0.0.1337
func (*Keeper) GetLastDripBlock ¶ added in v0.0.1337
return the last time we dripped the fee revenue for a topic
func (*Keeper) GetLatestNetworkLossBundle ¶ added in v0.0.1337
func (k *Keeper) GetLatestNetworkLossBundle(ctx context.Context, topicId TopicId) (*types.ValueBundle, error)
Returns the latest network loss bundle for a given topic id.
func (*Keeper) GetLatestTopicInferences ¶ added in v0.0.1337
func (k *Keeper) GetLatestTopicInferences(ctx context.Context, topicId TopicId) (*types.Inferences, BlockHeight, error)
GetLatestTopicInferences retrieves the latest topic inferences and its block height.
func (*Keeper) GetListeningCoefficient ¶ added in v0.0.1337
func (*Keeper) GetLowestActiveTopicWeightAtBlock ¶ added in v0.0.1337
func (k *Keeper) GetLowestActiveTopicWeightAtBlock( ctx context.Context, block BlockHeight, ) (topicIdAndWeight types.TopicIdWeightPair, noPrior bool, err error)
Boolean is true if the block is not found (true if no prior value), else false
func (*Keeper) GetLowestForecasterScoreEma ¶ added in v0.0.1337
func (k *Keeper) GetLowestForecasterScoreEma(ctx context.Context, topicId TopicId) (types.Score, bool, error)
GetLowestForecasterScoreEma gets the lowest forecaster score EMA for a topic
func (*Keeper) GetLowestInfererScoreEma ¶ added in v0.0.1337
func (k *Keeper) GetLowestInfererScoreEma(ctx context.Context, topicId TopicId) (types.Score, bool, error)
GetLowestInfererScoreEma gets the lowest inferer score EMA for a topic
func (*Keeper) GetLowestReputerScoreEma ¶ added in v0.0.1337
func (k *Keeper) GetLowestReputerScoreEma(ctx context.Context, topicId TopicId) (types.Score, bool, error)
GetLowestReputerScoreEma gets the lowest reputer score EMA for a topic
func (*Keeper) GetNaiveInfererNetworkRegret ¶ added in v0.0.1337
func (*Keeper) GetNetworkLossBundleAtBlock ¶ added in v0.0.1337
func (k *Keeper) GetNetworkLossBundleAtBlock(ctx context.Context, topicId TopicId, block BlockHeight) (*types.ValueBundle, error)
A function that accepts a topicId and returns the network LossBundle at the block or error
func (*Keeper) GetNextPossibleChurningBlockByTopicId ¶ added in v0.0.1337
func (k *Keeper) GetNextPossibleChurningBlockByTopicId(ctx context.Context, topicId TopicId) (BlockHeight, bool, error)
Boolean true if topic is active, else false
func (*Keeper) GetNextTopicId ¶ added in v0.0.1337
Returns the number of topics that are active in the network
func (*Keeper) GetOneInForecasterNetworkRegret ¶ added in v0.0.1337
func (k *Keeper) GetOneInForecasterNetworkRegret( ctx context.Context, topicId TopicId, oneInForecaster ActorId, inferer ActorId) ( regret types.TimestampedValue, noPrior bool, err error)
Returns the regret of a forecaster from comparing loss of forecaster relative to loss of other forecasters Returns (0, true) if no regret is found
func (*Keeper) GetOneOutForecasterForecasterNetworkRegret ¶ added in v0.0.1337
func (*Keeper) GetOneOutForecasterInfererNetworkRegret ¶ added in v0.0.1337
func (k *Keeper) GetOneOutForecasterInfererNetworkRegret( ctx context.Context, topicId TopicId, oneOutForecaster ActorId, inferer ActorId) ( regret types.TimestampedValue, noPrior bool, err error)
return the one out forecaster inferer regret, how much that forecaster affects the inferer network loss if no prior is found, return the initial regret of the topic
func (*Keeper) GetOneOutInfererForecasterNetworkRegret ¶ added in v0.0.1337
func (k *Keeper) GetOneOutInfererForecasterNetworkRegret( ctx context.Context, topicId TopicId, oneOutInferer ActorId, forecaster ActorId) ( regret types.TimestampedValue, noPrior bool, err error)
return the one out inferer forecaster regret, how much that inferer affects the forecast loss if no prior is found, return the initial regret of the topic
func (*Keeper) GetOneOutInfererInfererNetworkRegret ¶ added in v0.0.1337
func (k *Keeper) GetOneOutInfererInfererNetworkRegret( ctx context.Context, topicId TopicId, oneOutInferer ActorId, inferer ActorId) ( regret types.TimestampedValue, noPrior bool, err error)
return the one out inferer regret, how much the one out inferer affects the network loss if no prior is found, return the initial regret of the topic
func (*Keeper) GetPreviousForecastRewardFraction ¶ added in v0.0.1337
func (k *Keeper) GetPreviousForecastRewardFraction(ctx context.Context, topicId TopicId, worker ActorId) ( previousForecastRewardFraction alloraMath.Dec, noPrior bool, err error)
Gets the previous V_{i-1,m} Returns previous reward fraction, and true if it has yet to be set for the first time (else false)
func (*Keeper) GetPreviousForecasterScoreRatio ¶ added in v0.0.1337
func (*Keeper) GetPreviousInferenceRewardFraction ¶ added in v0.0.1337
func (k *Keeper) GetPreviousInferenceRewardFraction(ctx context.Context, topicId TopicId, worker ActorId) ( previousInferenceRewardFraction alloraMath.Dec, noPrior bool, err error)
Gets the previous U_{i-1,m} Returns previous reward fraction, and true if it has yet to be set for the first time (else false)
func (Keeper) GetPreviousPercentageRewardToStakedReputers ¶ added in v0.0.1337
func (*Keeper) GetPreviousReputerRewardFraction ¶ added in v0.0.1337
func (k *Keeper) GetPreviousReputerRewardFraction( ctx context.Context, topicId TopicId, reputer ActorId) ( previousReputerRewardFraction alloraMath.Dec, noPrior bool, err error)
Gets the previous W_{i-1,m} Returns previous reward fraction, and true if it has yet to be set for the first time (else false)
func (*Keeper) GetPreviousTopicQuantileForecasterScoreEma ¶ added in v0.0.1337
func (k *Keeper) GetPreviousTopicQuantileForecasterScoreEma(ctx context.Context, topicId TopicId) (alloraMath.Dec, error)
Gets the previous Forecaster Score Ema at Topic quantile Returns previous forecaster score ema at topic quantile, or 0 if not yet seen
func (*Keeper) GetPreviousTopicQuantileInfererScoreEma ¶ added in v0.0.1337
func (k *Keeper) GetPreviousTopicQuantileInfererScoreEma(ctx context.Context, topicId TopicId) (alloraMath.Dec, error)
Gets the previous Inferer Score Ema at Topic quantile Returns previous inferer score ema at topic quantile, or 0 if not yet seen
func (*Keeper) GetPreviousTopicQuantileReputerScoreEma ¶ added in v0.0.1337
func (k *Keeper) GetPreviousTopicQuantileReputerScoreEma(ctx context.Context, topicId TopicId) (alloraMath.Dec, error)
Gets the previous Reputer Score Ema at Topic quantile Returns previous reputer score ema at topic quantile, or 0 if not yet seen
func (*Keeper) GetPreviousTopicWeight ¶ added in v0.0.1337
func (k *Keeper) GetPreviousTopicWeight(ctx context.Context, topicId TopicId) (topicWeight alloraMath.Dec, noPrior bool, err error)
Get the previous weight during rewards calculation for a topic Returns ((0,0), true) if there was no prior topic weight set, else ((x,y), false) where x,y!=0
func (*Keeper) GetReputerInfo ¶ added in v0.0.1337
func (*Keeper) GetReputerLatestLossByTopicId ¶ added in v0.0.1337
func (k *Keeper) GetReputerLatestLossByTopicId( ctx context.Context, topicId TopicId, reputer ActorId, ) (types.ReputerValueBundle, error)
GetReputerLatestLossByTopicId
func (*Keeper) GetReputerLossBundlesAtBlock ¶ added in v0.0.1337
func (k *Keeper) GetReputerLossBundlesAtBlock(ctx context.Context, topicId TopicId, block BlockHeight) (*types.ReputerValueBundles, error)
Get loss bundles for a topic/timestamp
func (*Keeper) GetReputerScoreEma ¶ added in v0.0.1337
func (*Keeper) GetReputerTopicLastCommit ¶ added in v0.0.1337
func (*Keeper) GetReputersScoresAtBlock ¶ added in v0.0.1337
func (*Keeper) GetRewardCurrentBlockEmission ¶ added in v0.0.1337
GetRewardCurrentBlockEmission retrieves the current block emission reward.
func (*Keeper) GetStakeFromDelegatorInTopic ¶ added in v0.0.1337
func (k *Keeper) GetStakeFromDelegatorInTopic(ctx context.Context, topicId TopicId, delegator ActorId) (cosmosMath.Int, error)
Returns the amount of stake placed by a specific delegator.
func (Keeper) GetStakeRemoval ¶ added in v0.0.1337
func (k Keeper) GetStakeRemoval( ctx context.Context, BlockHeight int64, topicId TopicId, reputer ActorId, ) (types.StakeRemovalInfo, error)
get info about a removal
func (*Keeper) GetStakeRemovalForReputerAndTopicId ¶ added in v0.0.1337
func (k *Keeper) GetStakeRemovalForReputerAndTopicId( ctx sdk.Context, reputer string, topicId uint64, ) (removal types.StakeRemovalInfo, found bool, err error)
get the first found stake removal for a reputer and topicId or err not found if not found
func (*Keeper) GetStakeRemovalsUpUntilBlock ¶ added in v0.0.1337
func (k *Keeper) GetStakeRemovalsUpUntilBlock( ctx context.Context, blockHeight BlockHeight, limit uint64, ) (ret []types.StakeRemovalInfo, anyLeft bool, err error)
get a list of stake removals that are valid for removal before and including this block.
func (*Keeper) GetStakeReputerAuthority ¶ added in v0.0.1337
func (k *Keeper) GetStakeReputerAuthority(ctx context.Context, topicId TopicId, reputer ActorId) (cosmosMath.Int, error)
Returns the amount of stake placed by a specific reputer on a specific topic. Includes the stake placed by delegators on the reputer in that topic.
func (*Keeper) GetStorageService ¶ added in v0.0.1337
func (k *Keeper) GetStorageService() coreStore.KVStoreService
func (*Keeper) GetTargetWeight ¶ added in v0.0.1337
func (k *Keeper) GetTargetWeight( topicStake alloraMath.Dec, topicEpochLength int64, topicFeeRevenue alloraMath.Dec, stakeImportance alloraMath.Dec, feeImportance alloraMath.Dec, ) (alloraMath.Dec, error)
Return the target weight of a topic ^w_{t,i} = S^{μ}_{t,i} * (P/C)^{ν}_{t,i} where S_{t,i} is the stake of of topic t in the last reward epoch i and (P/C)_{t,i} is the fee revenue collected for performing inference per topic epoch requests for topic t in the last reward epoch i μ, ν are global constants with fiduciary values of 0.5 and 0.5
func (*Keeper) GetTopicFeeRevenue ¶ added in v0.0.1337
Get the amount of fee revenue collected by a topic
func (*Keeper) GetTopicRewardNonce ¶ added in v0.0.1337
GetTopicRewardNonce retrieves the reward nonce for a given topic ID.
func (*Keeper) GetTopicStake ¶
Gets the stake in the network for a given topic
func (*Keeper) GetTopicWeightFromTopicId ¶ added in v0.0.1337
func (*Keeper) GetTotalRewardToDistribute ¶ added in v0.0.1337
Gets the total rewards available to be distributed from the Allora Rewards Module Account
func (Keeper) GetTotalStake ¶
Gets the total sum of all stake in the network across all topics
func (*Keeper) GetTotalSumPreviousTopicWeights ¶ added in v0.0.1337
Get the total sum of previous topic weights
func (*Keeper) GetUnfulfilledReputerNonces ¶ added in v0.0.1337
func (*Keeper) GetUnfulfilledWorkerNonces ¶ added in v0.0.1337
func (*Keeper) GetWorkerForecastScoresAtBlock ¶ added in v0.0.1337
func (*Keeper) GetWorkerInferenceScoresAtBlock ¶ added in v0.0.1337
func (*Keeper) GetWorkerInfo ¶ added in v0.0.1337
func (*Keeper) GetWorkerLatestForecastByTopicId ¶ added in v0.0.1337
func (*Keeper) GetWorkerLatestInferenceByTopicId ¶ added in v0.0.4
func (*Keeper) GetWorkerTopicLastCommit ¶ added in v0.0.1337
func (*Keeper) GetWorkerWindowTopicIds ¶ added in v0.0.1337
GetTopicIds returns the TopicIds for a given BlockHeight. If no TopicIds are found for the BlockHeight, it returns an empty slice.
func (*Keeper) InactivateTopic ¶
Inactivate the topic
func (*Keeper) IncrementCountForecasterInclusionsInTopic ¶ added in v0.0.1337
func (k *Keeper) IncrementCountForecasterInclusionsInTopic(ctx context.Context, topicId TopicId, forecaster ActorId) error
Increase the count of forecaster inclusions in topic active set
func (*Keeper) IncrementCountInfererInclusionsInTopic ¶ added in v0.0.1337
func (k *Keeper) IncrementCountInfererInclusionsInTopic(ctx context.Context, topicId TopicId, inferer ActorId) error
Get the count of inferer inclusions in topic active set
func (*Keeper) IncrementTopicId ¶
Gets next topic id
func (*Keeper) InitGenesis ¶
InitGenesis initializes the module state from a genesis state.
func (*Keeper) InsertActiveForecasts ¶ added in v0.0.1337
func (k *Keeper) InsertActiveForecasts( ctx context.Context, topicId TopicId, nonceBlockHeight BlockHeight, forecasts types.Forecasts, ) error
Insert a complete set of forecasts for a topic/block.
func (*Keeper) InsertActiveInferences ¶ added in v0.0.1337
func (k *Keeper) InsertActiveInferences( ctx context.Context, topicId TopicId, nonceBlockHeight BlockHeight, inferences types.Inferences, ) error
Insert a complete set of inferences for a topic/block.
func (*Keeper) InsertActiveReputerLosses ¶ added in v0.0.1337
func (k *Keeper) InsertActiveReputerLosses( ctx context.Context, topicId TopicId, block BlockHeight, reputerLossBundles types.ReputerValueBundles, ) error
Insert a loss bundle for a topic and timestamp but do it in the CloseReputerNonce, so reputer loss bundles are known to be validated and not validated again (this is due to poor data type design choices, see PROTO-2369)
func (*Keeper) InsertForecast ¶ added in v0.0.1337
func (k *Keeper) InsertForecast( ctx context.Context, topicId TopicId, forecast types.Forecast, ) error
InsertForecast inserts a forecast for a specific topic
func (*Keeper) InsertInference ¶
func (k *Keeper) InsertInference( ctx context.Context, topicId TopicId, inference types.Inference, ) error
Insert an inference for a specific topic
func (*Keeper) InsertNetworkLossBundleAtBlock ¶ added in v0.0.1337
func (k *Keeper) InsertNetworkLossBundleAtBlock( ctx context.Context, topicId TopicId, block BlockHeight, lossBundle types.ValueBundle, ) error
Insert a network loss bundle for a topic and block.
func (*Keeper) InsertReputer ¶
func (k *Keeper) InsertReputer(ctx context.Context, topicId TopicId, reputer ActorId, reputerInfo types.OffchainNode) error
Adds a new reputer to the reputer tracking data structures, reputers and topicReputers
func (*Keeper) InsertReputerLoss ¶ added in v0.0.1337
func (k *Keeper) InsertReputerLoss( ctx context.Context, topicId TopicId, reputerLoss types.ReputerValueBundle, ) error
InsertReputerLoss inserts a reputer loss for a specific topic
func (*Keeper) InsertReputerScore ¶ added in v0.0.1337
func (*Keeper) InsertWorker ¶
func (k *Keeper) InsertWorker(ctx context.Context, topicId TopicId, worker ActorId, workerInfo types.OffchainNode) error
Adds a new worker to the worker tracking data structures, workers and topicWorkers
func (*Keeper) InsertWorkerForecastScore ¶ added in v0.0.1337
func (*Keeper) InsertWorkerInferenceScore ¶ added in v0.0.1337
func (*Keeper) IsActiveForecaster ¶ added in v0.0.1337
func (k *Keeper) IsActiveForecaster(ctx context.Context, topicId TopicId, forecaster ActorId) (bool, error)
IsActiveForecaster checks if a forecaster is in the active forecasters set for a topic
func (*Keeper) IsActiveInferer ¶ added in v0.0.1337
func (k *Keeper) IsActiveInferer(ctx context.Context, topicId TopicId, inferer ActorId) (bool, error)
IsActiveInferer checks if an inferer is in the active inferers set for a topic
func (*Keeper) IsActiveReputer ¶ added in v0.0.1337
func (k *Keeper) IsActiveReputer(ctx context.Context, topicId TopicId, reputer ActorId) (bool, error)
IsActiveReputer checks if a reputer is in the active reputers set for a topic
func (*Keeper) IsEnabledGlobalActor ¶ added in v0.0.1337
An actor is globally whitelisted if the GlobalWhitelistEnabled global parameter is false or (the parameter is true and the globalWhitelist keyset has the actor)
func (*Keeper) IsEnabledTopicReputer ¶ added in v0.0.1337
func (k *Keeper) IsEnabledTopicReputer(ctx context.Context, topicId TopicId, actor ActorId) (bool, error)
An actor is topic reputer whitelisted if the topicWhitelistEnabled parameter is false or (the parameter is true and topicReputerWhitelist keyset has the (topicId, actor) key)
func (*Keeper) IsEnabledTopicWorker ¶ added in v0.0.1337
func (k *Keeper) IsEnabledTopicWorker(ctx context.Context, topicId TopicId, actor ActorId) (bool, error)
An actor is topic worker whitelisted if the topicWhitelistEnabled parameter is false or (the parameter is true and topicWorkerWhitelist keyset has the (topicId, actor) key)
func (*Keeper) IsEnabledWhitelistedTopicCreator ¶ added in v0.0.1337
An actor is topic creator whitelisted if the TopicCreatorWhitelistEnabled global parameter is false or (the parameter is true and the topicCreatorWhitelist keyset has the actor)
func (*Keeper) IsReputerNonceUnfulfilled ¶ added in v0.0.1337
func (k *Keeper) IsReputerNonceUnfulfilled(ctx context.Context, topicId TopicId, nonce *types.Nonce) (isUnfulfilled bool, err error)
True if nonce is unfulfilled, false otherwise.
func (*Keeper) IsReputerRegisteredInTopic ¶ added in v0.0.1337
func (k *Keeper) IsReputerRegisteredInTopic(ctx context.Context, topicId TopicId, reputer ActorId) (bool, error)
True if reputer is registered in topic, else False
func (*Keeper) IsTopicActive ¶ added in v0.0.1337
Check if the topic is activated or not
func (*Keeper) IsTopicReputerWhitelistEnabled ¶ added in v0.0.1337
A topic is whitelist enabled if the topicWhitelistEnabled keyset has the topicId
func (*Keeper) IsTopicWorkerWhitelistEnabled ¶ added in v0.0.1337
A topic is whitelist enabled if the topicWhitelistEnabled keyset has the topicId
func (Keeper) IsWhitelistAdmin ¶ added in v0.0.1
An actor is a whitelist admin if they are in the whitelistAdmins keyset
func (*Keeper) IsWhitelistedGlobalActor ¶ added in v0.0.1337
func (*Keeper) IsWhitelistedTopicCreator ¶ added in v0.0.1337
func (*Keeper) IsWhitelistedTopicReputer ¶ added in v0.0.1337
func (*Keeper) IsWhitelistedTopicWorker ¶ added in v0.0.1337
func (*Keeper) IsWorkerNonceUnfulfilled ¶ added in v0.0.1337
func (k *Keeper) IsWorkerNonceUnfulfilled(ctx context.Context, topicId TopicId, nonce *types.Nonce) (isUnfulfilled bool, err error)
True if nonce is unfulfilled, false otherwise.
func (*Keeper) IsWorkerRegisteredInTopic ¶ added in v0.0.1337
func (k *Keeper) IsWorkerRegisteredInTopic(ctx context.Context, topicId TopicId, worker ActorId) (bool, error)
True if worker is registered in topic, else False
func (*Keeper) PruneRecordsAfterRewards ¶ added in v0.0.1337
func (k *Keeper) PruneRecordsAfterRewards(ctx context.Context, topicId TopicId, blockHeight int64) error
Iterate through topic state and prune records that are no longer needed
func (*Keeper) PruneReputerNonces ¶ added in v0.0.1337
func (*Keeper) PruneTopicActivationDataAtBlock ¶ added in v0.0.1337
func (k *Keeper) PruneTopicActivationDataAtBlock(ctx context.Context, block BlockHeight) error
Removes data for a block if it exists in the maps: - blockToActiveTopics - blockToLowestActiveTopicWeight No op if the block does not exist in the maps
func (*Keeper) PruneWorkerNonces ¶ added in v0.0.1337
func (*Keeper) RemoveActiveForecaster ¶ added in v0.0.1337
func (k *Keeper) RemoveActiveForecaster(ctx context.Context, topicId TopicId, forecaster ActorId) error
RemoveActiveForecaster removes a forecaster from the active forecasters set for a topic
func (*Keeper) RemoveActiveInferer ¶ added in v0.0.1337
RemoveActiveInferer removes an inferer from the active inferers set for a topic
func (*Keeper) RemoveActiveReputer ¶ added in v0.0.1337
RemoveActiveReputer removes a reputer from the active reputers set for a topic
func (*Keeper) RemoveDelegateStake ¶ added in v0.0.1337
func (k *Keeper) RemoveDelegateStake( ctx context.Context, stakeRemovalBlockHeight BlockHeight, topicId TopicId, delegator ActorId, reputer ActorId, stakeToRemove cosmosMath.Int, ) error
Removes delegate stake from the system for a given topic, delegator, and reputer subtracts from: totalStake, topicStake, stakeReputerAuthority
stakeSumFromDelegator, delegatedStakes, stakeFromDelegatorsUponReputer
func (*Keeper) RemoveForecast ¶ added in v0.0.1337
RemoveForecast removes a forecast from a forecaster
func (*Keeper) RemoveFromGlobalWhitelist ¶ added in v0.0.1337
func (*Keeper) RemoveFromTopicCreatorWhitelist ¶ added in v0.0.1337
func (*Keeper) RemoveFromTopicReputerWhitelist ¶ added in v0.0.1337
func (*Keeper) RemoveFromTopicWorkerWhitelist ¶ added in v0.0.1337
func (*Keeper) RemoveInference ¶ added in v0.0.1337
RemoveInference removes an inference from a inferer
func (*Keeper) RemoveReputer ¶
Remove a reputer to the reputer tracking data structures and topicReputers
func (*Keeper) RemoveReputerLoss ¶ added in v0.0.1337
RemoveReputerLoss removes a reputer loss for a specific topic
func (*Keeper) RemoveReputerStake ¶ added in v0.0.1337
func (k *Keeper) RemoveReputerStake( ctx context.Context, blockHeight BlockHeight, topicId TopicId, reputer ActorId, stakeToRemove cosmosMath.Int) error
Removes stake from the system for a given topic and reputer subtracts from: totalStake, topicStake, stakeReputerAuthority
func (*Keeper) RemoveWhitelistAdmin ¶ added in v0.0.1
func (*Keeper) RemoveWorker ¶
Remove a worker to the worker tracking data structures and topicWorkers
func (*Keeper) ResetActiveReputersForTopic ¶ added in v0.0.1337
ResetActiveReputersForTopic resets the active reputers for a topic
func (*Keeper) ResetActiveWorkersForTopic ¶ added in v0.0.1337
ResetActiveWorkersForTopic resets the active workers for a topic
func (*Keeper) ResetLowestActiveTopicWeightAtBlock ¶ added in v0.0.1337
func (k *Keeper) ResetLowestActiveTopicWeightAtBlock(ctx context.Context, block BlockHeight) error
func (*Keeper) ResetReputersIndividualSubmissionsForTopic ¶ added in v0.0.1337
func (k *Keeper) ResetReputersIndividualSubmissionsForTopic(ctx context.Context, topicId TopicId) error
ResetReputersIndividualSubmissionsForTopic resets the reputer individual submissions for a topic
func (*Keeper) ResetWorkersIndividualSubmissionsForTopic ¶ added in v0.0.1337
func (k *Keeper) ResetWorkersIndividualSubmissionsForTopic(ctx context.Context, topicId TopicId) error
ResetWorkersIndividualSubmissionsForTopic resets the inferer individual submissions for a topic
func (*Keeper) SendCoinsFromAccountToModule ¶ added in v0.0.1337
func (k *Keeper) SendCoinsFromAccountToModule(ctx context.Context, sender ActorId, recipientModule string, amt sdk.Coins) error
wrapper around bank keeper SendCoinsFromAccountToModule
func (*Keeper) SendCoinsFromModuleToAccount ¶ added in v0.0.1337
func (k *Keeper) SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipient ActorId, amt sdk.Coins) error
wrapper around bank keeper SendCoinsFromModuleToAccount
func (*Keeper) SendCoinsFromModuleToModule ¶
func (k *Keeper) SendCoinsFromModuleToModule(ctx context.Context, senderModule, recipientModule string, amt sdk.Coins) error
wrapper around bank keeper SendCoinsFromModuleToModule
func (*Keeper) SetActiveTopics ¶ added in v0.0.1337
wrapper for set operation around activeTopics
func (*Keeper) SetBlockToActiveTopics ¶ added in v0.0.1337
func (k *Keeper) SetBlockToActiveTopics(ctx context.Context, block BlockHeight, topicIds types.TopicIds) error
wrapper for set operation around blockToActiveTopics
func (*Keeper) SetBlockToLowestActiveTopicWeight ¶ added in v0.0.1337
func (k *Keeper) SetBlockToLowestActiveTopicWeight( ctx context.Context, block BlockHeight, weightPair types.TopicIdWeightPair, ) error
wrapper for set operation around blockToLowestActiveTopicWeight
func (*Keeper) SetDelegateRewardPerShare ¶ added in v0.0.1337
func (k *Keeper) SetDelegateRewardPerShare(ctx context.Context, topicId TopicId, reputer ActorId, share alloraMath.Dec) error
Set the share on specific reputer and topicId
func (*Keeper) SetDelegateStakePlacement ¶ added in v0.0.1337
func (k *Keeper) SetDelegateStakePlacement(ctx context.Context, topicId TopicId, delegator ActorId, target ActorId, stake types.DelegatorInfo) error
Sets the amount of stake placed by a specific delegator on a specific target.
func (*Keeper) SetDelegateStakeRemoval ¶ added in v0.0.1337
func (k *Keeper) SetDelegateStakeRemoval(ctx context.Context, removalInfo types.DelegateStakeRemovalInfo) error
For a given address, adds their stake removal information to the removal queue for delay waiting The topic used will be the topic set in the `removalInfo` This completely overrides the existing stake removal
func (*Keeper) SetDelegateStakeUponReputer ¶ added in v0.0.1337
func (k *Keeper) SetDelegateStakeUponReputer(ctx context.Context, topicId TopicId, target ActorId, stake cosmosMath.Int) error
Sets the amount of stake placed on a specific target.
func (*Keeper) SetForecasterNetworkRegret ¶ added in v0.0.1337
func (*Keeper) SetForecasterScoreEma ¶ added in v0.0.1337
func (*Keeper) SetInfererNetworkRegret ¶ added in v0.0.1337
func (*Keeper) SetInfererScoreEma ¶ added in v0.0.1337
func (k *Keeper) SetInfererScoreEma(ctx context.Context, topicId TopicId, worker ActorId, score types.Score) error
If the new score is older than the current score, don't update
func (*Keeper) SetLastDripBlock ¶ added in v0.0.1337
set the last time we dripped the fee revenue for a topic
func (*Keeper) SetListeningCoefficient ¶ added in v0.0.1337
func (*Keeper) SetLowestForecasterScoreEma ¶ added in v0.0.1337
func (k *Keeper) SetLowestForecasterScoreEma(ctx context.Context, topicId TopicId, lowestScore types.Score) error
SetLowestForecasterScoreEma sets the lowest forecaster score EMA for a topic
func (*Keeper) SetLowestInfererScoreEma ¶ added in v0.0.1337
func (k *Keeper) SetLowestInfererScoreEma(ctx context.Context, topicId TopicId, lowestScore types.Score) error
SetLowestInfererScoreEma sets the lowest inferer score EMA for a topic
func (*Keeper) SetLowestReputerScoreEma ¶ added in v0.0.1337
func (k *Keeper) SetLowestReputerScoreEma(ctx context.Context, topicId TopicId, lowestScore types.Score) error
SetLowestReputerScoreEma sets the lowest reputer score EMA for a topic
func (*Keeper) SetNaiveInfererNetworkRegret ¶ added in v0.0.1337
func (*Keeper) SetOneInForecasterNetworkRegret ¶ added in v0.0.1337
func (*Keeper) SetOneOutForecasterForecasterNetworkRegret ¶ added in v0.0.1337
func (*Keeper) SetOneOutForecasterInfererNetworkRegret ¶ added in v0.0.1337
func (*Keeper) SetOneOutInfererForecasterNetworkRegret ¶ added in v0.0.1337
func (*Keeper) SetOneOutInfererInfererNetworkRegret ¶ added in v0.0.1337
func (*Keeper) SetPreviousForecastRewardFraction ¶ added in v0.0.1337
func (k *Keeper) SetPreviousForecastRewardFraction(ctx context.Context, topicId TopicId, worker ActorId, reward alloraMath.Dec) error
Sets the previous V_{i-1,m}
func (*Keeper) SetPreviousForecasterScoreRatio ¶ added in v0.0.1337
func (*Keeper) SetPreviousInferenceRewardFraction ¶ added in v0.0.1337
func (k *Keeper) SetPreviousInferenceRewardFraction(ctx context.Context, topicId TopicId, worker ActorId, reward alloraMath.Dec) error
Sets the previous U_{i-1,m}
func (*Keeper) SetPreviousPercentageRewardToStakedReputers ¶ added in v0.0.1337
func (*Keeper) SetPreviousReputerRewardFraction ¶ added in v0.0.1337
func (k *Keeper) SetPreviousReputerRewardFraction(ctx context.Context, topicId TopicId, reputer ActorId, reward alloraMath.Dec) error
Sets the previous W_{i-1,m}
func (*Keeper) SetPreviousTopicQuantileForecasterScoreEma ¶ added in v0.0.1337
func (*Keeper) SetPreviousTopicQuantileInfererScoreEma ¶ added in v0.0.1337
func (*Keeper) SetPreviousTopicQuantileReputerScoreEma ¶ added in v0.0.1337
func (*Keeper) SetPreviousTopicWeight ¶ added in v0.0.1337
func (k *Keeper) SetPreviousTopicWeight(ctx context.Context, topicId TopicId, weight alloraMath.Dec) error
Set the previous weight during rewards calculation for a topic
func (*Keeper) SetReputerScoreEma ¶ added in v0.0.1337
func (k *Keeper) SetReputerScoreEma(ctx context.Context, topicId TopicId, reputer ActorId, score types.Score) error
If the new score is older than the current score, don't update
func (*Keeper) SetReputerTopicLastCommit ¶ added in v0.0.1337
func (Keeper) SetRewardCurrentBlockEmission ¶ added in v0.0.1337
SetRewardCurrentBlockEmission sets the current block emission reward.
func (*Keeper) SetStakeFromDelegator ¶ added in v0.0.1337
func (k *Keeper) SetStakeFromDelegator(ctx context.Context, topicId TopicId, delegator ActorId, stake cosmosMath.Int) error
Sets the amount of stake placed by a specific delegator.
func (*Keeper) SetStakeRemoval ¶ added in v0.0.1337
For a given address, adds their stake removal information to the removal queue for delay waiting The topic used will be the topic set in the `removalInfo` This completely overrides the existing stake removal
func (*Keeper) SetStakeReputerAuthority ¶ added in v0.0.1337
func (k *Keeper) SetStakeReputerAuthority(ctx context.Context, topicId TopicId, reputer ActorId, amount cosmosMath.Int) error
Sets the amount of stake placed upon a reputer in addition to their personal stake on a specific topic Includes the stake placed by delegators on the reputer in that topic.
func (*Keeper) SetTopicRewardNonce ¶ added in v0.0.1337
SetTopicRewardNonce sets the reward nonce for a given topic ID.
func (*Keeper) SetTopicStake ¶
sets the cumulative amount of stake in a topic
func (*Keeper) SetTopicToNextPossibleChurningBlock ¶ added in v0.0.1337
func (k *Keeper) SetTopicToNextPossibleChurningBlock(ctx context.Context, topicId TopicId, block BlockHeight) error
wrapper for set operation around topicToNextPossibleChurningBlock
func (*Keeper) SetTotalStake ¶
Sets the total sum of all stake in the network across all topics
func (*Keeper) SetTotalSumPreviousTopicWeights ¶ added in v0.0.1337
Set the total sum of previous topic weights
func (*Keeper) SetWorkerTopicLastCommit ¶ added in v0.0.1337
func (*Keeper) TopicExists ¶
Checks if a topic exists
func (*Keeper) UpdateTopicEpochLastEnded ¶ added in v0.0.1337
func (k *Keeper) UpdateTopicEpochLastEnded(ctx context.Context, topicId TopicId, epochLastEnded BlockHeight) error
UpdateTopicInferenceLastRan updates the InferenceLastRan timestamp for a given topic.
func (*Keeper) UpdateTopicInitialRegret ¶ added in v0.0.1337
func (k *Keeper) UpdateTopicInitialRegret(ctx context.Context, topicId TopicId, initialRegret alloraMath.Dec) error
UpdateTopicInitialRegret updates the InitialRegret for a given topic.
func (*Keeper) UpdateTotalSumPreviousTopicWeights ¶ added in v0.0.1337
func (k *Keeper) UpdateTotalSumPreviousTopicWeights(ctx context.Context, topicId TopicId, newWeight alloraMath.Dec) error
UpdateTotalSumPreviousTopicWeights updates the total sum of previous topic weights by subtracting the old weight if any, and adding the new weight for the given topicId.
func (*Keeper) ValidateStringIsBech32 ¶ added in v0.0.1337
type Quadruple ¶ added in v0.0.1337
type Quadruple[K1, K2, K3, K4 any] struct { // contains filtered or unexported fields }
Quadruple defines a multipart key composed of four keys.
func Join4 ¶ added in v0.0.1337
Join4 instantiates a new Quadruple instance composed of the three provided keys, in order.
func QuadrupleDoublePrefix ¶ added in v0.0.1337
QuadrupleDoublePrefix creates a new Quadruple instance composed only of the first two parts of the key.
func QuadrupleSinglePrefix ¶ added in v0.0.1337
QuadrupleSinglePrefix creates a new Quadruple instance composed only of the first part of the key.
func QuadrupleTriplePrefix ¶ added in v0.0.1337
QuadrupleTriplePrefix creates a new Quadruple instance composed only of the first three parts of the key.
func (Quadruple[K1, K2, K3, K4]) K1 ¶ added in v0.0.1337
func (t Quadruple[K1, K2, K3, K4]) K1() (x K1)
K1 returns the first part of the key. If nil, the zero value is returned.
func (Quadruple[K1, K2, K3, K4]) K2 ¶ added in v0.0.1337
func (t Quadruple[K1, K2, K3, K4]) K2() (x K2)
K2 returns the second part of the key. If nil, the zero value is returned.