Documentation ¶
Index ¶
- Variables
- func NewMsgServerImpl(keeper Keeper) state.MsgServer
- func NewQueryServerImpl(k Keeper) state.QueryServer
- type ACC_ADDRESS
- type AccountKeeper
- type BLOCK_NUMBER
- type BankKeeper
- type DELEGATOR
- type DELEGATOR_STR
- type Int
- type Keeper
- func (k *Keeper) AccountKeeper() AccountKeeper
- func (k *Keeper) AddAddressTopics(ctx context.Context, address sdk.AccAddress, newTopics []uint64) error
- func (k *Keeper) AddStake(ctx context.Context, TopicIds []TOPIC_ID, delegator string, target string, ...) error
- func (k *Keeper) AddStakePlacedUponTarget(ctx context.Context, target sdk.AccAddress, amount Uint) error
- func (k *Keeper) AddStakePlacement(ctx context.Context, delegator sdk.AccAddress, target sdk.AccAddress, ...) error
- func (k *Keeper) AddStakeToTopics(ctx context.Context, TopicIds []TOPIC_ID, stake Uint) error
- func (k *Keeper) AddToMempool(ctx context.Context, request state.InferenceRequest) error
- func (k *Keeper) AddToTopicCreationWhitelist(ctx context.Context, address sdk.AccAddress) error
- func (k *Keeper) AddToWeightSettingWhitelist(ctx context.Context, address sdk.AccAddress) error
- func (k *Keeper) AddTopicAccumulateMetDemand(ctx context.Context, topicId TOPIC_ID, metDemand Uint) error
- func (k *Keeper) AddUnmetDemand(ctx context.Context, topicId TOPIC_ID, amt cosmosMath.Uint) error
- func (k *Keeper) AddWhitelistAdmin(ctx context.Context, admin sdk.AccAddress) error
- func (k *Keeper) BankKeeper() BankKeeper
- func (k *Keeper) ExportGenesis(ctx context.Context) (*state.GenesisState, error)
- func (k *Keeper) FindWorkerNodesByOwner(ctx sdk.Context, nodeId string) ([]*state.OffchainNode, error)
- func (k *Keeper) GetActiveTopics(ctx context.Context) ([]*state.Topic, error)
- func (k *Keeper) GetAllBondsForDelegator(ctx context.Context, delegator sdk.AccAddress) ([]sdk.AccAddress, []Uint, error)
- func (k *Keeper) GetAllInferences(ctx context.Context, topicId TOPIC_ID, timestamp uint64) (*state.Inferences, error)
- func (k *Keeper) GetAllTopics(ctx context.Context) ([]*state.Topic, error)
- func (k *Keeper) GetBond(ctx context.Context, delegator sdk.AccAddress, target sdk.AccAddress) (Uint, error)
- func (k *Keeper) GetChurnReadyTopics(ctx context.Context) (state.TopicList, error)
- func (k *Keeper) GetDelegatorStake(ctx context.Context, delegator sdk.AccAddress) (Uint, error)
- func (k *Keeper) GetFeeCollectorName() string
- func (k *Keeper) GetLastRewardsUpdate(ctx context.Context) (int64, error)
- func (k *Keeper) GetLatestInferencesFromTopic(ctx context.Context, topicId TOPIC_ID) ([]*state.InferenceSetForScoring, error)
- func (k *Keeper) GetMempool(ctx context.Context) ([]state.InferenceRequest, error)
- func (k *Keeper) GetMempoolInferenceRequestById(ctx context.Context, topicId TOPIC_ID, requestId string) (state.InferenceRequest, error)
- func (k *Keeper) GetMempoolInferenceRequestsForTopic(ctx context.Context, topicId TOPIC_ID) ([]state.InferenceRequest, error)
- func (k *Keeper) GetNumInferencesInRewardEpoch(ctx context.Context, topicId TOPIC_ID, worker sdk.AccAddress) (Uint, error)
- func (k *Keeper) GetNumTopics(ctx context.Context) (TOPIC_ID, error)
- func (k *Keeper) GetParams(ctx context.Context) (state.Params, error)
- func (k *Keeper) GetParamsEpochLength(ctx context.Context) (int64, error)
- func (k *Keeper) GetParamsMaxInferenceRequestValidity(ctx context.Context) (uint64, error)
- func (k *Keeper) GetParamsMaxMissingInferencePercent(ctx context.Context) (cosmosMath.LegacyDec, error)
- func (k *Keeper) GetParamsMaxRequestCadence(ctx context.Context) (uint64, error)
- func (k *Keeper) GetParamsMaxTopicsPerBlock(ctx context.Context) (uint64, error)
- func (k *Keeper) GetParamsMinRequestCadence(ctx context.Context) (uint64, error)
- func (k *Keeper) GetParamsMinRequestUnmetDemand(ctx context.Context) (Uint, error)
- func (k *Keeper) GetParamsMinTopicUnmetDemand(ctx context.Context) (Uint, error)
- func (k *Keeper) GetParamsMinWeightCadence(ctx context.Context) (uint64, error)
- func (k *Keeper) GetParamsPercentRewardsReputersWorkers(ctx context.Context) (cosmosMath.LegacyDec, error)
- func (k *Keeper) GetParamsRemoveStakeDelayWindow(ctx context.Context) (uint64, error)
- func (k *Keeper) GetParamsRequiredMinimumStake(ctx context.Context) (Uint, error)
- func (k *Keeper) GetRegisteredTopicIdByReputerAddress(ctx context.Context, address sdk.AccAddress) ([]uint64, error)
- func (k *Keeper) GetRegisteredTopicIdsByAddress(ctx context.Context, address sdk.AccAddress) ([]uint64, error)
- func (k *Keeper) GetRegisteredTopicIdsByWorkerAddress(ctx context.Context, address sdk.AccAddress) ([]uint64, error)
- func (k *Keeper) GetReputerNormalizedStake(ctx sdk.Context, topicId TOPIC_ID, topicStake *big.Float) (reputerNormalizedStakeMap map[ACC_ADDRESS]*big.Float, retErr error)
- func (k *Keeper) GetRequestDemand(ctx context.Context, requestId string) (Uint, error)
- func (k *Keeper) GetStakePlacedUponTarget(ctx context.Context, target sdk.AccAddress) (Uint, error)
- func (k *Keeper) GetStakeRemovalQueueForDelegator(ctx context.Context, delegator sdk.AccAddress) (state.StakeRemoval, error)
- func (k *Keeper) GetStakesForAccount(ctx context.Context, delegator sdk.AccAddress) ([]*state.StakeInfo, error)
- func (k *Keeper) GetTopic(ctx context.Context, topicId TOPIC_ID) (state.Topic, error)
- func (k *Keeper) GetTopicAccumulatedMetDemand(ctx context.Context, topicId TOPIC_ID) (Uint, error)
- func (k *Keeper) GetTopicInferenceLastRan(ctx context.Context, topicId TOPIC_ID) (lastRanTime uint64, err error)
- func (k *Keeper) GetTopicStake(ctx context.Context, topicId TOPIC_ID) (Uint, error)
- func (k *Keeper) GetTopicUnmetDemand(ctx context.Context, topicId TOPIC_ID) (Uint, error)
- func (k *Keeper) GetTopicWeightLastRan(ctx context.Context, topicId TOPIC_ID) (uint64, error)
- func (k *Keeper) GetTopicsByCreator(ctx context.Context, creator string) ([]*state.Topic, error)
- func (k *Keeper) GetTotalStake(ctx context.Context) (Uint, error)
- func (k *Keeper) GetWeightsFromTopic(ctx context.Context, topicId TOPIC_ID) (map[REPUTERS]map[WORKERS]*Uint, error)
- func (k *Keeper) GetWorkerAddressByP2PKey(ctx context.Context, p2pKey string) (sdk.AccAddress, error)
- func (k *Keeper) GetWorkerLatestInferenceByTopicId(ctx context.Context, topicId TOPIC_ID, worker sdk.AccAddress) (state.Inference, error)
- func (k *Keeper) InactivateTopic(ctx context.Context, topicId TOPIC_ID) error
- func (k *Keeper) IncrementNumInferencesInRewardEpoch(ctx context.Context, topicId TOPIC_ID, worker sdk.AccAddress) error
- func (k *Keeper) IncrementTopicId(ctx context.Context) (TOPIC_ID, error)
- func (k *Keeper) InitGenesis(ctx context.Context, data *state.GenesisState) error
- func (k *Keeper) InsertInferences(ctx context.Context, topicId TOPIC_ID, timestamp uint64, ...) error
- func (k *Keeper) InsertReputer(ctx context.Context, TopicIds []TOPIC_ID, reputer sdk.AccAddress, ...) error
- func (k *Keeper) InsertWorker(ctx context.Context, TopicIds []TOPIC_ID, worker sdk.AccAddress, ...) error
- func (k *Keeper) IsInTopicCreationWhitelist(ctx context.Context, address sdk.AccAddress) (bool, error)
- func (k *Keeper) IsInWeightSettingWhitelist(ctx context.Context, address sdk.AccAddress) (bool, error)
- func (k *Keeper) IsRequestInMempool(ctx context.Context, topicId TOPIC_ID, requestId string) (bool, error)
- func (k *Keeper) IsWhitelistAdmin(ctx context.Context, admin sdk.AccAddress) (bool, error)
- func (k *Keeper) IterateAllTopicStake(ctx context.Context) (collections.Iterator[uint64, cosmosMath.Uint], error)
- func (k *Keeper) ReactivateTopic(ctx context.Context, topicId TOPIC_ID) error
- func (k *Keeper) RemoveAddressTopic(ctx context.Context, address sdk.AccAddress, topicToRemove uint64) error
- func (k *Keeper) RemoveFromMempool(ctx context.Context, request state.InferenceRequest) error
- func (k *Keeper) RemoveFromTopicCreationWhitelist(ctx context.Context, address sdk.AccAddress) error
- func (k *Keeper) RemoveFromWeightSettingWhitelist(ctx context.Context, address sdk.AccAddress) error
- func (k *Keeper) RemoveReputer(ctx context.Context, topicId TOPIC_ID, reputerAddr sdk.AccAddress) error
- func (k *Keeper) RemoveStakeFromBond(ctx context.Context, TopicIds []TOPIC_ID, delegator sdk.AccAddress, ...) error
- func (k *Keeper) RemoveStakeFromBondMissingTotalOrTopicStake(ctx context.Context, delegator sdk.AccAddress, target sdk.AccAddress, ...) error
- func (k *Keeper) RemoveStakeFromTopics(ctx context.Context, TopicIds []TOPIC_ID, stake Uint) error
- func (k *Keeper) RemoveUnmetDemand(ctx context.Context, topicId TOPIC_ID, amt cosmosMath.Uint) error
- func (k *Keeper) RemoveWhitelistAdmin(ctx context.Context, admin sdk.AccAddress) error
- func (k *Keeper) RemoveWorker(ctx context.Context, topicId TOPIC_ID, workerAddr sdk.AccAddress) error
- func (k *Keeper) ResetChurnReadyTopics(ctx context.Context) error
- func (k *Keeper) ResetNumInferencesInRewardEpoch(ctx context.Context) error
- func (k *Keeper) SetChurnReadyTopics(ctx context.Context, topicList state.TopicList) error
- func (k *Keeper) SetLastRewardsUpdate(ctx context.Context, blockHeight int64) error
- func (k *Keeper) SetParams(ctx context.Context, params state.Params) error
- func (k *Keeper) SetRequestDemand(ctx context.Context, requestId string, amount Uint) error
- func (k *Keeper) SetStakePlacedUponTarget(ctx context.Context, target sdk.AccAddress, stake Uint) error
- func (k *Keeper) SetStakeRemovalQueueForDelegator(ctx context.Context, delegator sdk.AccAddress, removalInfo state.StakeRemoval) error
- func (k *Keeper) SetTopic(ctx context.Context, topicId TOPIC_ID, topic state.Topic) error
- func (k *Keeper) SetTopicAccumulatedMetDemand(ctx context.Context, topicId TOPIC_ID, metDemand Uint) error
- func (k *Keeper) SetTopicStake(ctx context.Context, topicId TOPIC_ID, stake Uint) error
- func (k *Keeper) SetTopicUnmetDemand(ctx context.Context, topicId TOPIC_ID, amt cosmosMath.Uint) error
- func (k *Keeper) SetTotalStake(ctx context.Context, totalStake Uint) error
- func (k *Keeper) SetWeight(ctx context.Context, topicId TOPIC_ID, reputer sdk.AccAddress, ...) error
- func (k *Keeper) SubStakePlacedUponTarget(ctx context.Context, target sdk.AccAddress, amount Uint) error
- func (k *Keeper) SubStakePlacement(ctx context.Context, delegator sdk.AccAddress, target sdk.AccAddress, ...) error
- func (k *Keeper) TopicExists(ctx context.Context, topicId TOPIC_ID) (bool, error)
- func (k *Keeper) UpdateTopicInferenceLastRan(ctx context.Context, topicId TOPIC_ID, lastRanTime uint64) error
- func (k *Keeper) UpdateTopicWeightLastRan(ctx context.Context, topicId TOPIC_ID, lastRanTime uint64) error
- func (k *Keeper) WalkAllTopicStake(ctx context.Context, ...) error
- type LIB_P2P_KEY
- type REPUTERS
- type REQUEST_ID
- type TARGET
- type TARGET_STR
- type TOPIC_ID
- type UNIX_TIMESTAMP
- type Uint
- type WORKERS
Constants ¶
This section is empty.
Variables ¶
var TopicIdListValue collcodec.ValueCodec[[]uint64] = topicIdListValueCodec{}
var UintValue collcodec.ValueCodec[cosmosMath.Uint] = uintValueCodec{}
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the module MsgServer interface.
func NewQueryServerImpl ¶
func NewQueryServerImpl(k Keeper) state.QueryServer
NewQueryServerImpl returns an implementation of the module QueryServer.
Types ¶
type ACC_ADDRESS ¶
type ACC_ADDRESS = string
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 BLOCK_NUMBER ¶
type BLOCK_NUMBER = int64
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 DELEGATOR ¶
type DELEGATOR = sdk.AccAddress
type DELEGATOR_STR ¶
type DELEGATOR_STR = string
type Int ¶
type Int = cosmosMath.Int
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, addressCodec address.Codec, storeService storetypes.KVStoreService, ak AccountKeeper, bk BankKeeper, feeCollectorName string) Keeper
func (*Keeper) AccountKeeper ¶ added in v0.0.4
func (k *Keeper) AccountKeeper() AccountKeeper
func (*Keeper) AddAddressTopics ¶
func (k *Keeper) AddAddressTopics(ctx context.Context, address sdk.AccAddress, newTopics []uint64) error
AddAddressTopics adds new topics to the address's list of topics, avoiding duplicates.
func (*Keeper) AddStake ¶
func (k *Keeper) AddStake(ctx context.Context, TopicIds []TOPIC_ID, delegator string, target string, stake Uint) error
Add stake adds stake to the system for a given delegator and target it adds to existing holdings. it places the stake upon target, from delegator, in amount. it also updates the total stake for the subnet in question and the total global stake. see comments in keeper.go data structures for examples of how the data structure tracking works
func (*Keeper) AddStakePlacedUponTarget ¶
func (k *Keeper) AddStakePlacedUponTarget(ctx context.Context, target sdk.AccAddress, amount Uint) error
Used by Modify functions to change stake placements. This function adds to the stakePlacedUponTarget mapping ONLY and does not modify any of the other stake mappings e.g. delegatorStake totalStake or topicStake in a system.
func (*Keeper) AddStakePlacement ¶
func (k *Keeper) AddStakePlacement(ctx context.Context, delegator sdk.AccAddress, target sdk.AccAddress, amount Uint) error
Used by Modify functions to change stake placements. This function adds to the stakePlacement mapping ONLY and does not modify any of the other stake mappings e.g. delegatorStake totalStake or topicStake in a system.
func (*Keeper) AddStakeToTopics ¶
Add stake into an array of topics
func (*Keeper) AddToMempool ¶
func (*Keeper) AddToTopicCreationWhitelist ¶ added in v0.0.1
func (*Keeper) AddToWeightSettingWhitelist ¶ added in v0.0.1
func (*Keeper) AddTopicAccumulateMetDemand ¶
func (*Keeper) AddUnmetDemand ¶
func (*Keeper) AddWhitelistAdmin ¶ added in v0.0.1
func (*Keeper) BankKeeper ¶ added in v0.0.4
func (k *Keeper) BankKeeper() BankKeeper
func (*Keeper) ExportGenesis ¶
ExportGenesis exports the module state to a genesis state.
func (*Keeper) FindWorkerNodesByOwner ¶
func (*Keeper) GetActiveTopics ¶
GetActiveTopics returns a slice of all active topics.
func (*Keeper) GetAllBondsForDelegator ¶
func (k *Keeper) GetAllBondsForDelegator(ctx context.Context, delegator sdk.AccAddress) ([]sdk.AccAddress, []Uint, error)
For a given delegator, return a map of every target they've placed stake upon, and how much stake they've placed upon them O(n) over the number of targets registered. since maps of byte array types aren't supported in golang, we instead return two equal length arrays where the first array is the targets, and the second array is the amount of stake placed upon them indexes in the two arrays correspond to each other invariant that len(targets) == len(stakes)
func (*Keeper) GetAllInferences ¶
func (*Keeper) GetAllTopics ¶ added in v0.0.4
Gets every topic
func (*Keeper) GetBond ¶
func (k *Keeper) GetBond(ctx context.Context, delegator sdk.AccAddress, target sdk.AccAddress) (Uint, error)
For a given delegator and target, find out how much stake the delegator has placed upon the target
func (*Keeper) GetChurnReadyTopics ¶ added in v0.0.4
Get all churn ready topics
func (*Keeper) GetDelegatorStake ¶
for a given address, find out how much stake they've put into the system
func (*Keeper) GetFeeCollectorName ¶ added in v0.0.4
func (*Keeper) GetLastRewardsUpdate ¶
Returns the last block height at which rewards emissions were updated
func (*Keeper) GetLatestInferencesFromTopic ¶
func (k *Keeper) GetLatestInferencesFromTopic(ctx context.Context, topicId TOPIC_ID) ([]*state.InferenceSetForScoring, error)
A function that accepts a topicId and returns list of Inferences or error
func (*Keeper) GetMempool ¶
func (*Keeper) GetMempoolInferenceRequestById ¶
func (*Keeper) GetMempoolInferenceRequestsForTopic ¶
func (*Keeper) GetNumInferencesInRewardEpoch ¶ added in v0.0.1
func (*Keeper) GetNumTopics ¶
Returns the number of topics that are active in the network
func (*Keeper) GetParamsEpochLength ¶ added in v0.0.4
return epoch length
func (*Keeper) GetParamsMaxInferenceRequestValidity ¶ added in v0.0.4
func (*Keeper) GetParamsMaxMissingInferencePercent ¶ added in v0.0.4
func (*Keeper) GetParamsMaxRequestCadence ¶ added in v0.0.4
func (*Keeper) GetParamsMaxTopicsPerBlock ¶ added in v0.0.4
func (*Keeper) GetParamsMinRequestCadence ¶ added in v0.0.4
func (*Keeper) GetParamsMinRequestUnmetDemand ¶ added in v0.0.4
func (*Keeper) GetParamsMinTopicUnmetDemand ¶ added in v0.0.4
func (*Keeper) GetParamsMinWeightCadence ¶ added in v0.0.4
func (*Keeper) GetParamsPercentRewardsReputersWorkers ¶ added in v0.0.4
func (*Keeper) GetParamsRemoveStakeDelayWindow ¶ added in v0.0.4
func (*Keeper) GetParamsRequiredMinimumStake ¶ added in v0.0.4
func (*Keeper) GetRegisteredTopicIdByReputerAddress ¶ added in v0.0.4
func (k *Keeper) GetRegisteredTopicIdByReputerAddress(ctx context.Context, address sdk.AccAddress) ([]uint64, error)
GetRegisteredTopicIdByReputerAddress returns a slice of all topics ids registered by a given reputer address.
func (*Keeper) GetRegisteredTopicIdsByAddress ¶ added in v0.0.4
func (k *Keeper) GetRegisteredTopicIdsByAddress(ctx context.Context, address sdk.AccAddress) ([]uint64, error)
GetRegisteredTopicsByAddress returns a slice of all topics ids registered by a given address.
func (*Keeper) GetRegisteredTopicIdsByWorkerAddress ¶ added in v0.0.4
func (k *Keeper) GetRegisteredTopicIdsByWorkerAddress(ctx context.Context, address sdk.AccAddress) ([]uint64, error)
GetRegisteredTopicIdsByWorkerAddress returns a slice of all topics ids registered by a given worker address.
func (*Keeper) GetReputerNormalizedStake ¶
func (k *Keeper) GetReputerNormalizedStake( ctx sdk.Context, topicId TOPIC_ID, topicStake *big.Float) (reputerNormalizedStakeMap map[ACC_ADDRESS]*big.Float, retErr error)
for a given topic, returns every reputer node registered to it and their normalized stake
func (*Keeper) GetRequestDemand ¶
func (*Keeper) GetStakePlacedUponTarget ¶
func (*Keeper) GetStakeRemovalQueueForDelegator ¶
func (k *Keeper) GetStakeRemovalQueueForDelegator(ctx context.Context, delegator sdk.AccAddress) (state.StakeRemoval, error)
for a given delegator, get their stake removal information
func (*Keeper) GetStakesForAccount ¶
func (k *Keeper) GetStakesForAccount(ctx context.Context, delegator sdk.AccAddress) ([]*state.StakeInfo, error)
GetStakesForAccount returns the list of stakes for a given account address.
func (*Keeper) GetTopicAccumulatedMetDemand ¶
func (*Keeper) GetTopicInferenceLastRan ¶
func (k *Keeper) GetTopicInferenceLastRan(ctx context.Context, topicId TOPIC_ID) (lastRanTime uint64, err error)
Get the last time an inference was ran for a given topic
func (*Keeper) GetTopicStake ¶
Gets the stake in the network for a given topic
func (*Keeper) GetTopicUnmetDemand ¶
func (*Keeper) GetTopicWeightLastRan ¶
func (*Keeper) GetTopicsByCreator ¶
GetTopicsByCreator returns a slice of all topics created by a given creator.
func (*Keeper) GetTotalStake ¶
Gets the total sum of all stake in the network across all topics
func (*Keeper) GetWeightsFromTopic ¶
func (k *Keeper) GetWeightsFromTopic(ctx context.Context, topicId TOPIC_ID) (map[REPUTERS]map[WORKERS]*Uint, error)
For a given topic return the matrix (double map) of all (reputers, workers) -> weight of reputer upon worker
func (*Keeper) GetWorkerAddressByP2PKey ¶
func (*Keeper) GetWorkerLatestInferenceByTopicId ¶ added in v0.0.4
func (*Keeper) InactivateTopic ¶
func (*Keeper) IncrementNumInferencesInRewardEpoch ¶ added in v0.0.1
func (*Keeper) IncrementTopicId ¶
Gets next topic id
func (*Keeper) InitGenesis ¶
InitGenesis initializes the module state from a genesis state.
func (*Keeper) InsertInferences ¶
func (k *Keeper) InsertInferences(ctx context.Context, topicId TOPIC_ID, timestamp uint64, inferences state.Inferences) error
Insert a complete set of inferences for a topic/timestamp. Overwrites previous ones.
func (*Keeper) InsertReputer ¶
func (k *Keeper) InsertReputer(ctx context.Context, TopicIds []TOPIC_ID, reputer sdk.AccAddress, reputerInfo state.OffchainNode) error
Adds a new reputer to the reputer tracking data structures, reputers and topicReputers
func (*Keeper) InsertWorker ¶
func (k *Keeper) InsertWorker(ctx context.Context, TopicIds []TOPIC_ID, worker sdk.AccAddress, workerInfo state.OffchainNode) error
Adds a new worker to the worker tracking data structures, workers and topicWorkers
func (*Keeper) IsInTopicCreationWhitelist ¶ added in v0.0.1
func (*Keeper) IsInWeightSettingWhitelist ¶ added in v0.0.1
func (*Keeper) IsRequestInMempool ¶
func (*Keeper) IsWhitelistAdmin ¶ added in v0.0.1
func (*Keeper) IterateAllTopicStake ¶
func (k *Keeper) IterateAllTopicStake(ctx context.Context) (collections.Iterator[uint64, cosmosMath.Uint], error)
func (*Keeper) ReactivateTopic ¶ added in v0.0.1
func (*Keeper) RemoveAddressTopic ¶
func (k *Keeper) RemoveAddressTopic(ctx context.Context, address sdk.AccAddress, topicToRemove uint64) error
RemoveAddressTopic removes a specified topic from the address's list of topics.
func (*Keeper) RemoveFromMempool ¶
func (*Keeper) RemoveFromTopicCreationWhitelist ¶ added in v0.0.1
func (*Keeper) RemoveFromWeightSettingWhitelist ¶ added in v0.0.1
func (*Keeper) RemoveReputer ¶
func (k *Keeper) RemoveReputer(ctx context.Context, topicId TOPIC_ID, reputerAddr sdk.AccAddress) error
Remove a reputer to the reputer tracking data structures and topicReputers
func (*Keeper) RemoveStakeFromBond ¶
func (k *Keeper) RemoveStakeFromBond( ctx context.Context, TopicIds []TOPIC_ID, delegator sdk.AccAddress, target sdk.AccAddress, stake Uint) error
Remove stake from bond updates the various data structures associated with removing stake from the system for a given delegator and target it removes the stake upon target, from delegator, in amount. it also updates the total stake for the topic in question and the total global stake. see comments in keeper.go data structures for examples of how the data structure tracking works
func (*Keeper) RemoveStakeFromBondMissingTotalOrTopicStake ¶
func (k *Keeper) RemoveStakeFromBondMissingTotalOrTopicStake( ctx context.Context, delegator sdk.AccAddress, target sdk.AccAddress, stake Uint) error
Remove stake from bond updates the various data structures associated with removing stake from the system for a given delegator and target it removes the stake upon target, from delegator, in amount. it *DOES NOT* update the total stake for the subnet in question and the total global stake. this is used by RemoveAllStake to avoid double counting the topic/total stake removal
func (*Keeper) RemoveStakeFromTopics ¶
Remove stake from an array of topics
func (*Keeper) RemoveUnmetDemand ¶
func (*Keeper) RemoveWhitelistAdmin ¶ added in v0.0.1
func (*Keeper) RemoveWorker ¶
func (k *Keeper) RemoveWorker(ctx context.Context, topicId TOPIC_ID, workerAddr sdk.AccAddress) error
Remove a worker to the worker tracking data structures and topicWorkers
func (*Keeper) ResetChurnReadyTopics ¶ added in v0.0.4
Reset the mapping entirely. Should be called at the end of every block
func (*Keeper) ResetNumInferencesInRewardEpoch ¶ added in v0.0.1
Reset the mapping entirely. Should be called at the end of every reward epoch
func (*Keeper) SetChurnReadyTopics ¶ added in v0.0.4
Set a topic as churn ready
func (*Keeper) SetLastRewardsUpdate ¶
Set the last block height at which rewards emissions were updated
func (*Keeper) SetRequestDemand ¶
func (*Keeper) SetStakePlacedUponTarget ¶
func (*Keeper) SetStakeRemovalQueueForDelegator ¶
func (k *Keeper) SetStakeRemovalQueueForDelegator(ctx context.Context, delegator sdk.AccAddress, removalInfo state.StakeRemoval) error
For a given delegator, adds their stake removal information to the removal queue for delay waiting
func (*Keeper) SetTopicAccumulatedMetDemand ¶
func (*Keeper) SetTopicStake ¶
Sets the stake in the network for a given topic
func (*Keeper) SetTopicUnmetDemand ¶
func (*Keeper) SetTotalStake ¶
Sets the total sum of all stake in the network across all topics
func (*Keeper) SetWeight ¶
func (k *Keeper) SetWeight( ctx context.Context, topicId TOPIC_ID, reputer sdk.AccAddress, worker sdk.AccAddress, weight Uint) error
func (*Keeper) SubStakePlacedUponTarget ¶
func (k *Keeper) SubStakePlacedUponTarget(ctx context.Context, target sdk.AccAddress, amount Uint) error
Used by Modify functions to change stake placements. This function subtracts from the stakePlacedUponTarget mapping ONLY and does not modify any of the other stake mappings e.g. delegatorStake totalStake or topicStake in a system.
func (*Keeper) SubStakePlacement ¶
func (k *Keeper) SubStakePlacement(ctx context.Context, delegator sdk.AccAddress, target sdk.AccAddress, amount Uint) error
Used by Modify functions to change stake placements. This function subtracts from the stakePlacement mapping ONLY and does not modify any of the other stake mappings e.g. delegatorStake totalStake or topicStake in a system.
func (*Keeper) TopicExists ¶
Checks if a topic exists
func (*Keeper) UpdateTopicInferenceLastRan ¶
func (k *Keeper) UpdateTopicInferenceLastRan(ctx context.Context, topicId TOPIC_ID, lastRanTime uint64) error
UpdateTopicInferenceLastRan updates the InferenceLastRan timestamp for a given topic.
type LIB_P2P_KEY ¶
type LIB_P2P_KEY = string
type REQUEST_ID ¶
type REQUEST_ID = string
type TARGET ¶
type TARGET = sdk.AccAddress
type TARGET_STR ¶
type TARGET_STR = string
type UNIX_TIMESTAMP ¶
type UNIX_TIMESTAMP = uint64
type Uint ¶
type Uint = cosmosMath.Uint