Documentation ¶
Index ¶
- func DiffValidators(currentValidators []types.ConsensusValidator, ...) []abci.ValidatorUpdate
- func GetValidatorKey(prefix []byte, providerConsAddr types.ProviderConsAddress) []byte
- func MaxProviderConsensusValidatorsInvariant(k *Keeper) sdk.Invariant
- func NewMsgServerImpl(keeper *Keeper) types.MsgServer
- func NoMoreThanPercentOfTheSum(validators []types.ConsensusValidator, percent uint32) []types.ConsensusValidator
- func RegisterInvariants(ir sdk.InvariantRegistry, k *Keeper)
- func StakingKeeperEquivalenceInvariant(k Keeper) sdk.Invariant
- type Hooks
- func (h Hooks) AfterDelegationModified(_ context.Context, _ sdk.AccAddress, _ sdk.ValAddress) error
- func (h Hooks) AfterProposalDeposit(ctx context.Context, proposalID uint64, depositorAddr sdk.AccAddress) error
- func (h Hooks) AfterProposalFailedMinDeposit(ctx context.Context, proposalID uint64) error
- func (h Hooks) AfterProposalSubmission(goCtx context.Context, proposalId uint64) error
- func (h Hooks) AfterProposalVote(ctx context.Context, proposalID uint64, voterAddr sdk.AccAddress) error
- func (h Hooks) AfterProposalVotingPeriodEnded(goCtx context.Context, proposalId uint64) error
- func (h Hooks) AfterUnbondingInitiated(goCtx context.Context, id uint64) error
- func (h Hooks) AfterValidatorBeginUnbonding(_ context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error
- func (h Hooks) AfterValidatorBonded(_ context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error
- func (h Hooks) AfterValidatorCreated(goCtx context.Context, valAddr sdk.ValAddress) error
- func (h Hooks) AfterValidatorRemoved(goCtx context.Context, valConsAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
- func (h Hooks) BeforeDelegationCreated(_ context.Context, _ sdk.AccAddress, _ sdk.ValAddress) error
- func (h Hooks) BeforeDelegationRemoved(_ context.Context, _ sdk.AccAddress, _ sdk.ValAddress) error
- func (h Hooks) BeforeDelegationSharesModified(_ context.Context, _ sdk.AccAddress, _ sdk.ValAddress) error
- func (h Hooks) BeforeTokenizeShareRecordRemoved(_ context.Context, _ uint64) error
- func (h Hooks) BeforeValidatorModified(_ context.Context, _ sdk.ValAddress) error
- func (h Hooks) BeforeValidatorSlashed(_ context.Context, _ sdk.ValAddress, _ math.LegacyDec) error
- type Keeper
- func (k Keeper) AllocateConsumerRewards(ctx sdk.Context, consumerId string, alloc types.ConsumerRewardsAllocation) (types.ConsumerRewardsAllocation, error)
- func (k Keeper) AllocateTokens(ctx sdk.Context)
- func (k Keeper) AllocateTokensToConsumerValidators(ctx sdk.Context, consumerId string, tokens sdk.DecCoins) (err error)
- func (k Keeper) AppendConsumerAddrsToPrune(ctx sdk.Context, consumerId string, pruneTs time.Time, ...)
- func (k Keeper) AppendConsumerToBeLaunched(ctx sdk.Context, consumerId string, spawnTime time.Time) error
- func (k Keeper) AppendConsumerToBeRemoved(ctx sdk.Context, consumerId string, removalTime time.Time) error
- func (k Keeper) AppendPendingVSCPackets(ctx sdk.Context, consumerId string, ...)
- func (k Keeper) AppendSlashAck(ctx sdk.Context, consumerId, ack string)
- func (k Keeper) AssignConsumerKey(ctx sdk.Context, consumerId string, validator stakingtypes.Validator, ...) error
- func (k Keeper) AuthenticateCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) bool
- func (k Keeper) BeginBlockCIS(ctx sdk.Context)
- func (k Keeper) BeginBlockLaunchConsumers(ctx sdk.Context) error
- func (k Keeper) BeginBlockRD(ctx sdk.Context)
- func (k Keeper) BeginBlockRemoveConsumers(ctx sdk.Context) error
- func (k Keeper) BindPort(ctx sdk.Context, portID string) error
- func (k Keeper) BlocksUntilNextEpoch(ctx sdk.Context) int64
- func (k Keeper) BondDenom(ctx sdk.Context) (string, error)
- func (k Keeper) BondedRatio(ctx context.Context) (math.LegacyDec, error)
- func (k Keeper) CanValidateChain(ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress, ...) (bool, error)
- func (k Keeper) CapValidatorSet(ctx sdk.Context, powerShapingParameters types.PowerShapingParameters, ...) []types.ConsensusValidator
- func (k Keeper) CapValidatorsPower(ctx sdk.Context, validatorsPowerCap uint32, ...) []types.ConsensusValidator
- func (k Keeper) ChangeRewardDenoms(ctx sdk.Context, denomsToAdd, denomsToRemove []string) []sdk.Attribute
- func (k Keeper) CheckForSlashMeterReplenishment(ctx sdktypes.Context)
- func (k Keeper) CheckMisbehaviour(ctx sdk.Context, consumerId string, misbehaviour ibctmtypes.Misbehaviour) error
- func (k Keeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error
- func (k Keeper) ComputeConsumerNextValSet(ctx sdk.Context, bondedValidators []stakingtypes.Validator, ...) ([]abci.ValidatorUpdate, error)
- func (k Keeper) ComputeConsumerTotalVotingPower(ctx sdk.Context, consumerId string) (totalPower int64)
- func (k Keeper) ComputeMinPowerInTopN(ctx sdk.Context, bondedValidators []stakingtypes.Validator, topN uint32) (int64, error)
- func (k Keeper) ComputeNextValidators(ctx sdk.Context, consumerId string, bondedValidators []stakingtypes.Validator, ...) ([]types.ConsensusValidator, error)
- func (k Keeper) ComputePowerToSlash(ctx sdk.Context, validator stakingtypes.Validator, ...) int64
- func (k Keeper) ConsensusAddressCodec() addresscodec.Codec
- func (k Keeper) ConsumeConsumerAddrsToPrune(ctx sdk.Context, consumerId string, ts time.Time) (consumerAddrsToPrune types.AddressList)
- func (k Keeper) ConsumeIdsFromTimeQueue(ctx sdk.Context, timeQueueKeyPrefix byte, ...) ([]string, error)
- func (k Keeper) ConsumeSlashAcks(ctx sdk.Context, consumerId string) (acks []string)
- func (k Keeper) ConsumerRewardDenomExists(ctx sdk.Context, denom string) bool
- func (k Keeper) CreateConsumerClient(ctx sdk.Context, consumerId string, valsetHash []byte) error
- func (k Keeper) CreateConsumerValidator(ctx sdk.Context, consumerId string, validator stakingtypes.Validator) (types.ConsensusValidator, error)
- func (k Keeper) CreateProviderConsensusValidator(ctx sdk.Context, val stakingtypes.Validator) (types.ConsensusValidator, error)
- func (k Keeper) DeleteAllConsumersToBeLaunched(ctx sdk.Context, spawnTime time.Time)
- func (k Keeper) DeleteAllConsumersToBeRemoved(ctx sdk.Context, removalTime time.Time)
- func (k Keeper) DeleteAllOptedIn(ctx sdk.Context, consumerId string)
- func (k Keeper) DeleteAllowlist(ctx sdk.Context, consumerId string)
- func (k Keeper) DeleteAllowlistedRewardDenoms(ctx sdk.Context, consumerId string)
- func (k Keeper) DeleteChannelIdToConsumerId(ctx sdk.Context, channelId string)
- func (k Keeper) DeleteConsumerAddrsToPrune(ctx sdk.Context, consumerId string, pruneTs time.Time)
- func (k Keeper) DeleteConsumerChain(ctx sdk.Context, consumerId string) (err error)
- func (k Keeper) DeleteConsumerChainId(ctx sdk.Context, consumerId string)
- func (k Keeper) DeleteConsumerClientId(ctx sdk.Context, consumerId string)
- func (k Keeper) DeleteConsumerCommissionRate(ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress)
- func (k Keeper) DeleteConsumerGenesis(ctx sdk.Context, consumerId string)
- func (k Keeper) DeleteConsumerIdToChannelId(ctx sdk.Context, consumerId string)
- func (k Keeper) DeleteConsumerInitializationParameters(ctx sdk.Context, consumerId string)
- func (k Keeper) DeleteConsumerMetadata(ctx sdk.Context, consumerId string)
- func (k Keeper) DeleteConsumerOwnerAddress(ctx sdk.Context, consumerId string)
- func (k Keeper) DeleteConsumerPhase(ctx sdk.Context, consumerId string)
- func (k Keeper) DeleteConsumerRemovalTime(ctx sdk.Context, consumerId string)
- func (k Keeper) DeleteConsumerRewardDenom(ctx sdk.Context, denom string)
- func (k Keeper) DeleteConsumerRewardsAllocationByDenom(ctx sdk.Context, consumerId string, denom string)
- func (k Keeper) DeleteConsumerValSet(ctx sdk.Context, consumerId string)
- func (k Keeper) DeleteConsumerValidator(ctx sdk.Context, consumerId string, providerConsAddr types.ProviderConsAddress)
- func (k Keeper) DeleteDenylist(ctx sdk.Context, consumerId string)
- func (k Keeper) DeleteEquivocationEvidenceMinHeight(ctx sdk.Context, consumerId string)
- func (k Keeper) DeleteInitChainHeight(ctx sdk.Context, consumerId string)
- func (k Keeper) DeleteKeyAssignments(ctx sdk.Context, consumerId string)
- func (k Keeper) DeleteLastProviderConsensusValSet(ctx sdk.Context)
- func (k Keeper) DeleteLastProviderConsensusValidator(ctx sdk.Context, providerConsAddr types.ProviderConsAddress)
- func (k Keeper) DeleteMinimumPowerInTopN(ctx sdk.Context, consumerId string)
- func (k Keeper) DeleteOptedIn(ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress)
- func (k Keeper) DeletePendingVSCPackets(ctx sdk.Context, consumerId string)
- func (k Keeper) DeleteSlashAcks(ctx sdk.Context, consumerId string)
- func (k Keeper) DeleteValidatorByConsumerAddr(ctx sdk.Context, consumerId string, consumerAddr types.ConsumerConsAddress)
- func (k Keeper) DeleteValidatorConsumerPubKey(ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress)
- func (k Keeper) DeleteValsetUpdateBlockHeight(ctx sdk.Context, valsetUpdateId uint64)
- func (k Keeper) EndBlockCIS(ctx sdk.Context)
- func (k Keeper) EndBlockVSU(ctx sdk.Context) ([]abci.ValidatorUpdate, error)
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) FetchAndIncrementConsumerId(ctx sdk.Context) string
- func (k Keeper) FilterValidators(ctx sdk.Context, consumerId string, bondedValidators []stakingtypes.Validator, ...) ([]types.ConsensusValidator, error)
- func (k Keeper) FulfillsMinStake(ctx sdk.Context, minStake uint64, providerAddr types.ProviderConsAddress) (bool, error)
- func (k Keeper) GetAllActiveConsumerIds(ctx sdk.Context) []string
- func (k Keeper) GetAllChannelToConsumers(ctx sdk.Context) (channelsToConsumers []struct{ ... })
- func (k Keeper) GetAllCommissionRateValidators(ctx sdk.Context, consumerId string) (addresses []types.ProviderConsAddress)
- func (k Keeper) GetAllConsumerAddrsToPrune(ctx sdk.Context, consumerId string) (consumerAddrsToPrune []types.ConsumerAddrsToPruneV2)
- func (k Keeper) GetAllConsumerIds(ctx sdk.Context) []string
- func (k Keeper) GetAllConsumerRewardDenoms(ctx sdk.Context) (consumerRewardDenoms []string)
- func (k Keeper) GetAllConsumersWithIBCClients(ctx sdk.Context) []string
- func (k Keeper) GetAllOptedIn(ctx sdk.Context, consumerId string) (providerConsAddresses []types.ProviderConsAddress)
- func (k Keeper) GetAllValidatorConsumerPubKeys(ctx sdk.Context, consumerId *string) (validatorConsumerPubKeys []types.ValidatorConsumerPubKey)
- func (k Keeper) GetAllValidatorsByConsumerAddr(ctx sdk.Context, consumerId *string) (validatorConsumerAddrs []types.ValidatorByConsumerAddr)
- func (k Keeper) GetAllValsetUpdateBlockHeights(ctx sdk.Context) (valsetUpdateBlockHeights []types.ValsetUpdateIdToHeight)
- func (k Keeper) GetAllowList(ctx sdk.Context, consumerId string) (providerConsAddresses []types.ProviderConsAddress)
- func (k Keeper) GetAllowlistedRewardDenoms(ctx sdk.Context, consumerId string) ([]string, error)
- func (k Keeper) GetAuthority() string
- func (k Keeper) GetBlocksPerEpoch(ctx sdk.Context) int64
- func (k Keeper) GetByzantineValidators(ctx sdk.Context, misbehaviour ibctmtypes.Misbehaviour) (validators []*tmtypes.Validator, err error)
- func (k Keeper) GetCCVTimeoutPeriod(ctx sdk.Context) time.Duration
- func (k Keeper) GetChannelIdToConsumerId(ctx sdk.Context, channelID string) (string, bool)
- func (k Keeper) GetClientIdToConsumerId(ctx sdk.Context, clientId string) (string, bool)
- func (k Keeper) GetConsumerAddrsToPrune(ctx sdk.Context, consumerId string, ts time.Time) (consumerAddrsToPrune types.AddressList)
- func (k Keeper) GetConsumerChain(ctx sdk.Context, consumerId string) (types.Chain, error)
- func (k Keeper) GetConsumerChainConsensusValidatorsKey(ctx sdk.Context, consumerId string) []byte
- func (k Keeper) GetConsumerChainId(ctx sdk.Context, consumerId string) (string, error)
- func (k Keeper) GetConsumerClientId(ctx sdk.Context, consumerId string) (string, bool)
- func (k Keeper) GetConsumerCommissionRate(ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress) (math.LegacyDec, bool)
- func (k Keeper) GetConsumerGenesis(ctx sdk.Context, consumerId string) (ccv.ConsumerGenesisState, bool)
- func (k Keeper) GetConsumerId(ctx sdk.Context) (uint64, bool)
- func (k Keeper) GetConsumerIdToChannelId(ctx sdk.Context, consumerId string) (string, bool)
- func (k Keeper) GetConsumerInitializationParameters(ctx sdk.Context, consumerId string) (types.ConsumerInitializationParameters, error)
- func (k Keeper) GetConsumerMetadata(ctx sdk.Context, consumerId string) (types.ConsumerMetadata, error)
- func (k Keeper) GetConsumerOwnerAddress(ctx sdk.Context, consumerId string) (string, error)
- func (k Keeper) GetConsumerPhase(ctx sdk.Context, consumerId string) types.ConsumerPhase
- func (k Keeper) GetConsumerPowerShapingParameters(ctx sdk.Context, consumerId string) (types.PowerShapingParameters, error)
- func (k Keeper) GetConsumerRemovalTime(ctx sdk.Context, consumerId string) (time.Time, error)
- func (k Keeper) GetConsumerRewardDenomRegistrationFee(ctx sdk.Context) sdk.Coin
- func (k Keeper) GetConsumerRewardsAllocationByDenom(ctx sdk.Context, consumerId string, denom string) (types.ConsumerRewardsAllocation, error)
- func (k Keeper) GetConsumerRewardsPool(ctx sdk.Context) sdk.Coins
- func (k Keeper) GetConsumerRewardsPoolAddressStr(ctx sdk.Context) string
- func (k Keeper) GetConsumerValSet(ctx sdk.Context, consumerId string) ([]types.ConsensusValidator, error)
- func (k Keeper) GetConsumerValidator(ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress) (types.ConsensusValidator, bool)
- func (k Keeper) GetConsumersToBeLaunched(ctx sdk.Context, spawnTime time.Time) (types.ConsumerIds, error)
- func (k Keeper) GetConsumersToBeRemoved(ctx sdk.Context, removalTime time.Time) (types.ConsumerIds, error)
- func (k Keeper) GetDenyList(ctx sdk.Context, consumerId string) (providerConsAddresses []types.ProviderConsAddress)
- func (k Keeper) GetEffectiveValPower(ctx sdktypes.Context, valConsAddr providertypes.ProviderConsAddress) math.Int
- func (k Keeper) GetEquivocationEvidenceMinHeight(ctx sdk.Context, consumerId string) uint64
- func (k Keeper) GetInitChainHeight(ctx sdk.Context, consumerId string) (uint64, bool)
- func (k Keeper) GetLastBondedValidators(ctx sdk.Context) ([]stakingtypes.Validator, error)
- func (k Keeper) GetLastProviderConsensusActiveValidators(ctx sdk.Context) ([]stakingtypes.Validator, error)
- func (k Keeper) GetLastProviderConsensusValSet(ctx sdk.Context) ([]types.ConsensusValidator, error)
- func (k Keeper) GetLastTotalProviderConsensusPower(ctx sdk.Context) (math.Int, error)
- func (k Keeper) GetMaxProviderConsensusValidators(ctx sdk.Context) int64
- func (k Keeper) GetMinimumPowerInTopN(ctx sdk.Context, consumerId string) (int64, bool)
- func (k Keeper) GetNumberOfEpochsToStartReceivingRewards(ctx sdk.Context) int64
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k Keeper) GetPendingVSCPackets(ctx sdk.Context, consumerId string) []ccv.ValidatorSetChangePacketData
- func (k Keeper) GetPort(ctx sdk.Context) string
- func (k Keeper) GetProviderAddrFromConsumerAddr(ctx sdk.Context, consumerId string, consumerAddr types.ConsumerConsAddress) types.ProviderConsAddress
- func (k Keeper) GetSlashAcks(ctx sdk.Context, consumerId string) []string
- func (k Keeper) GetSlashLog(ctx sdk.Context, providerAddr types.ProviderConsAddress) (found bool)
- func (k Keeper) GetSlashMeter(ctx sdktypes.Context) math.Int
- func (k Keeper) GetSlashMeterAllowance(ctx sdktypes.Context) math.Int
- func (k Keeper) GetSlashMeterReplenishFraction(ctx sdk.Context) string
- func (k Keeper) GetSlashMeterReplenishPeriod(ctx sdk.Context) time.Duration
- func (k Keeper) GetSlashMeterReplenishTimeCandidate(ctx sdktypes.Context) time.Time
- func (k Keeper) GetSourceChainIdFromIBCPacket(ctx sdk.Context, packet channeltypes.Packet) (string, error)
- func (k Keeper) GetTemplateClient(ctx sdk.Context) *ibctmtypes.ClientState
- func (k Keeper) GetTrustingPeriodFraction(ctx sdk.Context) string
- func (k Keeper) GetValidatorByConsumerAddr(ctx sdk.Context, consumerId string, consumerAddr types.ConsumerConsAddress) (providerAddr types.ProviderConsAddress, found bool)
- func (k Keeper) GetValidatorConsumerPubKey(ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress) (consumerKey tmprotocrypto.PublicKey, found bool)
- func (k Keeper) GetValidatorSetUpdateId(ctx sdk.Context) (validatorSetUpdateId uint64)
- func (k Keeper) GetValsetUpdateBlockHeight(ctx sdk.Context, valsetUpdateId uint64) (uint64, bool)
- func (k Keeper) HandleConsumerDoubleVoting(ctx sdk.Context, consumerId string, evidence *tmtypes.DuplicateVoteEvidence, ...) error
- func (k Keeper) HandleConsumerMisbehaviour(ctx sdk.Context, consumerId string, misbehaviour ibctmtypes.Misbehaviour) error
- func (k Keeper) HandleOptIn(ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress, ...) error
- func (k Keeper) HandleOptOut(ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress) error
- func (k Keeper) HandleSetConsumerCommissionRate(ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress, ...) error
- func (k Keeper) HandleSlashPacket(ctx sdk.Context, consumerId string, data ccv.SlashPacketData)
- func (k Keeper) HasMinPower(ctx sdk.Context, providerAddr types.ProviderConsAddress, minPower int64) (bool, error)
- func (k *Keeper) Hooks() Hooks
- func (k Keeper) IdentifyConsumerIdFromIBCPacket(ctx sdk.Context, packet channeltypes.Packet) (string, error)
- func (k Keeper) IncrementValidatorSetUpdateId(ctx sdk.Context)
- func (k Keeper) InitGenesis(ctx sdk.Context, genState *types.GenesisState) []abci.ValidatorUpdate
- func (k Keeper) InitGenesisValUpdates(ctx sdk.Context) []abci.ValidatorUpdate
- func (k Keeper) InitializeConsumer(ctx sdk.Context, consumerId string) (time.Time, bool)
- func (k Keeper) InitializeSlashMeter(ctx sdktypes.Context)
- func (k Keeper) IsAllowlistEmpty(ctx sdk.Context, consumerId string) bool
- func (k Keeper) IsAllowlisted(ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress) bool
- func (k Keeper) IsBound(ctx sdk.Context, portID string) bool
- func (k Keeper) IsConsumerActive(ctx sdk.Context, consumerId string) bool
- func (k Keeper) IsConsumerValidator(ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress) bool
- func (k Keeper) IsDenylistEmpty(ctx sdk.Context, consumerId string) bool
- func (k Keeper) IsDenylisted(ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress) bool
- func (k Keeper) IsEligibleForConsumerRewards(ctx sdk.Context, consumerValidatorHeight int64) bool
- func (k Keeper) IsOptedIn(ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress) bool
- func (k Keeper) IterateBondedValidatorsByPower(ctx context.Context, ...) error
- func (k Keeper) IterateDelegations(ctx context.Context, delegator sdk.AccAddress, ...) error
- func (k Keeper) JailAndTombstoneValidator(ctx sdk.Context, providerAddr types.ProviderConsAddress) error
- func (k Keeper) LaunchConsumer(ctx sdk.Context, bondedValidators []stakingtypes.Validator, ...) error
- func (k Keeper) Logger(ctx context.Context) log.Logger
- func (k Keeper) MakeConsumerGenesis(ctx sdk.Context, consumerId string, ...) (gen ccv.ConsumerGenesisState, err error)
- func (k Keeper) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Packet, ack channeltypes.Acknowledgement) error
- func (k Keeper) OnRecvSlashPacket(ctx sdk.Context, packet channeltypes.Packet, data ccv.SlashPacketData) (ccv.PacketAckResult, error)
- func (k Keeper) OnTimeoutPacket(ctx sdk.Context, packet channeltypes.Packet) error
- func (k Keeper) OptInTopNValidators(ctx sdk.Context, consumerId string, bondedValidators []stakingtypes.Validator, ...) error
- func (k Keeper) ParseConsumerKey(consumerKey string) (tmprotocrypto.PublicKey, error)
- func (k Keeper) PrepareConsumerForLaunch(ctx sdk.Context, consumerId string, previousSpawnTime, spawnTime time.Time) error
- func (k Keeper) ProviderValidatorUpdates(ctx sdk.Context) ([]abci.ValidatorUpdate, error)
- func (k Keeper) PruneKeyAssignments(ctx sdk.Context, consumerId string)
- func (k Keeper) QueryAllPairsValConsAddrByConsumer(goCtx context.Context, req *types.QueryAllPairsValConsAddrByConsumerRequest) (*types.QueryAllPairsValConsAddrByConsumerResponse, error)
- func (k Keeper) QueryBlocksUntilNextEpoch(goCtx context.Context, req *types.QueryBlocksUntilNextEpochRequest) (*types.QueryBlocksUntilNextEpochResponse, error)
- func (k Keeper) QueryConsumerChain(goCtx context.Context, req *types.QueryConsumerChainRequest) (*types.QueryConsumerChainResponse, error)
- func (k Keeper) QueryConsumerChainOptedInValidators(goCtx context.Context, req *types.QueryConsumerChainOptedInValidatorsRequest) (*types.QueryConsumerChainOptedInValidatorsResponse, error)
- func (k Keeper) QueryConsumerChains(goCtx context.Context, req *types.QueryConsumerChainsRequest) (*types.QueryConsumerChainsResponse, error)
- func (k Keeper) QueryConsumerChainsValidatorHasToValidate(goCtx context.Context, ...) (*types.QueryConsumerChainsValidatorHasToValidateResponse, error)
- func (k Keeper) QueryConsumerGenesis(c context.Context, req *types.QueryConsumerGenesisRequest) (*types.QueryConsumerGenesisResponse, error)
- func (k Keeper) QueryConsumerIdFromClientId(goCtx context.Context, req *types.QueryConsumerIdFromClientIdRequest) (*types.QueryConsumerIdFromClientIdResponse, error)
- func (k Keeper) QueryConsumerValidators(goCtx context.Context, req *types.QueryConsumerValidatorsRequest) (*types.QueryConsumerValidatorsResponse, error)
- func (k Keeper) QueryParams(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) QueryRegisteredConsumerRewardDenoms(goCtx context.Context, req *types.QueryRegisteredConsumerRewardDenomsRequest) (*types.QueryRegisteredConsumerRewardDenomsResponse, error)
- func (k Keeper) QueryThrottleState(goCtx context.Context, req *types.QueryThrottleStateRequest) (*types.QueryThrottleStateResponse, error)
- func (k Keeper) QueryValidatorConsumerAddr(goCtx context.Context, req *types.QueryValidatorConsumerAddrRequest) (*types.QueryValidatorConsumerAddrResponse, error)
- func (k Keeper) QueryValidatorConsumerCommissionRate(goCtx context.Context, req *types.QueryValidatorConsumerCommissionRateRequest) (*types.QueryValidatorConsumerCommissionRateResponse, error)
- func (k Keeper) QueryValidatorProviderAddr(goCtx context.Context, req *types.QueryValidatorProviderAddrRequest) (*types.QueryValidatorProviderAddrResponse, error)
- func (k Keeper) QueueVSCPackets(ctx sdk.Context) error
- func (k Keeper) RemoveConsumerToBeLaunched(ctx sdk.Context, consumerId string, spawnTime time.Time) error
- func (k Keeper) RemoveConsumerToBeRemoved(ctx sdk.Context, consumerId string, removalTime time.Time) error
- func (k Keeper) ReplenishSlashMeter(ctx sdktypes.Context)
- func (k Keeper) SendVSCPackets(ctx sdk.Context) error
- func (k Keeper) SendVSCPacketsToChain(ctx sdk.Context, consumerId, channelId string) error
- func (k Keeper) SetAllowlist(ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress)
- func (k Keeper) SetAllowlistedRewardDenoms(ctx sdk.Context, consumerId string, rewardDenoms []string) error
- func (k Keeper) SetChannelToConsumerId(ctx sdk.Context, channelId, consumerId string)
- func (k Keeper) SetConsumerChain(ctx sdk.Context, channelID string) error
- func (k Keeper) SetConsumerChainId(ctx sdk.Context, consumerId, chainId string)
- func (k Keeper) SetConsumerClientId(ctx sdk.Context, consumerId, clientId string)
- func (k Keeper) SetConsumerCommissionRate(ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress, ...) error
- func (k Keeper) SetConsumerGenesis(ctx sdk.Context, consumerId string, gen ccv.ConsumerGenesisState) error
- func (k Keeper) SetConsumerIdToChannelId(ctx sdk.Context, consumerId, channelId string)
- func (k Keeper) SetConsumerInitializationParameters(ctx sdk.Context, consumerId string, ...) error
- func (k Keeper) SetConsumerMetadata(ctx sdk.Context, consumerId string, metadata types.ConsumerMetadata) error
- func (k Keeper) SetConsumerOwnerAddress(ctx sdk.Context, consumerId, owner string)
- func (k Keeper) SetConsumerPhase(ctx sdk.Context, consumerId string, phase types.ConsumerPhase)
- func (k Keeper) SetConsumerPowerShapingParameters(ctx sdk.Context, consumerId string, parameters types.PowerShapingParameters) error
- func (k Keeper) SetConsumerRemovalTime(ctx sdk.Context, consumerId string, removalTime time.Time) error
- func (k Keeper) SetConsumerRewardDenom(ctx sdk.Context, denom string)
- func (k Keeper) SetConsumerRewardsAllocationByDenom(ctx sdk.Context, consumerId string, denom string, ...) error
- func (k Keeper) SetConsumerValSet(ctx sdk.Context, consumerId string, nextValidators []types.ConsensusValidator) error
- func (k Keeper) SetConsumerValidator(ctx sdk.Context, consumerId string, validator types.ConsensusValidator) error
- func (k Keeper) SetDenylist(ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress)
- func (k Keeper) SetEquivocationEvidenceMinHeight(ctx sdk.Context, consumerId string, height uint64)
- func (k *Keeper) SetGovKeeper(govKeeper govkeeper.Keeper)
- func (k Keeper) SetInitChainHeight(ctx sdk.Context, consumerId string, height uint64)
- func (k Keeper) SetLastProviderConsensusValSet(ctx sdk.Context, nextValidators []types.ConsensusValidator) error
- func (k Keeper) SetLastProviderConsensusValidator(ctx sdk.Context, validator types.ConsensusValidator) error
- func (k Keeper) SetMinimumPowerInTopN(ctx sdk.Context, consumerId string, power int64)
- func (k Keeper) SetOptedIn(ctx sdk.Context, consumerId string, ...)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetPort(ctx sdk.Context, portID string)
- func (k Keeper) SetSlashAcks(ctx sdk.Context, consumerId string, acks []string)
- func (k Keeper) SetSlashLog(ctx sdk.Context, providerAddr types.ProviderConsAddress)
- func (k Keeper) SetSlashMeter(ctx sdktypes.Context, value math.Int)
- func (k Keeper) SetSlashMeterReplenishTimeCandidate(ctx sdktypes.Context)
- func (k Keeper) SetValidatorByConsumerAddr(ctx sdk.Context, consumerId string, consumerAddr types.ConsumerConsAddress, ...)
- func (k Keeper) SetValidatorConsumerPubKey(ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress, ...)
- func (k Keeper) SetValidatorSetUpdateId(ctx sdk.Context, valUpdateID uint64)
- func (k Keeper) SetValsetUpdateBlockHeight(ctx sdk.Context, valsetUpdateId, blockHeight uint64)
- func (k Keeper) SlashValidator(ctx sdk.Context, providerAddr types.ProviderConsAddress) error
- func (k Keeper) StakingTokenSupply(ctx context.Context) (math.Int, error)
- func (k Keeper) StopAndPrepareForConsumerRemoval(ctx sdk.Context, consumerId string) error
- func (k Keeper) TotalBondedTokens(ctx context.Context) (math.Int, error)
- func (k Keeper) UnbondingCanComplete(ctx sdk.Context, id uint64) error
- func (k Keeper) UnbondingTime(ctx sdk.Context) (time.Duration, error)
- func (k Keeper) UpdateAllowlist(ctx sdk.Context, consumerId string, allowlist []string)
- func (k Keeper) UpdateAllowlistedRewardDenoms(ctx sdk.Context, consumerId string, rewardDenoms []string) error
- func (k Keeper) UpdateDenylist(ctx sdk.Context, consumerId string, denylist []string)
- func (k Keeper) UpdateMinimumPowerInTopN(ctx sdk.Context, consumerId string, oldTopN, newTopN uint32) error
- func (k Keeper) ValidateSlashPacket(ctx sdk.Context, consumerId string, packet channeltypes.Packet, ...) error
- func (k Keeper) ValidatorAddressCodec() addresscodec.Codec
- func (k Keeper) ValidatorConsensusKeyInUse(ctx sdk.Context, valAddr sdk.ValAddress) bool
- func (k Keeper) VerifyConsumerChain(ctx sdk.Context, channelID string, connectionHops []string) error
- func (k Keeper) VerifyDoubleVotingEvidence(evidence tmtypes.DuplicateVoteEvidence, chainId string, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiffValidators ¶
func DiffValidators( currentValidators []types.ConsensusValidator, nextValidators []types.ConsensusValidator, ) []abci.ValidatorUpdate
DiffValidators compares the current and the next epoch's consumer validators and returns the `ValidatorUpdate` diff needed by CometBFT to update the validator set on a chain.
func GetValidatorKey ¶
func GetValidatorKey(prefix []byte, providerConsAddr types.ProviderConsAddress) []byte
GetValidatorKey constructs the key to access a given validator, stored under a given prefix. This method is public for testing.
func MaxProviderConsensusValidatorsInvariant ¶
MaxProviderConsensusValidatorsInvariant checks that the number of provider consensus validators is less than or equal to the maximum number of provider consensus validators
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the bank MsgServer interface for the provided Keeper.
func NoMoreThanPercentOfTheSum ¶
func NoMoreThanPercentOfTheSum(validators []types.ConsensusValidator, percent uint32) []types.ConsensusValidator
NoMoreThanPercentOfTheSum returns a set of validators with updated powers such that no validator has more than the provided `percent` of the sum of all validators' powers. Operates on a best-effort basis.
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, k *Keeper)
RegisterInvariants registers all staking invariants
func StakingKeeperEquivalenceInvariant ¶
StakingKeeperEquivalenceInvariant checks that *if* MaxProviderConsensusValidators == MaxValidators, then the staking keeper and the provider keeper return the same values for their common interface, i.e. the functions from staking_keeper_interface.go
Types ¶
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
Wrapper struct
func (Hooks) AfterDelegationModified ¶
func (h Hooks) AfterDelegationModified(_ context.Context, _ sdk.AccAddress, _ sdk.ValAddress) error
func (Hooks) AfterProposalDeposit ¶
func (Hooks) AfterProposalFailedMinDeposit ¶
func (Hooks) AfterProposalSubmission ¶
func (Hooks) AfterProposalVote ¶
func (Hooks) AfterProposalVotingPeriodEnded ¶
func (Hooks) AfterUnbondingInitiated ¶
func (Hooks) AfterValidatorBeginUnbonding ¶
func (h Hooks) AfterValidatorBeginUnbonding(_ context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error
func (Hooks) AfterValidatorBonded ¶
func (h Hooks) AfterValidatorBonded(_ context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error
func (Hooks) AfterValidatorCreated ¶
func (Hooks) AfterValidatorRemoved ¶
func (h Hooks) AfterValidatorRemoved(goCtx context.Context, valConsAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
func (Hooks) BeforeDelegationCreated ¶
func (h Hooks) BeforeDelegationCreated(_ context.Context, _ sdk.AccAddress, _ sdk.ValAddress) error
func (Hooks) BeforeDelegationRemoved ¶
func (h Hooks) BeforeDelegationRemoved(_ context.Context, _ sdk.AccAddress, _ sdk.ValAddress) error
func (Hooks) BeforeDelegationSharesModified ¶
func (h Hooks) BeforeDelegationSharesModified(_ context.Context, _ sdk.AccAddress, _ sdk.ValAddress) error
func (Hooks) BeforeTokenizeShareRecordRemoved ¶
func (Hooks) BeforeValidatorModified ¶
func (Hooks) BeforeValidatorSlashed ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper defines the Cross-Chain Validation Provider Keeper
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, key storetypes.StoreKey, paramSpace paramtypes.Subspace, scopedKeeper ccv.ScopedKeeper, channelKeeper ccv.ChannelKeeper, portKeeper ccv.PortKeeper, connectionKeeper ccv.ConnectionKeeper, clientKeeper ccv.ClientKeeper, stakingKeeper ccv.StakingKeeper, slashingKeeper ccv.SlashingKeeper, accountKeeper ccv.AccountKeeper, distributionKeeper ccv.DistributionKeeper, bankKeeper ccv.BankKeeper, govKeeper govkeeper.Keeper, authority string, validatorAddressCodec, consensusAddressCodec addresscodec.Codec, feeCollectorName string, ) Keeper
NewKeeper creates a new provider Keeper instance
func (Keeper) AllocateConsumerRewards ¶ added in v6.2.0
func (k Keeper) AllocateConsumerRewards(ctx sdk.Context, consumerId string, alloc types.ConsumerRewardsAllocation) (types.ConsumerRewardsAllocation, error)
AllocateConsumerRewards allocates the given rewards to provider consumer chain with the given consumer id
func (Keeper) AllocateTokens ¶
AllocateTokens performs rewards distribution to the community pool and validators based on the Partial Set Security distribution specification.
func (Keeper) AllocateTokensToConsumerValidators ¶
func (k Keeper) AllocateTokensToConsumerValidators( ctx sdk.Context, consumerId string, tokens sdk.DecCoins, ) (err error)
AllocateTokensToConsumerValidators allocates tokens to the given consumer chain's validator set
func (Keeper) AppendConsumerAddrsToPrune ¶
func (k Keeper) AppendConsumerAddrsToPrune( ctx sdk.Context, consumerId string, pruneTs time.Time, consumerAddr types.ConsumerConsAddress, )
AppendConsumerAddrsToPrune appends a consumer validator address to the list of consumer addresses that can be pruned once the block time is at least pruneTs.
The following invariant needs to hold: For each consumer address cAddr in ValidatorByConsumerAddr,
- either there exists a provider address pAddr in ValidatorConsumerPubKey, s.t. hash(ValidatorConsumerPubKey(pAddr)) = cAddr
- or there exists a timestamp in ConsumerAddrsToPrune s.t. cAddr in ConsumerAddrsToPrune(timestamp)
func (Keeper) AppendConsumerToBeLaunched ¶
func (k Keeper) AppendConsumerToBeLaunched(ctx sdk.Context, consumerId string, spawnTime time.Time) error
AppendConsumerToBeLaunched appends the provider consumer id for the given spawn time
func (Keeper) AppendConsumerToBeRemoved ¶
func (k Keeper) AppendConsumerToBeRemoved(ctx sdk.Context, consumerId string, removalTime time.Time) error
AppendConsumerToBeRemoved appends the provider consumer id for the given removal time
func (Keeper) AppendPendingVSCPackets ¶
func (k Keeper) AppendPendingVSCPackets(ctx sdk.Context, consumerId string, newPackets ...ccv.ValidatorSetChangePacketData)
AppendPendingVSCPackets adds the given ValidatorSetChange packet to the list of pending ValidatorSetChange packets stored under consumer id
func (Keeper) AppendSlashAck ¶
AppendSlashAck appends the given slash ack to the given consumer id slash acks in store
func (Keeper) AssignConsumerKey ¶
func (k Keeper) AssignConsumerKey( ctx sdk.Context, consumerId string, validator stakingtypes.Validator, consumerKey tmprotocrypto.PublicKey, ) error
AssignConsumerKey assigns the consumerKey to the validator with providerAddr on the consumer chain with the given `consumerId`, if it is either registered or currently voted on in a ConsumerAddition governance proposal
func (Keeper) AuthenticateCapability ¶
func (k Keeper) AuthenticateCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) bool
AuthenticateCapability wraps the scopedKeeper's AuthenticateCapability function
func (Keeper) BeginBlockCIS ¶
BeginBlockCIS contains the BeginBlock logic needed for the Consumer Initiated Slashing sub-protocol.
func (Keeper) BeginBlockLaunchConsumers ¶
BeginBlockLaunchConsumers launches initialized consumers chains for which the spawn time has passed
func (Keeper) BeginBlockRD ¶
BeginBlockRD executes BeginBlock logic for the Reward Distribution sub-protocol.
func (Keeper) BeginBlockRemoveConsumers ¶
BeginBlockRemoveConsumers removes stopped consumer chain for which the removal time has passed
func (Keeper) BindPort ¶
BindPort defines a wrapper function for the port Keeper's function in order to expose it to module's InitGenesis function
func (Keeper) BlocksUntilNextEpoch ¶
BlocksUntilNextEpoch returns the number of blocks until the next epoch starts Returns 0 if VSCPackets are sent in the current block, which is done in the first block of each epoch.
func (Keeper) BondedRatio ¶
BondedRatio gets the ratio of tokens staked to validators active in the consensus to the total supply of tokens. Same as BondedRatio in the StakingKeeper, but only counts tokens of the first MaxProviderConsensusValidators bonded validators.
func (Keeper) CanValidateChain ¶
func (k Keeper) CanValidateChain( ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress, topN uint32, minPowerToOptIn int64, ) (bool, error)
CanValidateChain returns true if the validator `providerAddr` is opted-in to chain with `consumerId` and the allowlist and denylist do not prevent the validator from validating the chain.
func (Keeper) CapValidatorSet ¶
func (k Keeper) CapValidatorSet( ctx sdk.Context, powerShapingParameters types.PowerShapingParameters, validators []types.ConsensusValidator, ) []types.ConsensusValidator
CapValidatorSet caps the provided `validators` if chain with `consumerId` is an Opt In chain with a validator-set cap. If cap is `k`, `CapValidatorSet` returns the first `k` validators from `validators` with the highest power.
func (Keeper) CapValidatorsPower ¶
func (k Keeper) CapValidatorsPower( ctx sdk.Context, validatorsPowerCap uint32, validators []types.ConsensusValidator, ) []types.ConsensusValidator
CapValidatorsPower caps the power of the validators on chain with `consumerId` and returns an updated slice of validators with their new powers. Works on a best-basis effort because there are cases where we cannot guarantee that all validators on the consumer chain have less power than the set validators-power cap. For example, if we have 10 validators and the power cap is set to 5%, we need at least one validator to have more than 10% of the voting power on the consumer chain.
func (Keeper) ChangeRewardDenoms ¶
func (k Keeper) ChangeRewardDenoms(ctx sdk.Context, denomsToAdd, denomsToRemove []string) []sdk.Attribute
TODO: this method needs to be tested
func (Keeper) CheckForSlashMeterReplenishment ¶
CheckForSlashMeterReplenishment checks if the slash meter should be replenished, and if so, replenishes it. Note: initial slash meter replenish time candidate is set in InitGenesis.
func (Keeper) CheckMisbehaviour ¶
func (k Keeper) CheckMisbehaviour(ctx sdk.Context, consumerId string, misbehaviour ibctmtypes.Misbehaviour) error
CheckMisbehaviour checks that headers in the given misbehaviour forms a valid light client attack from an ICS consumer chain and that the light client isn't expired
func (Keeper) ClaimCapability ¶
func (k Keeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error
ClaimCapability allows the transfer module that can claim a capability that IBC module passes to it
func (Keeper) ComputeConsumerNextValSet ¶
func (k Keeper) ComputeConsumerNextValSet( ctx sdk.Context, bondedValidators []stakingtypes.Validator, activeValidators []stakingtypes.Validator, consumerId string, currentConsumerValSet []types.ConsensusValidator, ) ([]abci.ValidatorUpdate, error)
ComputeConsumerNextValSet computes the consumer next validator set and returns the validator updates to be sent to the consumer chain. For TopN consumer chains, it automatically opts in all validators that belong to the top N of the active validators.
TODO add unit test for ComputeConsumerNextValSet
func (Keeper) ComputeConsumerTotalVotingPower ¶
func (k Keeper) ComputeConsumerTotalVotingPower(ctx sdk.Context, consumerId string) (totalPower int64)
ComputeConsumerTotalVotingPower returns the validator set total voting power for the given consumer chain
func (Keeper) ComputeMinPowerInTopN ¶
func (k Keeper) ComputeMinPowerInTopN(ctx sdk.Context, bondedValidators []stakingtypes.Validator, topN uint32) (int64, error)
ComputeMinPowerInTopN returns the minimum power needed for a validator (from the bonded validators) to belong to the `topN`% of validators for a Top N chain.
func (Keeper) ComputeNextValidators ¶
func (k Keeper) ComputeNextValidators( ctx sdk.Context, consumerId string, bondedValidators []stakingtypes.Validator, powerShapingParameters types.PowerShapingParameters, minPowerToOptIn int64, ) ([]types.ConsensusValidator, error)
ComputeNextValidators computes the validators for the upcoming epoch based on the currently `bondedValidators`.
func (Keeper) ComputePowerToSlash ¶
func (k Keeper) ComputePowerToSlash(ctx sdk.Context, validator stakingtypes.Validator, undelegations []stakingtypes.UnbondingDelegation, redelegations []stakingtypes.Redelegation, power int64, powerReduction math.Int, ) int64
ComputePowerToSlash computes the power to be slashed based on the tokens in non-matured `undelegations` and `redelegations`, as well as the current `power` of the validator. Note that this method does not perform any slashing.
func (Keeper) ConsensusAddressCodec ¶
func (k Keeper) ConsensusAddressCodec() addresscodec.Codec
ConsensusAddressCodec returns the app consensus address codec.
func (Keeper) ConsumeConsumerAddrsToPrune ¶
func (k Keeper) ConsumeConsumerAddrsToPrune( ctx sdk.Context, consumerId string, ts time.Time, ) (consumerAddrsToPrune types.AddressList)
ConsumeConsumerAddrsToPrune returns the list of consumer addresses that can be pruned at timestamp ts. The returned addresses are removed from the store.
Note that the list of all consumer addresses is stored under keys with the following format: ConsumerAddrsToPruneV2BytePrefix | len(consumerId) | consumerId | timestamp Thus, this method returns all the consumer addresses stored under keys in the following range: (ConsumerAddrsToPruneV2BytePrefix | len(consumerId) | consumerId | ts') where ts' <= ts
func (Keeper) ConsumeIdsFromTimeQueue ¶
func (k Keeper) ConsumeIdsFromTimeQueue( ctx sdk.Context, timeQueueKeyPrefix byte, getIds func(sdk.Context, time.Time) (types.ConsumerIds, error), deleteAllIds func(sdk.Context, time.Time), appendId func(sdk.Context, string, time.Time) error, limit int, ) ([]string, error)
ConsumeIdsFromTimeQueue returns from a time queue the consumer ids for which the associated time passed. The number of ids return is limited to 'limit'. The ids returned are removed from the time queue.
func (Keeper) ConsumeSlashAcks ¶
ConsumeSlashAcks empties and returns the slash acks for a given consumer id
func (Keeper) ConsumerRewardDenomExists ¶
func (Keeper) CreateConsumerClient ¶
func (k Keeper) CreateConsumerClient( ctx sdk.Context, consumerId string, valsetHash []byte, ) error
CreateConsumerClient will create the CCV client for the given consumer chain. The CCV channel must be built on top of the CCV client to ensure connection with the right consumer chain.
func (Keeper) CreateConsumerValidator ¶
func (k Keeper) CreateConsumerValidator(ctx sdk.Context, consumerId string, validator stakingtypes.Validator) (types.ConsensusValidator, error)
CreateConsumerValidator creates a consumer validator for `consumerId` from the given staking `validator`
func (Keeper) CreateProviderConsensusValidator ¶
func (k Keeper) CreateProviderConsensusValidator(ctx sdk.Context, val stakingtypes.Validator) (types.ConsensusValidator, error)
CreateProviderConsensusValidator creates a new ConsensusValidator from the given staking validator
func (Keeper) DeleteAllConsumersToBeLaunched ¶
DeleteAllConsumersToBeLaunched deletes all consumer to be launched at this specific spawn time
func (Keeper) DeleteAllConsumersToBeRemoved ¶
DeleteAllConsumersToBeRemoved deletes all consumer to be removed at this specific removal time
func (Keeper) DeleteAllOptedIn ¶
DeleteAllOptedIn deletes all the opted-in validators for chain with `consumerId`
func (Keeper) DeleteAllowlist ¶
DeleteAllowlist deletes all allowlisted validators
func (Keeper) DeleteAllowlistedRewardDenoms ¶ added in v6.2.0
DeleteAllowlistedRewardDenoms deletes the allowlisted reward denom for the given consumer id.
func (Keeper) DeleteChannelIdToConsumerId ¶
DeleteChannelIdToConsumerId deletes the consumer id for a given CCV channel id
func (Keeper) DeleteConsumerAddrsToPrune ¶
DeleteConsumerAddrsToPruneV2 deletes the list of consumer addresses mapped to a timestamp
func (Keeper) DeleteConsumerChain ¶
DeleteConsumerChain cleans up the state of the given consumer chain
func (Keeper) DeleteConsumerChainId ¶
DeleteConsumerChainId deletes the chain id associated with this consumer id
func (Keeper) DeleteConsumerClientId ¶
DeleteConsumerClientId removes from the store the client id for the given consumer id. Note that the method also removes the reverse index.
func (Keeper) DeleteConsumerCommissionRate ¶
func (k Keeper) DeleteConsumerCommissionRate( ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress, )
DeleteConsumerCommissionRate the per-consumer chain commission rate associated to the given validator address
func (Keeper) DeleteConsumerGenesis ¶
func (Keeper) DeleteConsumerIdToChannelId ¶
DeleteConsumerIdToChannelId deletes the CCV channel id for the given consumer id
func (Keeper) DeleteConsumerInitializationParameters ¶
DeleteConsumerInitializationParameters deletes the initialization parameters associated with this consumer id
func (Keeper) DeleteConsumerMetadata ¶
DeleteConsumerMetadata deletes the metadata associated with this consumer id
func (Keeper) DeleteConsumerOwnerAddress ¶
DeleteConsumerOwnerAddress deletes the owner address associated with this consumer id
func (Keeper) DeleteConsumerPhase ¶
DeleteConsumerPhase deletes the phase associated with this consumer id
func (Keeper) DeleteConsumerRemovalTime ¶
DeleteConsumerRemovalTime deletes the removal time associated with this consumer id
func (Keeper) DeleteConsumerRewardDenom ¶
func (Keeper) DeleteConsumerRewardsAllocationByDenom ¶ added in v6.2.0
func (k Keeper) DeleteConsumerRewardsAllocationByDenom(ctx sdk.Context, consumerId string, denom string)
DeleteConsumerRewardsAllocationByDenom deletes the consumer rewards allocation for the given consumer id and denom
func (Keeper) DeleteConsumerValSet ¶
DeleteConsumerValSet deletes all the stored consumer validators for chain with `consumerId`
func (Keeper) DeleteConsumerValidator ¶
func (k Keeper) DeleteConsumerValidator( ctx sdk.Context, consumerId string, providerConsAddr types.ProviderConsAddress, )
DeleteConsumerValidator removes consumer validator with `providerAddr` address
func (Keeper) DeleteDenylist ¶
DeleteDenylist deletes all denylisted validators
func (Keeper) DeleteEquivocationEvidenceMinHeight ¶
DeleteEquivocationEvidenceMinHeight deletes the minimum height of a valid consumer equivocation evidence for a given consumer id
func (Keeper) DeleteInitChainHeight ¶
DeleteInitChainHeight deletes the block height value for which the given consumer chain's channel was established
func (Keeper) DeleteKeyAssignments ¶
DeleteKeyAssignments deletes all the state needed for key assignments on a consumer chain
func (Keeper) DeleteLastProviderConsensusValSet ¶
DeleteLastProviderConsensusValSet deletes all the stored validators from the last provider consensus validator set
func (Keeper) DeleteLastProviderConsensusValidator ¶
func (k Keeper) DeleteLastProviderConsensusValidator( ctx sdk.Context, providerConsAddr types.ProviderConsAddress, )
DeleteLastProviderConsensusValidator removes the validator with `providerConsAddr` address from the stored last provider consensus validator set
func (Keeper) DeleteMinimumPowerInTopN ¶
DeleteMinimumPowerInTopN removes the minimum power required for a validator to be in the top N for a given consumer chain.
func (Keeper) DeleteOptedIn ¶
func (Keeper) DeletePendingVSCPackets ¶
DeletePendingVSCPackets deletes the list of pending ValidatorSetChange packets for chain ID
func (Keeper) DeleteSlashAcks ¶
DeleteSlashAcks deletes the slash acks for a given consumer id
func (Keeper) DeleteValidatorByConsumerAddr ¶
func (k Keeper) DeleteValidatorByConsumerAddr(ctx sdk.Context, consumerId string, consumerAddr types.ConsumerConsAddress)
DeleteValidatorByConsumerAddr deletes the mapping from a validator's consensus address on a consumer to the validator's consensus address on the provider
func (Keeper) DeleteValidatorConsumerPubKey ¶
func (k Keeper) DeleteValidatorConsumerPubKey(ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress)
DeleteValidatorConsumerPubKey deletes a validator's public key assigned for a consumer chain
func (Keeper) DeleteValsetUpdateBlockHeight ¶
DeleteValsetUpdateBlockHeight deletes the block height value for a given vaset update id
func (Keeper) EndBlockCIS ¶
EndBlockCIS contains the EndBlock logic needed for the Consumer Initiated Slashing sub-protocol
func (Keeper) EndBlockVSU ¶
EndBlockVSU contains the EndBlock logic needed for the Validator Set Update sub-protocol
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns the CCV provider module's exported genesis
func (Keeper) FetchAndIncrementConsumerId ¶
FetchAndIncrementConsumerId fetches the first consumer id that can be used and increments the underlying consumer id
func (Keeper) FilterValidators ¶
func (k Keeper) FilterValidators( ctx sdk.Context, consumerId string, bondedValidators []stakingtypes.Validator, predicate func(providerAddr types.ProviderConsAddress) (bool, error), ) ([]types.ConsensusValidator, error)
FilterValidators filters the provided `bondedValidators` according to `predicate` and returns the filtered set.
func (Keeper) FulfillsMinStake ¶
func (k Keeper) FulfillsMinStake( ctx sdk.Context, minStake uint64, providerAddr types.ProviderConsAddress, ) (bool, error)
FulfillsMinStake returns true if the validator `providerAddr` has enough stake to validate chain with `consumerId` by checking its staked tokens against the minimum stake required to validate the chain.
func (Keeper) GetAllActiveConsumerIds ¶
GetAllActiveConsumerIds returns all the consumer ids of chains that are registered, initialized, or launched
func (Keeper) GetAllChannelToConsumers ¶
func (k Keeper) GetAllChannelToConsumers(ctx sdk.Context) (channelsToConsumers []struct { ChannelId string ConsumerId string }, )
GetAllChannelToConsumers gets all channel to chain mappings. If a mapping exists, then the CCV channel to that consumer chain is established.
Note that mapping from CCV channel IDs to consumer IDs is stored under keys with the following format: ChannelIdToConsumerIdKeyPrefix | channelID Thus, the returned array is in ascending order of channelIDs.
func (Keeper) GetAllCommissionRateValidators ¶
func (k Keeper) GetAllCommissionRateValidators( ctx sdk.Context, consumerId string, ) (addresses []types.ProviderConsAddress)
GetAllCommissionRateValidators returns all the validator address that set a commission rate for the given consumer id
func (Keeper) GetAllConsumerAddrsToPrune ¶
func (k Keeper) GetAllConsumerAddrsToPrune(ctx sdk.Context, consumerId string) (consumerAddrsToPrune []types.ConsumerAddrsToPruneV2)
GetAllConsumerAddrsToPrune gets all consumer addresses that can be eventually pruned for a given consumerId.
Note that the list of all consumer addresses is stored under keys with the following format: ConsumerAddrsToPruneV2BytePrefix | len(consumerId) | consumerId | timestamp Thus, the returned array is in ascending order of timestamps.
func (Keeper) GetAllConsumerIds ¶
GetAllConsumerIds returns all the existing consumer ids
func (Keeper) GetAllConsumerRewardDenoms ¶
func (Keeper) GetAllConsumersWithIBCClients ¶
GetAllConsumersWithIBCClients returns the ids of all consumer chains that with IBC clients created.
func (Keeper) GetAllOptedIn ¶
func (k Keeper) GetAllOptedIn( ctx sdk.Context, consumerId string, ) (providerConsAddresses []types.ProviderConsAddress)
GetAllOptedIn returns all the opted-in validators on chain `consumerId`
func (Keeper) GetAllValidatorConsumerPubKeys ¶
func (k Keeper) GetAllValidatorConsumerPubKeys(ctx sdk.Context, consumerId *string) (validatorConsumerPubKeys []types.ValidatorConsumerPubKey)
GetAllValidatorConsumerPubKeys gets all the validators public keys assigned for a consumer chain If consumerId is nil, it returns all the validators public keys assigned for all consumer chains
Note that the validators public keys assigned for a consumer chain are stored under keys with the following format: ConsumerValidatorsBytePrefix | len(consumerId) | consumerId | providerAddress Thus, the returned array is
- in ascending order of providerAddresses, if consumerId is not nil;
- in undetermined order, if consumerId is nil.
func (Keeper) GetAllValidatorsByConsumerAddr ¶
func (k Keeper) GetAllValidatorsByConsumerAddr(ctx sdk.Context, consumerId *string) (validatorConsumerAddrs []types.ValidatorByConsumerAddr)
GetValidatorsByConsumerAddrs gets all the mappings from consensus addresses on a given consumer chain to consensus addresses on the provider chain. If consumerId is nil, it returns all the mappings from consensus addresses on all consumer chains.
Note that the mappings for a consumer chain are stored under keys with the following format: ValidatorsByConsumerAddrKeyPrefix | len(consumerId) | consumerId | consumerAddress Thus, the returned array is
- in ascending order of consumerAddresses, if consumerId is not nil;
- in undetermined order, if consumerId is nil.
func (Keeper) GetAllValsetUpdateBlockHeights ¶
func (k Keeper) GetAllValsetUpdateBlockHeights(ctx sdk.Context) (valsetUpdateBlockHeights []types.ValsetUpdateIdToHeight)
GetAllValsetUpdateBlockHeights gets all the block heights for all valset updates
Note that the mapping from vscIDs to block heights is stored under keys with the following format: ValsetUpdateBlockHeightKeyPrefix | vscID Thus, the returned array is in ascending order of vscIDs.
func (Keeper) GetAllowList ¶
func (k Keeper) GetAllowList( ctx sdk.Context, consumerId string, ) (providerConsAddresses []types.ProviderConsAddress)
GetAllowList returns all allowlisted validators
func (Keeper) GetAllowlistedRewardDenoms ¶ added in v6.2.0
GetAllowlistedRewardDenoms returns the allowlisted reward denom for the given consumer id.
func (Keeper) GetAuthority ¶
GetAuthority returns the x/ccv/provider module's authority.
func (Keeper) GetBlocksPerEpoch ¶
GetBlocksPerEpoch returns the number of blocks that constitute an epoch
func (Keeper) GetByzantineValidators ¶
func (k Keeper) GetByzantineValidators(ctx sdk.Context, misbehaviour ibctmtypes.Misbehaviour) (validators []*tmtypes.Validator, err error)
GetByzantineValidators returns the validators that signed both headers. If the misbehavior is an equivocation light client attack, then these validators are the Byzantine validators.
func (Keeper) GetCCVTimeoutPeriod ¶
GetCCVTimeoutPeriod returns the timeout period for sent ibc packets
func (Keeper) GetChannelIdToConsumerId ¶
GetChannelIdToConsumerId gets the consumer id for a given CCV channel id
func (Keeper) GetClientIdToConsumerId ¶
GetClientIdToConsumerId returns the consumer id associated with this client id
func (Keeper) GetConsumerAddrsToPrune ¶
func (k Keeper) GetConsumerAddrsToPrune( ctx sdk.Context, consumerId string, ts time.Time, ) (consumerAddrsToPrune types.AddressList)
GetConsumerAddrsToPrune returns the list of consumer addresses to prune stored under timestamp ts. Note that this method is only used in testing.
func (Keeper) GetConsumerChain ¶
GetConsumerChain returns a Chain data structure with all the necessary fields
func (Keeper) GetConsumerChainConsensusValidatorsKey ¶
GetConsumerChainConsensusValidatorsKey returns the store key for consumer validators of the consumer chain with `consumerId`
func (Keeper) GetConsumerChainId ¶
GetConsumerChainId returns the chain id associated with this consumer id
func (Keeper) GetConsumerClientId ¶
GetConsumerClientId returns the client id for the given consumer id.
func (Keeper) GetConsumerCommissionRate ¶
func (k Keeper) GetConsumerCommissionRate( ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress, ) (math.LegacyDec, bool)
GetConsumerCommissionRate returns the per-consumer commission rate set for the given validator address
func (Keeper) GetConsumerGenesis ¶
func (Keeper) GetConsumerId ¶
GetConsumerId returns the next to-be-assigned consumer id
func (Keeper) GetConsumerIdToChannelId ¶
GetConsumerIdToChannelId gets the CCV channelId for the given consumer id
func (Keeper) GetConsumerInitializationParameters ¶
func (k Keeper) GetConsumerInitializationParameters(ctx sdk.Context, consumerId string) (types.ConsumerInitializationParameters, error)
GetConsumerInitializationParameters returns the initialization parameters associated with this consumer id
func (Keeper) GetConsumerMetadata ¶
func (k Keeper) GetConsumerMetadata(ctx sdk.Context, consumerId string) (types.ConsumerMetadata, error)
GetConsumerMetadata returns the registration record associated with this consumer id
func (Keeper) GetConsumerOwnerAddress ¶
GetConsumerOwnerAddress returns the owner address associated with this consumer id
func (Keeper) GetConsumerPhase ¶
GetConsumerPhase returns the phase associated with this consumer id
func (Keeper) GetConsumerPowerShapingParameters ¶
func (k Keeper) GetConsumerPowerShapingParameters(ctx sdk.Context, consumerId string) (types.PowerShapingParameters, error)
GetConsumerPowerShapingParameters returns the power-shaping parameters associated with this consumer id
func (Keeper) GetConsumerRemovalTime ¶
GetConsumerRemovalTime returns the removal time associated with the to-be-removed chain with consumer id
func (Keeper) GetConsumerRewardDenomRegistrationFee ¶
func (Keeper) GetConsumerRewardsAllocationByDenom ¶ added in v6.2.0
func (k Keeper) GetConsumerRewardsAllocationByDenom(ctx sdk.Context, consumerId string, denom string) (types.ConsumerRewardsAllocation, error)
GetConsumerRewardsAllocationByDenom returns the consumer rewards allocation for the given consumer id and denom
func (Keeper) GetConsumerRewardsPool ¶
GetConsumerRewardsPool returns the balance of the consumer rewards pool module account
func (Keeper) GetConsumerRewardsPoolAddressStr ¶
func (Keeper) GetConsumerValSet ¶
func (k Keeper) GetConsumerValSet( ctx sdk.Context, consumerId string, ) ([]types.ConsensusValidator, error)
GetConsumerValSet returns all the consumer validators for chain with `consumerId`
func (Keeper) GetConsumerValidator ¶
func (k Keeper) GetConsumerValidator(ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress) (types.ConsensusValidator, bool)
GetConsumerValidator returns the consumer validator with `providerAddr` if it exists for chain with `consumerId`
func (Keeper) GetConsumersToBeLaunched ¶
func (k Keeper) GetConsumersToBeLaunched(ctx sdk.Context, spawnTime time.Time) (types.ConsumerIds, error)
GetConsumersToBeLaunched returns all the consumer ids of chains stored under this spawn time
func (Keeper) GetConsumersToBeRemoved ¶
func (k Keeper) GetConsumersToBeRemoved(ctx sdk.Context, removalTime time.Time) (types.ConsumerIds, error)
GetConsumersToBeRemoved returns all the consumer ids of chains stored under this removal time
func (Keeper) GetDenyList ¶
func (k Keeper) GetDenyList( ctx sdk.Context, consumerId string, ) (providerConsAddresses []types.ProviderConsAddress)
GetDenyList returns all denylisted validators
func (Keeper) GetEffectiveValPower ¶
func (k Keeper) GetEffectiveValPower(ctx sdktypes.Context, valConsAddr providertypes.ProviderConsAddress, ) math.Int
Obtains the effective validator power relevant to a validator consensus address.
func (Keeper) GetEquivocationEvidenceMinHeight ¶
GetEquivocationEvidenceMinHeight returns the minimum height of a valid consumer equivocation evidence for a given consumer id
func (Keeper) GetInitChainHeight ¶
GetInitChainHeight returns the provider block height when the given consumer chain was initiated
func (Keeper) GetLastBondedValidators ¶
GetLastBondedValidators iterates the last validator powers in the staking module and returns the first MaxValidators many validators with the largest powers.
func (Keeper) GetLastProviderConsensusActiveValidators ¶
func (k Keeper) GetLastProviderConsensusActiveValidators(ctx sdk.Context) ([]stakingtypes.Validator, error)
GetLastProviderConsensusActiveValidators returns the `MaxProviderConsensusValidators` many validators with the largest powers from the last bonded validators in the staking module.
func (Keeper) GetLastProviderConsensusValSet ¶
func (k Keeper) GetLastProviderConsensusValSet( ctx sdk.Context, ) ([]types.ConsensusValidator, error)
GetLastProviderConsensusValSet returns the last stored validator set sent to the consensus engine on the provider
func (Keeper) GetLastTotalProviderConsensusPower ¶
GetLastTotalProviderConsensusPower returns the total power of the last stored validator set sent to the consensus engine on the provider
func (Keeper) GetMaxProviderConsensusValidators ¶
GetMaxProviderConsensusValidators returns the number of validators that will be passed on from the staking module to the consensus engine on the provider
func (Keeper) GetMinimumPowerInTopN ¶
GetMinimumPowerInTopN returns the minimum power required for a validator to be in the top N for a given consumer chain.
func (Keeper) GetNumberOfEpochsToStartReceivingRewards ¶
GetNumberOfEpochsToStartReceivingRewards returns the number of epochs needed by a validator to continuously validate to start receiving rewards
func (Keeper) GetPendingVSCPackets ¶
func (k Keeper) GetPendingVSCPackets(ctx sdk.Context, consumerId string) []ccv.ValidatorSetChangePacketData
GetPendingVSCPackets returns the list of pending ValidatorSetChange packets stored under consumer id
func (Keeper) GetProviderAddrFromConsumerAddr ¶
func (k Keeper) GetProviderAddrFromConsumerAddr( ctx sdk.Context, consumerId string, consumerAddr types.ConsumerConsAddress, ) types.ProviderConsAddress
GetProviderAddrFromConsumerAddr returns the consensus address of a validator with consAddr set as the consensus address on a consumer chain
func (Keeper) GetSlashAcks ¶
GetSlashAcks returns the slash acks stored under the given consumer id
TODO: SlashAcks should be persisted as a list of ConsumerConsAddr types, not strings. See https://github.com/cosmos/interchain-security/issues/728
func (Keeper) GetSlashLog ¶
func (k Keeper) GetSlashLog( ctx sdk.Context, providerAddr types.ProviderConsAddress, ) (found bool)
GetSlashLog returns a validator's slash log status True will be returned if an entry exists for a given validator address
func (Keeper) GetSlashMeter ¶
GetSlashMeter returns a meter (persisted as a signed int) which stores an amount of voting power, corresponding to an allowance of validators that can be jailed/tombstoned over time.
Note: the value of this int should always be in the range of tendermint's [-MaxVotingPower, MaxVotingPower]
func (Keeper) GetSlashMeterAllowance ¶
GetSlashMeterAllowance returns the amount of voting power units (int) that would be added to the slash meter for a replenishment that would happen this block, this allowance value also serves as the max value for the meter for this block.
Note: allowance can change between blocks, since it is directly correlated to total voting power. The slash meter must be less than or equal to the allowance for this block, before any slash packet handling logic can be executed.
func (Keeper) GetSlashMeterReplenishFraction ¶
GetSlashMeterReplenishFraction returns the string fraction of total voting power that is replenished to the slash meter every replenish period. This param also serves as a maximum fraction of total voting power that the slash meter can hold.
func (Keeper) GetSlashMeterReplenishPeriod ¶
GetSlashMeterReplenishPeriod returns the period in which: Once the slash meter becomes not-full, the slash meter is replenished after this period.
func (Keeper) GetSlashMeterReplenishTimeCandidate ¶
GetSlashMeterReplenishTimeCandidate returns the next UTC time the slash meter could potentially be replenished.
Note: this value is the next time the slash meter will be replenished IFF the slash meter is NOT full. Otherwise this value will be updated in every future block until the slash meter becomes NOT full.
func (Keeper) GetSourceChainIdFromIBCPacket ¶ added in v6.1.0
func (k Keeper) GetSourceChainIdFromIBCPacket(ctx sdk.Context, packet channeltypes.Packet) (string, error)
GetSourceChainIdFromIBCPacket returns the chain ID of the chain that sent this packet
func (Keeper) GetTemplateClient ¶
func (k Keeper) GetTemplateClient(ctx sdk.Context) *ibctmtypes.ClientState
GetTemplateClient returns the template consumer client
func (Keeper) GetTrustingPeriodFraction ¶
GetTrustingPeriodFraction returns a TrustingPeriodFraction used to compute the provider IBC client's TrustingPeriod as UnbondingPeriod / TrustingPeriodFraction
func (Keeper) GetValidatorByConsumerAddr ¶
func (k Keeper) GetValidatorByConsumerAddr( ctx sdk.Context, consumerId string, consumerAddr types.ConsumerConsAddress, ) (providerAddr types.ProviderConsAddress, found bool)
GetValidatorByConsumerAddr returns a validator's consensus address on the provider given the validator's consensus address on a consumer
func (Keeper) GetValidatorConsumerPubKey ¶
func (k Keeper) GetValidatorConsumerPubKey( ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress, ) (consumerKey tmprotocrypto.PublicKey, found bool)
GetValidatorConsumerPubKey returns a validator's public key assigned for a consumer chain
func (Keeper) GetValidatorSetUpdateId ¶
func (Keeper) GetValsetUpdateBlockHeight ¶
GetValsetUpdateBlockHeight gets the block height for a given valset update id
func (Keeper) HandleConsumerDoubleVoting ¶
func (k Keeper) HandleConsumerDoubleVoting( ctx sdk.Context, consumerId string, evidence *tmtypes.DuplicateVoteEvidence, pubkey cryptotypes.PubKey, ) error
HandleConsumerDoubleVoting verifies a double voting evidence for a given a consumer id and a public key and, if successful, executes the slashing, jailing, and tombstoning of the malicious validator.
func (Keeper) HandleConsumerMisbehaviour ¶
func (k Keeper) HandleConsumerMisbehaviour(ctx sdk.Context, consumerId string, misbehaviour ibctmtypes.Misbehaviour) error
HandleConsumerMisbehaviour checks if the given IBC misbehaviour corresponds to an equivocation light client attack, and in this case, slashes, jails, and tombstones
func (Keeper) HandleOptIn ¶
func (k Keeper) HandleOptIn(ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress, consumerKey string) error
HandleOptIn prepares validator `providerAddr` to opt in to `consumerId` with an optional `consumerKey` consumer public key. Note that the validator only opts in at the end of an epoch.
func (Keeper) HandleOptOut ¶
func (k Keeper) HandleOptOut(ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress) error
HandleOptOut prepares validator `providerAddr` to opt out from running `consumerId`. Note that the validator only opts out at the end of an epoch.
func (Keeper) HandleSetConsumerCommissionRate ¶
func (k Keeper) HandleSetConsumerCommissionRate(ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress, commissionRate math.LegacyDec) error
HandleSetConsumerCommissionRate sets a per-consumer chain commission rate for the given provider address on the condition that the given consumer chain exists.
func (Keeper) HandleSlashPacket ¶
HandleSlashPacket potentially jails a misbehaving validator for a downtime infraction. This method should NEVER be called with a double-sign infraction.
func (Keeper) HasMinPower ¶
func (k Keeper) HasMinPower(ctx sdk.Context, providerAddr types.ProviderConsAddress, minPower int64) (bool, error)
HasMinPower returns true if the `providerAddr` voting power is GTE than the given minimum power
func (Keeper) IdentifyConsumerIdFromIBCPacket ¶
func (k Keeper) IdentifyConsumerIdFromIBCPacket(ctx sdk.Context, packet channeltypes.Packet) (string, error)
IdentifyConsumerIdFromIBCPacket checks if the packet destination matches a registered consumer chain. If so, it returns the consumer chain ID, otherwise an error.
func (Keeper) IncrementValidatorSetUpdateId ¶
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, genState *types.GenesisState) []abci.ValidatorUpdate
InitGenesis initializes the CCV provider state and binds to PortID.
func (Keeper) InitGenesisValUpdates ¶
func (k Keeper) InitGenesisValUpdates(ctx sdk.Context) []abci.ValidatorUpdate
InitGenesisValUpdates returns the genesis validator set updates for the provider module by selecting the first MaxProviderConsensusValidators from the staking module's validator set.
func (Keeper) InitializeConsumer ¶
InitializeConsumer tries to move a consumer with `consumerId` to the initialized phase. If successful, it returns the spawn time and true.
func (Keeper) InitializeSlashMeter ¶
InitializeSlashMeter initializes the slash meter to it's max value (also its allowance), and sets the replenish time candidate to one replenish period from current block time.
func (Keeper) IsAllowlistEmpty ¶
IsAllowlistEmpty returns `true` if no validator is allowlisted on chain `consumerId`
func (Keeper) IsAllowlisted ¶
func (k Keeper) IsAllowlisted( ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress, ) bool
IsAllowlisted returns `true` if validator with `providerAddr` has been allowlisted on chain `consumerId`
func (Keeper) IsConsumerActive ¶
IsConsumerActive checks if a consumer chain is either registered, initialized, or launched.
func (Keeper) IsConsumerValidator ¶
func (k Keeper) IsConsumerValidator(ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress) bool
IsConsumerValidator returns `true` if the consumer validator with `providerAddr` exists for chain with `consumerId` and `false` otherwise
func (Keeper) IsDenylistEmpty ¶
IsDenylistEmpty returns `true` if no validator is denylisted on chain `consumerId`
func (Keeper) IsDenylisted ¶
func (k Keeper) IsDenylisted( ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress, ) bool
IsDenylisted returns `true` if validator with `providerAddr` has been denylisted on chain `consumerId`
func (Keeper) IsEligibleForConsumerRewards ¶
IsEligibleForConsumerRewards returns `true` if the validator with `consumerValidatorHeight` has been a consumer validator for a long period of time and hence is eligible to receive rewards, and false otherwise
func (Keeper) IterateBondedValidatorsByPower ¶
func (k Keeper) IterateBondedValidatorsByPower(ctx context.Context, fn func(index int64, validator stakingtypes.ValidatorI) (stop bool)) error
IterateBondedValidatorsByPower iterates over the consensus-active validators by power. The same as IterateBondedValidatorsByPower in the StakingKeeper, but only returns the first MaxProviderConsensusValidators validators. This is used to implement the interface of the staking keeper to interact with modules that need to reference the consensus-active validators.
func (Keeper) IterateDelegations ¶
func (k Keeper) IterateDelegations(ctx context.Context, delegator sdk.AccAddress, fn func(index int64, delegation stakingtypes.DelegationI) (stop bool)) error
IterateDelegations is the same as IterateDelegations in the StakingKeeper. Necessary to implement the interface of the staking keeper to interface with other modules.
func (Keeper) JailAndTombstoneValidator ¶
func (k Keeper) JailAndTombstoneValidator(ctx sdk.Context, providerAddr types.ProviderConsAddress) error
JailAndTombstoneValidator jails and tombstones the validator with the given provider consensus address
func (Keeper) LaunchConsumer ¶
func (k Keeper) LaunchConsumer( ctx sdk.Context, bondedValidators []stakingtypes.Validator, activeValidators []stakingtypes.Validator, consumerId string, ) error
LaunchConsumer launches the chain with the provided consumer id by creating the consumer client and the respective consumer genesis file
TODO add unit test for LaunchConsumer
func (Keeper) MakeConsumerGenesis ¶
func (k Keeper) MakeConsumerGenesis( ctx sdk.Context, consumerId string, initialValidatorUpdates []abci.ValidatorUpdate, ) (gen ccv.ConsumerGenesisState, err error)
MakeConsumerGenesis returns the created consumer genesis state for consumer chain `consumerId`, as well as the validator hash of the initial validator set of the consumer chain
func (Keeper) OnAcknowledgementPacket ¶
func (k Keeper) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Packet, ack channeltypes.Acknowledgement) error
OnAcknowledgementPacket handles acknowledgments for sent VSC packets
func (Keeper) OnRecvSlashPacket ¶
func (k Keeper) OnRecvSlashPacket( ctx sdk.Context, packet channeltypes.Packet, data ccv.SlashPacketData, ) (ccv.PacketAckResult, error)
OnRecvSlashPacket delivers a received slash packet, validates it and then queues the slash packet as pending if valid.
func (Keeper) OnTimeoutPacket ¶
OnTimeoutPacket aborts the transaction if no chain exists for the destination channel, otherwise it stops the chain
func (Keeper) OptInTopNValidators ¶
func (k Keeper) OptInTopNValidators( ctx sdk.Context, consumerId string, bondedValidators []stakingtypes.Validator, minPowerToOptIn int64, ) error
OptInTopNValidators opts in to `consumerId` all the `bondedValidators` that have at least `minPowerToOptIn` power
func (Keeper) ParseConsumerKey ¶
func (k Keeper) ParseConsumerKey(consumerKey string) (tmprotocrypto.PublicKey, error)
ParseConsumerKey parses the ED25519 PubKey`consumerKey` from a JSON string and constructs its corresponding `tmprotocrypto.PublicKey`
func (Keeper) PrepareConsumerForLaunch ¶
func (k Keeper) PrepareConsumerForLaunch(ctx sdk.Context, consumerId string, previousSpawnTime, spawnTime time.Time) error
PrepareConsumerForLaunch prepares to move the launch of a consumer chain from the previous spawn time to spawn time. Previous spawn time can correspond to its zero value if the validator was not previously set for launch.
func (Keeper) ProviderValidatorUpdates ¶
ProviderValidatorUpdates returns changes in the provider consensus validator set from the last block to the current one. It retrieves the bonded validators from the staking module and creates a `ConsumerValidator` object for each validator. The maximum number of validators is determined by the `maxValidators` parameter. The function returns the difference between the current validator set and the next validator set as a list of `abci.ValidatorUpdate` objects.
func (Keeper) PruneKeyAssignments ¶
PruneKeyAssignments prunes the consumer addresses no longer needed as they cannot be referenced in slash requests (by a correct consumer)
func (Keeper) QueryAllPairsValConsAddrByConsumer ¶
func (k Keeper) QueryAllPairsValConsAddrByConsumer( goCtx context.Context, req *types.QueryAllPairsValConsAddrByConsumerRequest, ) (*types.QueryAllPairsValConsAddrByConsumerResponse, error)
func (Keeper) QueryBlocksUntilNextEpoch ¶
func (k Keeper) QueryBlocksUntilNextEpoch(goCtx context.Context, req *types.QueryBlocksUntilNextEpochRequest) (*types.QueryBlocksUntilNextEpochResponse, error)
QueryBlocksUntilNextEpoch returns the number of blocks until the next epoch
func (Keeper) QueryConsumerChain ¶
func (k Keeper) QueryConsumerChain(goCtx context.Context, req *types.QueryConsumerChainRequest) (*types.QueryConsumerChainResponse, error)
QueryConsumerChain returns the consumer chain associated with the consumer id
func (Keeper) QueryConsumerChainOptedInValidators ¶
func (k Keeper) QueryConsumerChainOptedInValidators(goCtx context.Context, req *types.QueryConsumerChainOptedInValidatorsRequest) (*types.QueryConsumerChainOptedInValidatorsResponse, error)
QueryConsumerChainOptedInValidators returns all validators that opted-in to a given consumer chain
func (Keeper) QueryConsumerChains ¶
func (k Keeper) QueryConsumerChains(goCtx context.Context, req *types.QueryConsumerChainsRequest) (*types.QueryConsumerChainsResponse, error)
func (Keeper) QueryConsumerChainsValidatorHasToValidate ¶
func (k Keeper) QueryConsumerChainsValidatorHasToValidate(goCtx context.Context, req *types.QueryConsumerChainsValidatorHasToValidateRequest) (*types.QueryConsumerChainsValidatorHasToValidateResponse, error)
QueryConsumerChainsValidatorHasToValidate returns all consumer chains that the given validator has to validate now or in the next epoch if nothing changes.
func (Keeper) QueryConsumerGenesis ¶
func (k Keeper) QueryConsumerGenesis(c context.Context, req *types.QueryConsumerGenesisRequest) (*types.QueryConsumerGenesisResponse, error)
func (Keeper) QueryConsumerIdFromClientId ¶
func (k Keeper) QueryConsumerIdFromClientId(goCtx context.Context, req *types.QueryConsumerIdFromClientIdRequest) (*types.QueryConsumerIdFromClientIdResponse, error)
QueryConsumerIdFromClientId returns the consumer id of the chain associated with this client id
func (Keeper) QueryConsumerValidators ¶
func (k Keeper) QueryConsumerValidators(goCtx context.Context, req *types.QueryConsumerValidatorsRequest) (*types.QueryConsumerValidatorsResponse, error)
QueryConsumerValidators returns all validators that are consumer validators in a given consumer chain
func (Keeper) QueryParams ¶
func (k Keeper) QueryParams(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
QueryParams returns all parameters and current values of provider
func (Keeper) QueryRegisteredConsumerRewardDenoms ¶
func (k Keeper) QueryRegisteredConsumerRewardDenoms(goCtx context.Context, req *types.QueryRegisteredConsumerRewardDenomsRequest) (*types.QueryRegisteredConsumerRewardDenomsResponse, error)
func (Keeper) QueryThrottleState ¶
func (k Keeper) QueryThrottleState(goCtx context.Context, req *types.QueryThrottleStateRequest) (*types.QueryThrottleStateResponse, error)
func (Keeper) QueryValidatorConsumerAddr ¶
func (k Keeper) QueryValidatorConsumerAddr(goCtx context.Context, req *types.QueryValidatorConsumerAddrRequest) (*types.QueryValidatorConsumerAddrResponse, error)
func (Keeper) QueryValidatorConsumerCommissionRate ¶
func (k Keeper) QueryValidatorConsumerCommissionRate(goCtx context.Context, req *types.QueryValidatorConsumerCommissionRateRequest) (*types.QueryValidatorConsumerCommissionRateResponse, error)
QueryValidatorConsumerCommissionRate returns the commission rate a given validator charges on a given consumer chain
func (Keeper) QueryValidatorProviderAddr ¶
func (k Keeper) QueryValidatorProviderAddr(goCtx context.Context, req *types.QueryValidatorProviderAddrRequest) (*types.QueryValidatorProviderAddrResponse, error)
func (Keeper) QueueVSCPackets ¶
QueueVSCPackets queues latest validator updates for every consumer chain with the IBC client created.
TODO (mpoke): iterate only over consumers with established channel -- GetAllChannelToConsumers
func (Keeper) RemoveConsumerToBeLaunched ¶
func (k Keeper) RemoveConsumerToBeLaunched(ctx sdk.Context, consumerId string, spawnTime time.Time) error
RemoveConsumerToBeLaunched removes consumer id from if stored for this specific spawn time
func (Keeper) RemoveConsumerToBeRemoved ¶
func (k Keeper) RemoveConsumerToBeRemoved(ctx sdk.Context, consumerId string, removalTime time.Time) error
RemoveConsumerToBeRemoved removes consumer id from the given removal time
func (Keeper) ReplenishSlashMeter ¶
func (Keeper) SendVSCPackets ¶
SendVSCPackets iterates over all consumers chains with created IBC clients and sends pending VSC packets to the chains with established CCV channels. If the CCV channel is not established for a consumer chain, the updates will remain queued until the channel is established
TODO (mpoke): iterate only over consumers with established channel -- GetAllChannelToConsumers
func (Keeper) SendVSCPacketsToChain ¶
SendVSCPacketsToChain sends all queued VSC packets to the specified chain
func (Keeper) SetAllowlist ¶
func (k Keeper) SetAllowlist( ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress, )
SetAllowlist allowlists validator with `providerAddr` address on chain `consumerId`
func (Keeper) SetAllowlistedRewardDenoms ¶ added in v6.2.0
func (k Keeper) SetAllowlistedRewardDenoms(ctx sdk.Context, consumerId string, rewardDenoms []string) error
SetAllowlistedRewardDenoms sets the allowlisted reward denoms for the given consumer id.
func (Keeper) SetChannelToConsumerId ¶
SetChannelToConsumerId sets the mapping from the CCV channel id to the consumer id.
func (Keeper) SetConsumerChain ¶
SetConsumerChain ensures that the consumer chain has not already been set by a different channel, and then sets the consumer chain mappings in keeper, and set the channel status to validating. If there is already a CCV channel between the provider and consumer chain then close the channel, so that another channel can be made.
SetConsumerChain is called by OnChanOpenConfirm.
func (Keeper) SetConsumerChainId ¶
SetConsumerChainId sets the chain id associated with this consumer id
func (Keeper) SetConsumerClientId ¶
SetConsumerClientId sets the client id for the given consumer id. Note that the method also stores a reverse index that can be accessed by calling GetClientIdToConsumerId.
func (Keeper) SetConsumerCommissionRate ¶
func (k Keeper) SetConsumerCommissionRate( ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress, commissionRate math.LegacyDec, ) error
SetConsumerCommissionRate sets a per-consumer chain commission rate for the given validator address
func (Keeper) SetConsumerGenesis ¶
func (Keeper) SetConsumerIdToChannelId ¶
SetConsumerIdToChannelId sets the mapping from a consumer id to the CCV channel id for that consumer chain.
func (Keeper) SetConsumerInitializationParameters ¶
func (k Keeper) SetConsumerInitializationParameters(ctx sdk.Context, consumerId string, parameters types.ConsumerInitializationParameters) error
SetConsumerInitializationParameters sets the initialization parameters associated with this consumer id
func (Keeper) SetConsumerMetadata ¶
func (k Keeper) SetConsumerMetadata(ctx sdk.Context, consumerId string, metadata types.ConsumerMetadata) error
SetConsumerMetadata sets the registration record associated with this consumer id
func (Keeper) SetConsumerOwnerAddress ¶
SetConsumerOwnerAddress sets the owner address associated with this consumer id
func (Keeper) SetConsumerPhase ¶
SetConsumerPhase sets the phase associated with this consumer id
func (Keeper) SetConsumerPowerShapingParameters ¶
func (k Keeper) SetConsumerPowerShapingParameters(ctx sdk.Context, consumerId string, parameters types.PowerShapingParameters) error
SetConsumerPowerShapingParameters sets the power-shaping parameters associated with this consumer id. Note that it also updates the allowlist and denylist indexes if they are different
func (Keeper) SetConsumerRemovalTime ¶
func (k Keeper) SetConsumerRemovalTime(ctx sdk.Context, consumerId string, removalTime time.Time) error
SetConsumerRemovalTime sets the removal time associated with this consumer id
func (Keeper) SetConsumerRewardDenom ¶
func (Keeper) SetConsumerRewardsAllocationByDenom ¶ added in v6.2.0
func (k Keeper) SetConsumerRewardsAllocationByDenom(ctx sdk.Context, consumerId string, denom string, rewardsAllocation types.ConsumerRewardsAllocation) error
SetConsumerRewardsAllocationByDenom sets the consumer rewards allocation for the given consumer id and denom
func (Keeper) SetConsumerValSet ¶
func (k Keeper) SetConsumerValSet(ctx sdk.Context, consumerId string, nextValidators []types.ConsensusValidator) error
SetConsumerValSet resets the current consumer validators with the `nextValidators` computed by `FilterValidators` and hence this method should only be called after `FilterValidators` has completed.
func (Keeper) SetConsumerValidator ¶
func (k Keeper) SetConsumerValidator( ctx sdk.Context, consumerId string, validator types.ConsensusValidator, ) error
SetConsumerValidator sets provided consumer `validator` on the consumer chain with `consumerId`
func (Keeper) SetDenylist ¶
func (k Keeper) SetDenylist( ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress, )
SetDenylist denylists validator with `providerAddr` address on chain `consumerId`
func (Keeper) SetEquivocationEvidenceMinHeight ¶
SetEquivocationEvidenceMinHeight sets the minimum height of a valid consumer equivocation evidence for a given consumer id
func (*Keeper) SetGovKeeper ¶
func (Keeper) SetInitChainHeight ¶
SetInitChainHeight sets the provider block height when the given consumer chain was initiated
func (Keeper) SetLastProviderConsensusValSet ¶
func (k Keeper) SetLastProviderConsensusValSet(ctx sdk.Context, nextValidators []types.ConsensusValidator) error
SetLastProviderConsensusValSet resets the stored last validator set sent to the consensus engine on the provider to the provided `nextValidators`.
func (Keeper) SetLastProviderConsensusValidator ¶
func (k Keeper) SetLastProviderConsensusValidator( ctx sdk.Context, validator types.ConsensusValidator, ) error
SetLastProviderConsensusValidator sets the given validator to be stored as part of the last provider consensus validator set
func (Keeper) SetMinimumPowerInTopN ¶
SetMinimumPowerInTopN sets the minimum power required for a validator to be in the top N for a given consumer chain.
func (Keeper) SetOptedIn ¶
func (Keeper) SetSlashAcks ¶
SetSlashAcks sets the slash acks under the given chain ID
TODO: SlashAcks should be persisted as a list of ConsumerConsAddr types, not strings. See https://github.com/cosmos/interchain-security/issues/728
func (Keeper) SetSlashLog ¶
func (k Keeper) SetSlashLog( ctx sdk.Context, providerAddr types.ProviderConsAddress, )
SetSlashLog updates validator's slash log for a consumer chain If an entry exists for a given validator address, at least one double signing slash packet was received by the provider from at least one consumer chain
func (Keeper) SetSlashMeter ¶
SetSlashMeter sets the slash meter to the given signed int value
Note: the value of this int should always be in the range of tendermint's [-MaxTotalVotingPower, MaxTotalVotingPower]
func (Keeper) SetSlashMeterReplenishTimeCandidate ¶
SetSlashMeterReplenishTimeCandidate sets the next time the slash meter may be replenished to the current block time + the configured slash meter replenish period.
Note: this value is the next time the slash meter will be replenished IFF the slash meter is NOT full. Otherwise this value will be updated in every future block until the slash meter becomes NOT full.
func (Keeper) SetValidatorByConsumerAddr ¶
func (k Keeper) SetValidatorByConsumerAddr( ctx sdk.Context, consumerId string, consumerAddr types.ConsumerConsAddress, providerAddr types.ProviderConsAddress, )
SetValidatorByConsumerAddr sets the mapping from a validator's consensus address on a consumer to the validator's consensus address on the provider
func (Keeper) SetValidatorConsumerPubKey ¶
func (k Keeper) SetValidatorConsumerPubKey( ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress, consumerKey tmprotocrypto.PublicKey, )
SetValidatorConsumerPubKey sets a validator's public key assigned for a consumer chain
func (Keeper) SetValidatorSetUpdateId ¶
func (Keeper) SetValsetUpdateBlockHeight ¶
SetValsetUpdateBlockHeight sets the block height for a given valset update id
func (Keeper) SlashValidator ¶
SlashValidator slashes validator with given provider Address
func (Keeper) StakingTokenSupply ¶
StakingTokenSupply is the same as StakingTotalSupply in the StakingKeeper. Necessary to implement the interface of the staking keeper to interface with other modules.
func (Keeper) StopAndPrepareForConsumerRemoval ¶
StopAndPrepareForConsumerRemoval sets the phase of the chain to stopped and prepares to get the state of the chain removed after unbonding period elapses
func (Keeper) TotalBondedTokens ¶
TotalBondedTokens gets the amount of tokens of the consensus-active validators. The same as TotalBondedTokens in the StakingKeeper, but only counts bonded tokens of the first MaxProviderConsensusValidators bonded validators. This is used to implement the interface of the staking keeper to interface with modules that need to reference the consensus-active validators.
func (Keeper) UnbondingCanComplete ¶
func (Keeper) UpdateAllowlist ¶
UpdateAllowlist populates the allowlist store for the consumer chain with this consumer id
func (Keeper) UpdateAllowlistedRewardDenoms ¶ added in v6.2.0
func (k Keeper) UpdateAllowlistedRewardDenoms(ctx sdk.Context, consumerId string, rewardDenoms []string) error
UpdateAllowlistedRewardDenoms updates the allowlisted reward denoms for this consumer chain with the provided `rewardDenoms`
func (Keeper) UpdateDenylist ¶
UpdateDenylist populates the denylist store for the consumer chain with this consumer id
func (Keeper) UpdateMinimumPowerInTopN ¶
func (k Keeper) UpdateMinimumPowerInTopN(ctx sdk.Context, consumerId string, oldTopN, newTopN uint32) error
UpdateMinimumPowerInTopN populates the minimum power in Top N for the consumer chain with this consumer id
func (Keeper) ValidateSlashPacket ¶
func (k Keeper) ValidateSlashPacket(ctx sdk.Context, consumerId string, packet channeltypes.Packet, data ccv.SlashPacketData, ) error
ValidateSlashPacket validates a recv slash packet before it is handled or persisted in store. An error is returned if the packet is invalid, and an error ack should be relayed to the sender.
func (Keeper) ValidatorAddressCodec ¶
func (k Keeper) ValidatorAddressCodec() addresscodec.Codec
ValidatorAddressCodec returns the app validator address codec.
func (Keeper) ValidatorConsensusKeyInUse ¶
ValidatorConsensusKeyInUse checks if the given consensus key is already used by validator in a consumer chain. Note that this method is called when a new validator is created in the x/staking module of cosmos-sdk. In case it panics, the TX aborts and thus, the validator is not created. See AfterValidatorCreated hook.
func (Keeper) VerifyConsumerChain ¶
func (k Keeper) VerifyConsumerChain(ctx sdk.Context, channelID string, connectionHops []string) error
VerifyConsumerChain verifies that the chain trying to connect on the channel handshake is the expected consumer chain.
func (Keeper) VerifyDoubleVotingEvidence ¶
func (k Keeper) VerifyDoubleVotingEvidence( evidence tmtypes.DuplicateVoteEvidence, chainId string, pubkey cryptotypes.PubKey, ) error
VerifyDoubleVotingEvidence verifies a double voting evidence for a given chain id and a validator public key
Source Files ¶
- consumer_equivocation.go
- consumer_lifecycle.go
- distribution.go
- genesis.go
- grpc_query.go
- hooks.go
- invariants.go
- keeper.go
- key_assignment.go
- msg_server.go
- params.go
- partial_set_security.go
- permissionless.go
- power_shaping.go
- provider_consensus.go
- relay.go
- staking_keeper_interface.go
- throttle.go
- validator_set_storage.go
- validator_set_update.go