Documentation ¶
Index ¶
- type AccountKeeper
- type ActorId
- type BankKeeper
- type BlockHeight
- type Keeper
- func (k *Keeper) AccountKeeper() AccountKeeper
- func (k *Keeper) ActivateTopic(ctx context.Context, topicId TopicId) error
- func (k *Keeper) AddChurnableTopic(ctx context.Context, topicId TopicId) 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) AddRewardableTopic(ctx context.Context, topicId TopicId) error
- func (k *Keeper) AddStake(ctx context.Context, topicId TopicId, reputer ActorId, stake cosmosMath.Int) 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) BankKeeper() BankKeeper
- func (k Keeper) CalcAppropriatePaginationForUint64Cursor(ctx context.Context, pagination *types.SimpleCursorPaginationRequest) (uint64, uint64, error)
- func (k *Keeper) CheckCadence(blockHeight int64, topic types.Topic) bool
- 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) DripTopicFeeRevenue(ctx context.Context, topicId TopicId, block BlockHeight) 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) GetChurnableTopics(ctx context.Context) ([]TopicId, 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) GetDelegateStakeRemovalByTopicAndAddress(ctx context.Context, topicId TopicId, reputer ActorId, delegator ActorId) (types.DelegateStakeRemoval, 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) (types.TimestampedValue, bool, error)
- func (k *Keeper) GetForecastsAtBlock(ctx context.Context, topicId TopicId, block BlockHeight) (*types.Forecasts, error)
- func (k Keeper) GetIdsOfActiveTopics(ctx context.Context, pagination *types.SimpleCursorPaginationRequest) ([]TopicId, *types.SimpleCursorPaginationResponse, 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) (types.TimestampedValue, bool, error)
- func (k *Keeper) GetLatestForecasterScore(ctx context.Context, topicId TopicId, worker ActorId) (types.Score, error)
- func (k *Keeper) GetLatestInfererScore(ctx context.Context, topicId TopicId, worker ActorId) (types.Score, error)
- func (k *Keeper) GetLatestReputerScore(ctx context.Context, topicId TopicId, reputer ActorId) (types.Score, error)
- func (k *Keeper) GetListeningCoefficient(ctx context.Context, topicId TopicId, reputer ActorId) (types.ListeningCoefficient, error)
- func (k *Keeper) GetNetworkLossBundleAtBlock(ctx context.Context, topicId TopicId, block BlockHeight) (*types.ValueBundle, error)
- func (k *Keeper) GetNextTopicId(ctx context.Context) (TopicId, error)
- func (k *Keeper) GetOneInForecasterNetworkRegret(ctx context.Context, topicId TopicId, forecaster ActorId, inferer ActorId) (types.TimestampedValue, bool, error)
- func (k Keeper) GetParams(ctx context.Context) (types.Params, error)
- func (k *Keeper) GetPreviousForecastRewardFraction(ctx context.Context, topicId TopicId, worker ActorId) (alloraMath.Dec, bool, error)
- func (k *Keeper) GetPreviousInferenceRewardFraction(ctx context.Context, topicId TopicId, worker ActorId) (alloraMath.Dec, bool, error)
- func (k Keeper) GetPreviousPercentageRewardToStakedReputers(ctx context.Context) (alloraMath.Dec, error)
- func (k *Keeper) GetPreviousReputerRewardFraction(ctx context.Context, topicId TopicId, reputer ActorId) (alloraMath.Dec, bool, error)
- func (k *Keeper) GetPreviousTopicWeight(ctx context.Context, topicId TopicId) (alloraMath.Dec, bool, error)
- func (k *Keeper) GetReputerAddressByP2PKey(ctx context.Context, p2pKey string) (sdk.AccAddress, error)
- func (k *Keeper) GetReputerByLibp2pKey(ctx sdk.Context, reputerKey string) (types.OffchainNode, error)
- func (k *Keeper) GetReputerLossBundlesAtBlock(ctx context.Context, topicId TopicId, block BlockHeight) (*types.ReputerValueBundles, error)
- func (k *Keeper) GetReputersScoresAtBlock(ctx context.Context, topicId TopicId, block BlockHeight) (types.Scores, error)
- func (k *Keeper) GetRewardableTopics(ctx context.Context) ([]TopicId, error)
- func (k *Keeper) GetStakeFromDelegatorInTopic(ctx context.Context, topicId TopicId, delegator ActorId) (cosmosMath.Int, error)
- func (k *Keeper) GetStakeOnReputerInTopic(ctx context.Context, topicId TopicId, reputer ActorId) (cosmosMath.Int, error)
- func (k *Keeper) GetStakeRemovalByTopicAndAddress(ctx context.Context, topicId TopicId, address ActorId) (types.StakeRemoval, error)
- 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) GetTopicEpochLastEnded(ctx context.Context, topicId TopicId) (BlockHeight, error)
- func (k *Keeper) GetTopicFeeRevenue(ctx context.Context, topicId TopicId) (types.TopicFeeRevenue, 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) GetTotalRewardToDistribute(ctx context.Context) (alloraMath.Dec, error)
- func (k Keeper) GetTotalStake(ctx context.Context) (cosmosMath.Int, 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) GetWorkerAddressByP2PKey(ctx context.Context, p2pKey string) (sdk.AccAddress, error)
- func (k *Keeper) GetWorkerByLibp2pKey(ctx sdk.Context, workerKey string) (types.OffchainNode, 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) GetWorkerLatestInferenceByTopicId(ctx context.Context, topicId TopicId, worker ActorId) (types.Inference, error)
- func (k *Keeper) InactivateTopic(ctx context.Context, topicId TopicId) error
- func (k *Keeper) IncrementTopicId(ctx context.Context) (TopicId, error)
- func (k *Keeper) InitGenesis(ctx context.Context, data *types.GenesisState) error
- func (k *Keeper) InsertForecasts(ctx context.Context, topicId TopicId, nonce types.Nonce, ...) error
- func (k *Keeper) InsertInferences(ctx context.Context, topicId TopicId, nonce types.Nonce, ...) 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) InsertReputerLossBundlesAtBlock(ctx context.Context, topicId TopicId, block BlockHeight, ...) error
- func (k *Keeper) InsertReputerScore(ctx context.Context, topicId TopicId, blockNumber BlockHeight, ...) error
- func (k *Keeper) InsertWorker(ctx context.Context, topicId TopicId, worker ActorId, ...) error
- func (k *Keeper) InsertWorkerForecastScore(ctx context.Context, topicId TopicId, blockNumber BlockHeight, ...) error
- func (k *Keeper) InsertWorkerInferenceScore(ctx context.Context, topicId TopicId, blockNumber BlockHeight, ...) error
- func (k *Keeper) IsReputerNonceUnfulfilled(ctx context.Context, topicId TopicId, nonce *types.Nonce) (bool, 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) IsWhitelistAdmin(ctx context.Context, admin ActorId) (bool, error)
- func (k *Keeper) IsWorkerNonceUnfulfilled(ctx context.Context, topicId TopicId, nonce *types.Nonce) (bool, 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) PruneWorkerNonces(ctx context.Context, topicId uint64, blockHeightThreshold int64) error
- func (k *Keeper) RemoveDelegateStake(ctx context.Context, topicId TopicId, delegator ActorId, reputer ActorId, ...) error
- func (k *Keeper) RemoveReputer(ctx context.Context, topicId TopicId, reputer ActorId) error
- func (k *Keeper) RemoveRewardableTopic(ctx context.Context, topicId TopicId) error
- func (k *Keeper) RemoveStake(ctx context.Context, topicId TopicId, reputer ActorId, stake cosmosMath.Int) 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) ResetChurnableTopics(ctx context.Context) 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) 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.DelegateStakeRemoval) 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) SetInfererNetworkRegret(ctx context.Context, topicId TopicId, worker ActorId, ...) error
- func (k *Keeper) SetLatestForecasterScore(ctx context.Context, topicId TopicId, worker ActorId, score types.Score) error
- func (k *Keeper) SetLatestInfererScore(ctx context.Context, topicId TopicId, worker ActorId, score types.Score) error
- func (k *Keeper) SetLatestReputerScore(ctx context.Context, topicId TopicId, reputer ActorId, score types.Score) error
- func (k *Keeper) SetListeningCoefficient(ctx context.Context, topicId TopicId, reputer ActorId, ...) error
- func (k *Keeper) SetOneInForecasterNetworkRegret(ctx context.Context, topicId TopicId, forecaster 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) 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) SetPreviousTopicWeight(ctx context.Context, topicId TopicId, weight alloraMath.Dec) error
- func (k *Keeper) SetStakeFromDelegator(ctx context.Context, topicId TopicId, delegator ActorId, stake cosmosMath.Int) error
- func (k *Keeper) SetStakeRemoval(ctx context.Context, address ActorId, removalInfo types.StakeRemoval) 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) SetTotalStake(ctx context.Context, totalStake cosmosMath.Int) 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) ValidateStringIsBech32(actor ActorId) error
- type LibP2pKey
- type RequestId
- type RequestIndex
- type TopicId
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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 // TODO remove with genesis 2-phases refactor https://github.com/cosmos/cosmos-sdk/issues/2862 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) AccountKeeper ¶ added in v0.0.4
func (k *Keeper) AccountKeeper() AccountKeeper
SendCoinsFromModuleToModule
func (*Keeper) ActivateTopic ¶ added in v0.0.1337
Set a topic to active if the topic exists, else does nothing
func (*Keeper) AddChurnableTopic ¶ added in v0.2.6
Add as topic as churnable
func (*Keeper) AddDelegateStake ¶ added in v0.0.1337
func (*Keeper) AddReputerNonce ¶ added in v0.0.1337
func (k *Keeper) AddReputerNonce(ctx context.Context, topicId TopicId, nonce *types.Nonce, associatedWorkerNonce *types.Nonce) error
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) AddRewardableTopic ¶ added in v0.2.6
Add a topic as rewardable
func (*Keeper) AddStake ¶
func (k *Keeper) AddStake(ctx context.Context, topicId TopicId, reputer ActorId, stake cosmosMath.Int) error
Adds stake to the system for a given topic and reputer
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 incurred at a block
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) BankKeeper ¶ added in v0.0.4
func (k *Keeper) BankKeeper() BankKeeper
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) CheckCadence ¶ added in v0.2.6
Return true if the topic has met its cadence or is the first run
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) DripTopicFeeRevenue ¶ added in v0.0.1337
Drop the fee revenue by the global Ecosystem bucket drip amount
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) GetChurnableTopics ¶ added in v0.2.6
Get the churnable topics
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, additionalRevenue cosmosMath.Int, ) (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) GetDelegateStakeRemovalByTopicAndAddress ¶ added in v0.2.6
func (k *Keeper) GetDelegateStakeRemovalByTopicAndAddress(ctx context.Context, topicId TopicId, reputer ActorId, delegator ActorId) (types.DelegateStakeRemoval, error)
For a given topic id and reputer address, get their stake removal information
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 on a specific target.
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) (types.TimestampedValue, bool, error)
Returns the regret of a worker from comparing loss of worker relative to loss of other inferers Returns (0, true) if no regret is found
func (*Keeper) GetForecastsAtBlock ¶ added in v0.0.1337
func (Keeper) GetIdsOfActiveTopics ¶ added in v0.2.6
func (k Keeper) GetIdsOfActiveTopics(ctx context.Context, pagination *types.SimpleCursorPaginationRequest) ([]TopicId, *types.SimpleCursorPaginationResponse, error)
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) (types.TimestampedValue, bool, error)
Returns the regret of a worker from comparing loss of worker relative to loss of other inferers Returns (0, true) if no regret is found
func (*Keeper) GetLatestForecasterScore ¶ added in v0.2.6
func (*Keeper) GetLatestInfererScore ¶ added in v0.2.6
func (*Keeper) GetLatestReputerScore ¶ added in v0.2.6
func (*Keeper) GetListeningCoefficient ¶ 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) 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, forecaster ActorId, inferer ActorId) (types.TimestampedValue, bool, error)
Returns the regret of a worker from comparing loss of worker relative to loss of other inferers Returns (0, true) if no regret is found
func (*Keeper) GetPreviousForecastRewardFraction ¶ added in v0.0.1337
func (k *Keeper) GetPreviousForecastRewardFraction(ctx context.Context, topicId TopicId, worker ActorId) (alloraMath.Dec, bool, 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) GetPreviousInferenceRewardFraction ¶ added in v0.0.1337
func (k *Keeper) GetPreviousInferenceRewardFraction(ctx context.Context, topicId TopicId, worker ActorId) (alloraMath.Dec, bool, 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) (alloraMath.Dec, bool, 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) GetPreviousTopicWeight ¶ added in v0.0.1337
func (k *Keeper) GetPreviousTopicWeight(ctx context.Context, topicId TopicId) (alloraMath.Dec, bool, 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) GetReputerAddressByP2PKey ¶ added in v0.2.6
func (*Keeper) GetReputerByLibp2pKey ¶ added in v0.2.6
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) GetReputersScoresAtBlock ¶ added in v0.0.1337
func (*Keeper) GetRewardableTopics ¶ added in v0.2.6
Get the rewardable topics
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) GetStakeOnReputerInTopic ¶ added in v0.2.6
func (k *Keeper) GetStakeOnReputerInTopic(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) GetStakeRemovalByTopicAndAddress ¶ added in v0.2.6
func (k *Keeper) GetStakeRemovalByTopicAndAddress(ctx context.Context, topicId TopicId, address ActorId) (types.StakeRemoval, error)
For a given topic id and reputer address, get their stake removal information
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) GetTopicEpochLastEnded ¶ added in v0.2.6
func (*Keeper) GetTopicFeeRevenue ¶ added in v0.0.1337
func (k *Keeper) GetTopicFeeRevenue(ctx context.Context, topicId TopicId) (types.TopicFeeRevenue, error)
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) GetTotalRewardToDistribute ¶ added in v0.0.1337
GetTotalRewardToDistribute
func (Keeper) GetTotalStake ¶
Gets the total sum of all stake in the network across all topics
func (*Keeper) GetUnfulfilledReputerNonces ¶ added in v0.0.1337
func (*Keeper) GetUnfulfilledWorkerNonces ¶ added in v0.0.1337
func (*Keeper) GetWorkerAddressByP2PKey ¶
func (*Keeper) GetWorkerByLibp2pKey ¶ added in v0.2.6
func (*Keeper) GetWorkerForecastScoresAtBlock ¶ added in v0.0.1337
func (*Keeper) GetWorkerInferenceScoresAtBlock ¶ added in v0.0.1337
func (*Keeper) GetWorkerLatestInferenceByTopicId ¶ added in v0.0.4
func (*Keeper) InactivateTopic ¶
Set a topic to inactive if the topic exists and is active, else does nothing
func (*Keeper) IncrementTopicId ¶
Gets next topic id
func (*Keeper) InitGenesis ¶
InitGenesis initializes the module state from a genesis state.
func (*Keeper) InsertForecasts ¶ added in v0.2.6
func (k *Keeper) InsertForecasts(ctx context.Context, topicId TopicId, nonce types.Nonce, forecasts types.Forecasts) error
Insert a complete set of inferences for a topic/block. Overwrites previous ones.
func (*Keeper) InsertInferences ¶
func (k *Keeper) InsertInferences(ctx context.Context, topicId TopicId, nonce types.Nonce, inferences types.Inferences) error
Insert a complete set of inferences for a topic/block. Overwrites previous ones.
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) InsertReputerLossBundlesAtBlock ¶ added in v0.2.6
func (k *Keeper) InsertReputerLossBundlesAtBlock(ctx context.Context, topicId TopicId, block BlockHeight, reputerLossBundles types.ReputerValueBundles) error
Insert a loss bundle for a topic and timestamp. Overwrites previous ones stored at that composite index.
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) IsReputerNonceUnfulfilled ¶ added in v0.0.1337
func (k *Keeper) IsReputerNonceUnfulfilled(ctx context.Context, topicId TopicId, nonce *types.Nonce) (bool, 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
func (*Keeper) IsWhitelistAdmin ¶ added in v0.0.1
func (*Keeper) IsWorkerNonceUnfulfilled ¶ added in v0.0.1337
func (k *Keeper) IsWorkerNonceUnfulfilled(ctx context.Context, topicId TopicId, nonce *types.Nonce) (bool, 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) PruneWorkerNonces ¶ added in v0.0.1337
func (*Keeper) RemoveDelegateStake ¶ added in v0.0.1337
func (k *Keeper) RemoveDelegateStake( ctx context.Context, topicId TopicId, delegator ActorId, reputer ActorId, unStake cosmosMath.Int) error
Removes delegate stake from the system for a given topic, delegator, and reputer
func (*Keeper) RemoveReputer ¶
Remove a reputer to the reputer tracking data structures and topicReputers
func (*Keeper) RemoveRewardableTopic ¶ added in v0.2.6
func (*Keeper) RemoveStake ¶ added in v0.2.6
func (k *Keeper) RemoveStake( ctx context.Context, topicId TopicId, reputer ActorId, stake cosmosMath.Int) error
Removes stake to the system for a given topic and reputer
func (*Keeper) RemoveWhitelistAdmin ¶ added in v0.0.1
func (*Keeper) RemoveWorker ¶
Remove a worker to the worker tracking data structures and topicWorkers
func (*Keeper) ResetChurnableTopics ¶ added in v0.2.6
ResetChurnReadyTopics clears all topics from the churn-ready set and resets related states.
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) 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.DelegateStakeRemoval) 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) SetInfererNetworkRegret ¶ added in v0.0.1337
func (*Keeper) SetLatestForecasterScore ¶ added in v0.2.6
func (k *Keeper) SetLatestForecasterScore(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) SetLatestInfererScore ¶ added in v0.2.6
func (k *Keeper) SetLatestInfererScore(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) SetLatestReputerScore ¶ added in v0.2.6
func (k *Keeper) SetLatestReputerScore(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) SetListeningCoefficient ¶ added in v0.0.1337
func (*Keeper) SetOneInForecasterNetworkRegret ¶ 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) 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) 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) 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
func (k *Keeper) SetStakeRemoval(ctx context.Context, address ActorId, removalInfo types.StakeRemoval) 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) SetTopicRewardNonce ¶ added in v0.0.1337
SetTopicRewardNonce sets the reward nonce for a given topic ID.
func (*Keeper) SetTotalStake ¶
Sets the total sum of all stake in the network across all topics
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) ValidateStringIsBech32 ¶ added in v0.0.1337
type RequestIndex ¶ added in v0.2.6
type RequestIndex = uint64 // A concept completely internal to the keeper. Each request in a topic is indexed by a unique request index.