Documentation
¶
Index ¶
- Constants
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type Keeper
- func (k Keeper) AddEpochPayment(ctx sdk.Context, chainID string, epoch uint64, userAddress sdk.AccAddress, ...) (uint64, error)
- func (k Keeper) AddProviderPaymentInEpoch(ctx sdk.Context, chainID string, epoch uint64, userAddress sdk.AccAddress, ...) (userPayment *types.ProviderPaymentStorage, usedCUConsumerTotal uint64, ...)
- func (k Keeper) AddUniquePaymentStorageClientProvider(ctx sdk.Context, chainID string, block uint64, userAddress sdk.AccAddress, ...) (isUnique bool, entryAddr *types.UniquePaymentStorageClientProvider)
- func (k Keeper) BailEntry(ctx sdk.Context, account sdk.AccAddress, isProvider bool, chainID string, ...) error
- func (k Keeper) BurnClientStake(ctx sdk.Context, chainID string, clientAddressToBurn sdk.AccAddress, ...) (bool, error)
- func (k Keeper) BurnCoinsPerCU(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) CheckUnstakingForCommit(ctx sdk.Context) error
- func (k Keeper) ClientMaxCUProviderForBlock(ctx sdk.Context, blockHeight uint64, clientEntry *epochstoragetypes.StakeEntry) (uint64, error)
- func (k Keeper) Clients(goCtx context.Context, req *types.QueryClientsRequest) (*types.QueryClientsResponse, error)
- func (k Keeper) CreditStakeEntry(ctx sdk.Context, chainID string, lookUpAddress sdk.AccAddress, ...) (bool, error)
- func (k Keeper) DataReliabilityReward(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) EncodeUniquePaymentKey(ctx sdk.Context, userAddress sdk.AccAddress, providerAddress sdk.AccAddress, ...) string
- func (k Keeper) EnforceClientCUsUsageInEpoch(ctx sdk.Context, cuSum uint64, allowedCU uint64, ...) error
- func (k Keeper) EpochBlocksOverlap(ctx sdk.Context) (res uint64)
- func (k Keeper) EpochPayments(c context.Context, req *types.QueryGetEpochPaymentsRequest) (*types.QueryGetEpochPaymentsResponse, error)
- func (k Keeper) EpochPaymentsAll(c context.Context, req *types.QueryAllEpochPaymentsRequest) (*types.QueryAllEpochPaymentsResponse, error)
- func (k Keeper) EpochStart(ctx sdk.Context, epochsNumToCheckCuForUnresponsiveProvider uint64, ...)
- func (k Keeper) FraudSlashingAmount(ctx sdk.Context) (res uint64)
- func (k Keeper) FraudStakeSlashingFactor(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) FreezeProvider(ctx sdk.Context, provider string, chainIDs []string, reason string) error
- func (k Keeper) GetAllEpochPayments(ctx sdk.Context) (list []types.EpochPayments)
- func (k Keeper) GetAllProviderPaymentStorage(ctx sdk.Context) (list []types.ProviderPaymentStorage)
- func (k Keeper) GetAllUniquePaymentStorageClientProvider(ctx sdk.Context) (list []types.UniquePaymentStorageClientProvider)
- func (k Keeper) GetAllowedCUForBlock(ctx sdk.Context, blockHeight uint64, entry *epochstoragetypes.StakeEntry) (uint64, error)
- func (k Keeper) GetConsumerFromUniquePayment(uniquePaymentStorageClientProvider *types.UniquePaymentStorageClientProvider) string
- func (k Keeper) GetEpochPayments(ctx sdk.Context, index string) (val types.EpochPayments, found bool)
- func (k Keeper) GetEpochPaymentsFromBlock(ctx sdk.Context, epoch uint64) (epochPayment types.EpochPayments, found bool, key string)
- func (k Keeper) GetPairing(goCtx context.Context, req *types.QueryGetPairingRequest) (*types.QueryGetPairingResponse, error)
- func (k Keeper) GetPairingForClient(ctx sdk.Context, chainID string, clientAddress sdk.AccAddress) (providers []epochstoragetypes.StakeEntry, errorRet error)
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k Keeper) GetProjectData(ctx sdk.Context, developerKey sdk.AccAddress, chainID string, ...) (proj projectstypes.Project, vrfpk string, errRet error)
- func (k Keeper) GetProviderPaymentStorage(ctx sdk.Context, index string) (val types.ProviderPaymentStorage, found bool)
- func (k Keeper) GetProviderPaymentStorageKey(ctx sdk.Context, chainID string, epoch uint64, providerAddress sdk.AccAddress) string
- func (k Keeper) GetTotalUsedCUForConsumerPerEpoch(ctx sdk.Context, consumerAddress string, uniquePaymentStorageKeys []string, ...) (uint64, error)
- func (k Keeper) GetUniquePaymentStorageClientProvider(ctx sdk.Context, index string) (val types.UniquePaymentStorageClientProvider, found bool)
- func (k Keeper) IsEpochStart(ctx sdk.Context) (res bool)
- func (k Keeper) JailEntry(ctx sdk.Context, account sdk.AccAddress, isProvider bool, chainID string, ...) error
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MintCoinsPerCU(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) ProviderPaymentStorage(c context.Context, req *types.QueryGetProviderPaymentStorageRequest) (*types.QueryGetProviderPaymentStorageResponse, error)
- func (k Keeper) ProviderPaymentStorageAll(c context.Context, req *types.QueryAllProviderPaymentStorageRequest) (*types.QueryAllProviderPaymentStorageResponse, error)
- func (k Keeper) Providers(goCtx context.Context, req *types.QueryProvidersRequest) (*types.QueryProvidersResponse, error)
- func (k Keeper) QoSWeight(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) RecommendedEpochNumToCollectPayment(ctx sdk.Context) (res uint64)
- func (k Keeper) RemoveAllEpochPaymentsForBlock(ctx sdk.Context, blockForDelete uint64) error
- func (k Keeper) RemoveEpochPayments(ctx sdk.Context, index string)
- func (k Keeper) RemoveOldEpochPayment(ctx sdk.Context) (err error)
- func (k Keeper) RemoveProviderPaymentStorage(ctx sdk.Context, index string)
- func (k Keeper) RemoveUniquePaymentStorageClientProvider(ctx sdk.Context, index string)
- func (k Keeper) ServicersToPairCount(ctx sdk.Context, block uint64) (res uint64, err error)
- func (k Keeper) ServicersToPairCountRaw(ctx sdk.Context) (res uint64)
- func (k Keeper) SetEpochPayments(ctx sdk.Context, epochPayments types.EpochPayments)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetProviderPaymentStorage(ctx sdk.Context, providerPaymentStorage types.ProviderPaymentStorage)
- func (k Keeper) SetRecommendedEpochNumToCollectPayment(ctx sdk.Context, val uint64)
- func (k Keeper) SetUniquePaymentStorageClientProvider(ctx sdk.Context, ...)
- func (k Keeper) SlashEntry(ctx sdk.Context, account sdk.AccAddress, isProvider bool, chainID string, ...) (sdk.Coin, error)
- func (k Keeper) SlashLimit(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) StakeNewEntry(ctx sdk.Context, provider bool, creator string, chainID string, ...) error
- func (k Keeper) StakeToMaxCUList(ctx sdk.Context, block uint64) (res types.StakeToMaxCUList, err error)
- func (k Keeper) StakeToMaxCUListRaw(ctx sdk.Context) (res types.StakeToMaxCUList)
- func (k Keeper) StaticProvidersList(goCtx context.Context, req *types.QueryStaticProvidersListRequest) (*types.QueryStaticProvidersListResponse, error)
- func (k Keeper) UniquePaymentStorageClientProvider(c context.Context, ...) (*types.QueryGetUniquePaymentStorageClientProviderResponse, error)
- func (k Keeper) UniquePaymentStorageClientProviderAll(c context.Context, ...) (*types.QueryAllUniquePaymentStorageClientProviderResponse, error)
- func (k Keeper) UnpayLimit(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) UnstakeEntry(ctx sdk.Context, provider bool, chainID string, creator string, ...) error
- func (k Keeper) UnstakeUnresponsiveProviders(ctx sdk.Context, epochsNumToCheckCUForUnresponsiveProvider uint64, ...) error
- func (k Keeper) UserEntry(goCtx context.Context, req *types.QueryUserEntryRequest) (*types.QueryUserEntryResponse, error)
- func (k Keeper) ValidatePairingForClient(ctx sdk.Context, chainID string, clientAddress sdk.AccAddress, ...) (isValidPairing bool, vrfk string, foundIndex int, allowedCU uint64, ...)
- func (k Keeper) VerifyClientStake(ctx sdk.Context, chainID string, clientAddress sdk.Address, block uint64, ...) (clientStakeEntryRet *epochstoragetypes.StakeEntry, errorRet error)
- func (k Keeper) VerifyPairing(goCtx context.Context, req *types.QueryVerifyPairingRequest) (*types.QueryVerifyPairingResponse, error)
- func (k Keeper) VerifyPairingData(ctx sdk.Context, chainID string, clientAddress sdk.AccAddress, block uint64) (epoch uint64, errorRet error)
- type VRFKey
Constants ¶
const ( EPOCH_BLOCK_DIVIDER uint64 = 5 // determines how many blocks from the previous epoch will be included in the average block time calculation MIN_SAMPLE_STEP uint64 = 1 // the minimal sample step when calculating the average block time )
const INVALID_INDEX = -2
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeKey, memKey sdk.StoreKey, ps paramtypes.Subspace, bankKeeper types.BankKeeper, accountKeeper types.AccountKeeper, specKeeper types.SpecKeeper, epochStorageKeeper types.EpochstorageKeeper, projectsKeeper types.ProjectsKeeper, ) *Keeper
func (Keeper) AddEpochPayment ¶ added in v0.4.3
func (k Keeper) AddEpochPayment(ctx sdk.Context, chainID string, epoch uint64, userAddress sdk.AccAddress, providerAddress sdk.AccAddress, usedCU uint64, uniqueIdentifier string) (uint64, error)
Function to add an epoch payment to the epochPayments object
func (Keeper) AddProviderPaymentInEpoch ¶ added in v0.4.3
func (k Keeper) AddProviderPaymentInEpoch(ctx sdk.Context, chainID string, epoch uint64, userAddress sdk.AccAddress, providerAddress sdk.AccAddress, usedCU uint64, uniqueIdentifier string) (userPayment *types.ProviderPaymentStorage, usedCUConsumerTotal uint64, err error)
Function to add a payment (which is represented by a uniquePaymentStorageClientProvider object) to a providerPaymentStorage object
func (Keeper) AddUniquePaymentStorageClientProvider ¶ added in v0.4.3
func (k Keeper) AddUniquePaymentStorageClientProvider(ctx sdk.Context, chainID string, block uint64, userAddress sdk.AccAddress, providerAddress sdk.AccAddress, uniqueIdentifier string, usedCU uint64) (isUnique bool, entryAddr *types.UniquePaymentStorageClientProvider)
func (Keeper) BurnClientStake ¶ added in v0.4.3
func (Keeper) BurnCoinsPerCU ¶ added in v0.4.3
BurnCoinsPerCU returns the BurnCoinsPerCU param
func (Keeper) CheckUnstakingForCommit ¶
func (Keeper) ClientMaxCUProviderForBlock ¶ added in v0.4.3
func (k Keeper) ClientMaxCUProviderForBlock(ctx sdk.Context, blockHeight uint64, clientEntry *epochstoragetypes.StakeEntry) (uint64, error)
func (Keeper) Clients ¶ added in v0.4.3
func (k Keeper) Clients(goCtx context.Context, req *types.QueryClientsRequest) (*types.QueryClientsResponse, error)
func (Keeper) CreditStakeEntry ¶
func (Keeper) DataReliabilityReward ¶ added in v0.4.3
func (Keeper) EncodeUniquePaymentKey ¶
func (k Keeper) EncodeUniquePaymentKey(ctx sdk.Context, userAddress sdk.AccAddress, providerAddress sdk.AccAddress, uniqueIdentifier string, chainID string) string
func (Keeper) EnforceClientCUsUsageInEpoch ¶
func (Keeper) EpochPayments ¶
func (k Keeper) EpochPayments(c context.Context, req *types.QueryGetEpochPaymentsRequest) (*types.QueryGetEpochPaymentsResponse, error)
func (Keeper) EpochPaymentsAll ¶
func (k Keeper) EpochPaymentsAll(c context.Context, req *types.QueryAllEpochPaymentsRequest) (*types.QueryAllEpochPaymentsResponse, error)
func (Keeper) EpochStart ¶ added in v0.5.2
func (k Keeper) EpochStart(ctx sdk.Context, epochsNumToCheckCuForUnresponsiveProvider uint64, epochsNumToCheckForComplainers uint64)
Function that calls all the functions that are supposed to run in epoch start
func (Keeper) FraudSlashingAmount ¶ added in v0.4.3
FraudSlashingAmount returns the FraudSlashingAmount param
func (Keeper) FraudStakeSlashingFactor ¶ added in v0.4.3
FraudStakeSlashingFactor returns the FraudStakeSlashingFactor param
func (Keeper) FreezeProvider ¶
func (Keeper) GetAllEpochPayments ¶
func (k Keeper) GetAllEpochPayments(ctx sdk.Context) (list []types.EpochPayments)
GetAllEpochPayments returns all epochPayments
func (Keeper) GetAllProviderPaymentStorage ¶
func (k Keeper) GetAllProviderPaymentStorage(ctx sdk.Context) (list []types.ProviderPaymentStorage)
GetAllProviderPaymentStorage returns all providerPaymentStorage
func (Keeper) GetAllUniquePaymentStorageClientProvider ¶
func (k Keeper) GetAllUniquePaymentStorageClientProvider(ctx sdk.Context) (list []types.UniquePaymentStorageClientProvider)
GetAllUniquePaymentStorageClientProvider returns all uniquePaymentStorageClientProvider
func (Keeper) GetAllowedCUForBlock ¶ added in v0.4.3
func (k Keeper) GetAllowedCUForBlock(ctx sdk.Context, blockHeight uint64, entry *epochstoragetypes.StakeEntry) (uint64, error)
func (Keeper) GetConsumerFromUniquePayment ¶
func (k Keeper) GetConsumerFromUniquePayment(uniquePaymentStorageClientProvider *types.UniquePaymentStorageClientProvider) string
func (Keeper) GetEpochPayments ¶
func (k Keeper) GetEpochPayments( ctx sdk.Context, index string, ) (val types.EpochPayments, found bool)
GetEpochPayments returns a epochPayments from its index
func (Keeper) GetEpochPaymentsFromBlock ¶
func (k Keeper) GetEpochPaymentsFromBlock(ctx sdk.Context, epoch uint64) (epochPayment types.EpochPayments, found bool, key string)
Function to get the epochPayments object from a specific epoch. Note that it also returns the epochPayments object's key which is the epoch in hex representation (base 16)
func (Keeper) GetPairing ¶
func (k Keeper) GetPairing(goCtx context.Context, req *types.QueryGetPairingRequest) (*types.QueryGetPairingResponse, error)
Gets a client's provider list in a specific chain. Also returns the start block of the current epoch, time (in seconds) until there's a new pairing, the block that the chain in the request's spec was changed
func (Keeper) GetPairingForClient ¶
func (k Keeper) GetPairingForClient(ctx sdk.Context, chainID string, clientAddress sdk.AccAddress) (providers []epochstoragetypes.StakeEntry, errorRet error)
func (Keeper) GetProjectData ¶
func (Keeper) GetProviderPaymentStorage ¶
func (k Keeper) GetProviderPaymentStorage( ctx sdk.Context, index string, ) (val types.ProviderPaymentStorage, found bool)
GetProviderPaymentStorage returns a providerPaymentStorage from its index
func (Keeper) GetProviderPaymentStorageKey ¶
func (k Keeper) GetProviderPaymentStorageKey(ctx sdk.Context, chainID string, epoch uint64, providerAddress sdk.AccAddress) string
Function to get a providerPaymentStorage object's key (key is chainID_epoch_providerAddress, epoch in hex representation)
func (Keeper) GetTotalUsedCUForConsumerPerEpoch ¶ added in v0.4.3
func (k Keeper) GetTotalUsedCUForConsumerPerEpoch(ctx sdk.Context, consumerAddress string, uniquePaymentStorageKeys []string, providerAddress string) (uint64, error)
Function to get the total serviced CU by a provider in this epoch for a specific consumer
func (Keeper) GetUniquePaymentStorageClientProvider ¶
func (k Keeper) GetUniquePaymentStorageClientProvider( ctx sdk.Context, index string, ) (val types.UniquePaymentStorageClientProvider, found bool)
GetUniquePaymentStorageClientProvider returns a uniquePaymentStorageClientProvider from its index
func (Keeper) IsEpochStart ¶ added in v0.4.3
we dont want to do the calculation here too, epochStorage keeper did it
func (Keeper) MintCoinsPerCU ¶ added in v0.4.3
MintCoinsPerCU returns the MintCoinsPerCU param
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) ProviderPaymentStorage ¶
func (k Keeper) ProviderPaymentStorage(c context.Context, req *types.QueryGetProviderPaymentStorageRequest) (*types.QueryGetProviderPaymentStorageResponse, error)
func (Keeper) ProviderPaymentStorageAll ¶
func (k Keeper) ProviderPaymentStorageAll(c context.Context, req *types.QueryAllProviderPaymentStorageRequest) (*types.QueryAllProviderPaymentStorageResponse, error)
func (Keeper) Providers ¶
func (k Keeper) Providers(goCtx context.Context, req *types.QueryProvidersRequest) (*types.QueryProvidersResponse, error)
func (Keeper) RecommendedEpochNumToCollectPayment ¶
RecommendedEpochNumToCollectPayment returns the RecommendedEpochNumToCollectPayment param
func (Keeper) RemoveAllEpochPaymentsForBlock ¶ added in v0.4.3
Function to remove all epochPayments objects from a specific epoch
func (Keeper) RemoveEpochPayments ¶
RemoveEpochPayments removes a epochPayments from the store
func (Keeper) RemoveOldEpochPayment ¶
Function to remove epochPayments objects from deleted epochs (older than the chain's memory)
func (Keeper) RemoveProviderPaymentStorage ¶
RemoveProviderPaymentStorage removes a providerPaymentStorage from the store
func (Keeper) RemoveUniquePaymentStorageClientProvider ¶
RemoveUniquePaymentStorageClientProvider removes a uniquePaymentStorageClientProvider from the store
func (Keeper) ServicersToPairCount ¶ added in v0.4.3
func (Keeper) ServicersToPairCountRaw ¶ added in v0.4.3
ServicersToPairCount returns the ServicersToPairCount param
func (Keeper) SetEpochPayments ¶
func (k Keeper) SetEpochPayments(ctx sdk.Context, epochPayments types.EpochPayments)
SetEpochPayments set a specific epochPayments in the store from its index
func (Keeper) SetProviderPaymentStorage ¶
func (k Keeper) SetProviderPaymentStorage(ctx sdk.Context, providerPaymentStorage types.ProviderPaymentStorage)
SetProviderPaymentStorage set a specific providerPaymentStorage in the store from its index
func (Keeper) SetRecommendedEpochNumToCollectPayment ¶
func (Keeper) SetUniquePaymentStorageClientProvider ¶
func (k Keeper) SetUniquePaymentStorageClientProvider(ctx sdk.Context, uniquePaymentStorageClientProvider types.UniquePaymentStorageClientProvider)
SetUniquePaymentStorageClientProvider set a specific uniquePaymentStorageClientProvider in the store from its index
func (Keeper) SlashEntry ¶
func (Keeper) SlashLimit ¶ added in v0.4.3
func (Keeper) StakeNewEntry ¶
func (Keeper) StakeToMaxCUList ¶ added in v0.4.3
func (Keeper) StakeToMaxCUListRaw ¶ added in v0.4.3
func (k Keeper) StakeToMaxCUListRaw(ctx sdk.Context) (res types.StakeToMaxCUList)
func (Keeper) StaticProvidersList ¶
func (k Keeper) StaticProvidersList(goCtx context.Context, req *types.QueryStaticProvidersListRequest) (*types.QueryStaticProvidersListResponse, error)
func (Keeper) UniquePaymentStorageClientProvider ¶
func (k Keeper) UniquePaymentStorageClientProvider(c context.Context, req *types.QueryGetUniquePaymentStorageClientProviderRequest) (*types.QueryGetUniquePaymentStorageClientProviderResponse, error)
func (Keeper) UniquePaymentStorageClientProviderAll ¶
func (k Keeper) UniquePaymentStorageClientProviderAll(c context.Context, req *types.QueryAllUniquePaymentStorageClientProviderRequest) (*types.QueryAllUniquePaymentStorageClientProviderResponse, error)
func (Keeper) UnpayLimit ¶ added in v0.4.3
func (Keeper) UnstakeEntry ¶
func (Keeper) UnstakeUnresponsiveProviders ¶
func (k Keeper) UnstakeUnresponsiveProviders(ctx sdk.Context, epochsNumToCheckCUForUnresponsiveProvider uint64, epochsNumToCheckCUForComplainers uint64) error
Function that returns a map that links between a provider that should be punished and its providerCuCounterForUnreponsiveness
func (Keeper) UserEntry ¶
func (k Keeper) UserEntry(goCtx context.Context, req *types.QueryUserEntryRequest) (*types.QueryUserEntryResponse, error)
func (Keeper) ValidatePairingForClient ¶
func (Keeper) VerifyClientStake ¶ added in v0.8.1
func (Keeper) VerifyPairing ¶
func (k Keeper) VerifyPairing(goCtx context.Context, req *types.QueryVerifyPairingRequest) (*types.QueryVerifyPairingResponse, error)
Source Files
¶
- discipline.go
- epoch_payments.go
- epoch_start.go
- grpc_query.go
- grpc_query_clients.go
- grpc_query_epoch_payments.go
- grpc_query_get_pairing.go
- grpc_query_params.go
- grpc_query_provider_payment_storage.go
- grpc_query_providers.go
- grpc_query_static_providers_list.go
- grpc_query_unique_payment_storage_client_provider.go
- grpc_query_user_entry.go
- grpc_query_verify_pairing.go
- keeper.go
- limitConsumer.go
- msg_server.go
- msg_server_freeze.go
- msg_server_relay_payment.go
- msg_server_stake_client.go
- msg_server_stake_provider.go
- msg_server_unfreeze.go
- msg_server_unstake_client.go
- msg_server_unstake_provider.go
- pairing.go
- pairing_next_epoch_time_block.go
- params.go
- provider_payment_storage.go
- stakeModify.go
- staking.go
- unique_payment_storage_client_provider.go
- unresponsive_provider.go
- unstaking.go