Documentation ¶
Index ¶
- type Keeper
- func (k Keeper) AppendMaturedUnbondingOps(ctx sdk.Context, ids []uint64) error
- func (k Keeper) AppendPendingVSC(ctx sdk.Context, chainID string, packet ccv.ValidatorSetChangePacketData)
- func (k Keeper) AppendSlashAck(ctx sdk.Context, chainID, ack string)
- func (k Keeper) AuthenticateCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) bool
- func (k Keeper) BindPort(ctx sdk.Context, portID string) error
- func (k Keeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error
- func (k Keeper) CloseChannel(ctx sdk.Context, channelID string)
- func (k Keeper) CompleteMaturedUnbondingOps(ctx sdk.Context)
- func (k Keeper) ConsumerGenesis(c context.Context, req *types.QueryConsumerGenesisRequest) (*types.QueryConsumerGenesisResponse, error)
- func (k Keeper) CreateConsumerChainProposal(ctx sdk.Context, p *types.CreateConsumerChainProposal) error
- func (k Keeper) CreateConsumerClient(ctx sdk.Context, chainID string, initialHeight clienttypes.Height, ...) error
- func (k Keeper) DeleteChainToChannel(ctx sdk.Context, chainID string)
- func (k Keeper) DeleteChannelToChain(ctx sdk.Context, channelID string)
- func (k Keeper) DeleteConsumerClientId(ctx sdk.Context, chainID string)
- func (k Keeper) DeleteInitChainHeight(ctx sdk.Context, chainID string)
- func (k Keeper) DeleteLockUnbondingOnTimeout(ctx sdk.Context, chainID string)
- func (k Keeper) DeletePendingCreateProposal(ctx sdk.Context, proposals ...types.CreateConsumerChainProposal)
- func (k Keeper) DeletePendingStopProposals(ctx sdk.Context, proposals ...types.StopConsumerChainProposal)
- func (k Keeper) DeleteUnbondingOp(ctx sdk.Context, id uint64)
- func (k Keeper) DeleteUnbondingOpIndex(ctx sdk.Context, chainID string, valsetUpdateID uint64)
- func (k Keeper) DeleteValsetUpdateBlockHeight(ctx sdk.Context, valsetUpdateId uint64)
- func (k Keeper) EmptyMaturedUnbondingOps(ctx sdk.Context) ([]uint64, error)
- func (k Keeper) EmptyPendingVSC(ctx sdk.Context, chainID string) (packets []ccv.ValidatorSetChangePacketData)
- func (k Keeper) EmptySlashAcks(ctx sdk.Context, chainID string) (acks []string)
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GetChainToChannel(ctx sdk.Context, chainID string) (string, bool)
- func (k Keeper) GetChannelToChain(ctx sdk.Context, channelID string) (string, bool)
- func (k Keeper) GetConsumerClientId(ctx sdk.Context, chainID string) (string, bool)
- func (k Keeper) GetConsumerGenesis(ctx sdk.Context, chainID string) (consumertypes.GenesisState, bool)
- func (k Keeper) GetFeeCollectorAddressStr(ctx sdk.Context) string
- func (k Keeper) GetInitChainHeight(ctx sdk.Context, chainID string) uint64
- func (k Keeper) GetLockUnbondingOnTimeout(ctx sdk.Context, chainID string) bool
- func (k Keeper) GetMaturedUnbondingOps(ctx sdk.Context) (ids []uint64, err error)
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k Keeper) GetPendingCreateProposal(ctx sdk.Context, timestamp time.Time, chainID string) types.CreateConsumerChainProposal
- func (k Keeper) GetPendingStopProposal(ctx sdk.Context, chainID string, timestamp time.Time) bool
- func (k Keeper) GetPendingVSCs(ctx sdk.Context, chainID string) (packets []ccv.ValidatorSetChangePacketData, found bool)
- func (k Keeper) GetPort(ctx sdk.Context) string
- func (k Keeper) GetSlashAcks(ctx sdk.Context, chainID string) []string
- func (k Keeper) GetTemplateClient(ctx sdk.Context) *ibctmtypes.ClientState
- func (k Keeper) GetUnbondingOp(ctx sdk.Context, id uint64) (ccv.UnbondingOp, bool)
- func (k Keeper) GetUnbondingOpIndex(ctx sdk.Context, chainID string, valsetUpdateID uint64) ([]uint64, bool)
- func (k Keeper) GetUnbondingOpsFromIndex(ctx sdk.Context, chainID string, valsetUpdateID uint64) (entries []ccv.UnbondingOp, found bool)
- func (k Keeper) GetValidatorSetUpdateId(ctx sdk.Context) (validatorSetUpdateId uint64)
- func (k Keeper) GetValsetUpdateBlockHeight(ctx sdk.Context, valsetUpdateId uint64) uint64
- func (k Keeper) HandleSlashPacket(ctx sdk.Context, chainID string, data ccv.SlashPacketData) (success bool, err error)
- func (k *Keeper) Hooks() StakingHooks
- func (k Keeper) IncrementValidatorSetUpdateId(ctx sdk.Context)
- func (k Keeper) InitGenesis(ctx sdk.Context, genState *types.GenesisState)
- func (k Keeper) IsBound(ctx sdk.Context, portID string) bool
- func (k Keeper) IterateChannelToChain(ctx sdk.Context, ...)
- func (k Keeper) IterateConsumerChains(ctx sdk.Context, cb func(ctx sdk.Context, chainID string) (stop bool))
- func (k Keeper) IterateOverUnbondingOpIndex(ctx sdk.Context, chainID string, cb func(vscID uint64, ubdIndex []uint64) bool)
- func (k Keeper) IteratePendingCreateProposal(ctx sdk.Context)
- func (k Keeper) IteratePendingStopProposal(ctx sdk.Context)
- func (k Keeper) IterateSlashAcks(ctx sdk.Context, cb func(chainID string, acks []string) bool)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MakeConsumerGenesis(ctx sdk.Context) (gen consumertypes.GenesisState, 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) exported.Acknowledgement
- func (k Keeper) OnRecvVSCMaturedPacket(ctx sdk.Context, packet channeltypes.Packet, data ccv.VSCMaturedPacketData) exported.Acknowledgement
- func (k Keeper) OnTimeoutPacket(ctx sdk.Context, packet channeltypes.Packet) error
- func (k Keeper) PendingCreateProposalIterator(ctx sdk.Context) sdk.Iterator
- func (k Keeper) PendingStopProposalIterator(ctx sdk.Context) sdk.Iterator
- func (k Keeper) SendPendingVSCPackets(ctx sdk.Context, chainID, channelID string)
- func (k Keeper) SendValidatorUpdates(ctx sdk.Context)
- func (k Keeper) SetChainToChannel(ctx sdk.Context, chainID, channelID string)
- func (k Keeper) SetChannelToChain(ctx sdk.Context, channelID, chainID string)
- func (k Keeper) SetConsumerChain(ctx sdk.Context, channelID string) error
- func (k Keeper) SetConsumerClientId(ctx sdk.Context, chainID, clientID string)
- func (k Keeper) SetConsumerGenesis(ctx sdk.Context, chainID string, gen consumertypes.GenesisState) error
- func (k Keeper) SetInitChainHeight(ctx sdk.Context, chainID string, height uint64)
- func (k Keeper) SetLockUnbondingOnTimeout(ctx sdk.Context, chainID string)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetPendingCreateProposal(ctx sdk.Context, clientInfo *types.CreateConsumerChainProposal) error
- func (k Keeper) SetPendingStopProposal(ctx sdk.Context, chainID string, timestamp time.Time)
- func (k Keeper) SetPort(ctx sdk.Context, portID string)
- func (k Keeper) SetSlashAcks(ctx sdk.Context, chainID string, acks []string)
- func (k Keeper) SetUnbondingOp(ctx sdk.Context, unbondingOp ccv.UnbondingOp) error
- func (k Keeper) SetUnbondingOpIndex(ctx sdk.Context, chainID string, valsetUpdateID uint64, IDs []uint64)
- func (k Keeper) SetValidatorSetUpdateId(ctx sdk.Context, valUpdateID uint64)
- func (k Keeper) SetValsetUpdateBlockHeight(ctx sdk.Context, valsetUpdateId, blockHeight uint64)
- func (k Keeper) StopConsumerChain(ctx sdk.Context, chainID string, lockUbd, closeChan bool) (err error)
- func (k Keeper) StopConsumerChainProposal(ctx sdk.Context, p *types.StopConsumerChainProposal) error
- func (k Keeper) VerifyConsumerChain(ctx sdk.Context, channelID string, connectionHops []string) error
- type StakingHooks
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 sdk.StoreKey, paramSpace paramtypes.Subspace, scopedKeeper capabilitykeeper.ScopedKeeper, channelKeeper ccv.ChannelKeeper, portKeeper ccv.PortKeeper, connectionKeeper ccv.ConnectionKeeper, clientKeeper ccv.ClientKeeper, stakingKeeper ccv.StakingKeeper, slashingKeeper ccv.SlashingKeeper, accountKeeper ccv.AccountKeeper, feeCollectorName string, ) Keeper
NewKeeper creates a new provider Keeper instance
func (Keeper) AppendMaturedUnbondingOps ¶
AppendMaturedUnbondingOps adds a list of ids to the list of matured unbonding operation ids
func (Keeper) AppendPendingVSC ¶
func (k Keeper) AppendPendingVSC(ctx sdk.Context, chainID string, packet ccv.ValidatorSetChangePacketData)
AppendPendingVSC adds the given ValidatorSetChange packet to the list of pending ValidatorSetChange packets stored under chain ID
func (Keeper) AppendSlashAck ¶
AppendSlashAck appends the given slash ack to the given chain ID slash acks in store
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) BindPort ¶
BindPort defines a wrapper function for the ort Keeper's function in order to expose it to module's InitGenesis function
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) CloseChannel ¶
CloseChannel closes the channel for the given channel ID on the condition that the channel exists and isn't already in the CLOSED state
func (Keeper) CompleteMaturedUnbondingOps ¶
CompleteMaturedUnbondingOps attempts to complete all matured unbonding operations
func (Keeper) ConsumerGenesis ¶
func (k Keeper) ConsumerGenesis(c context.Context, req *types.QueryConsumerGenesisRequest) (*types.QueryConsumerGenesisResponse, error)
func (Keeper) CreateConsumerChainProposal ¶
func (k Keeper) CreateConsumerChainProposal(ctx sdk.Context, p *types.CreateConsumerChainProposal) error
CreateConsumerChainProposal will receive the consumer chain's client state from the proposal. If the spawn time has already passed, then set the consumer chain. Otherwise store the client as a pending client, and set once spawn time has passed.
func (Keeper) CreateConsumerClient ¶
func (k Keeper) CreateConsumerClient(ctx sdk.Context, chainID string, initialHeight clienttypes.Height, lockUbdOnTimeout bool) 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) DeleteChainToChannel ¶
DeleteChainToChannel deletes the CCV channel ID for the given consumer chain ID
func (Keeper) DeleteChannelToChain ¶
DeleteChannelToChain deletes the consumer chain ID for a given CCV channe lID
func (Keeper) DeleteConsumerClientId ¶
DeleteConsumerClientId removes from the store the clientID for the given chainID.
func (Keeper) DeleteInitChainHeight ¶
DeleteInitChainHeight deletes the block height value for which the given consumer chain's channel was established
func (Keeper) DeleteLockUnbondingOnTimeout ¶
DeleteLockUnbondingOnTimeout deletes the unbonding operation lock in case of a CCV channel timeouts for the given consumer chain ID
func (Keeper) DeletePendingCreateProposal ¶
func (k Keeper) DeletePendingCreateProposal(ctx sdk.Context, proposals ...types.CreateConsumerChainProposal)
DeletePendingCreateProposal deletes the given create consumer proposals
func (Keeper) DeletePendingStopProposals ¶
func (k Keeper) DeletePendingStopProposals(ctx sdk.Context, proposals ...types.StopConsumerChainProposal)
DeletePendingStopProposals deletes the given stop proposals
func (Keeper) DeleteUnbondingOpIndex ¶
This index allows retreiving UnbondingDelegationEntries by chainID and valsetUpdateID
func (Keeper) DeleteValsetUpdateBlockHeight ¶
DeleteValsetUpdateBlockHeight deletes the block height value for a given vaset update id
func (Keeper) EmptyMaturedUnbondingOps ¶
EmptyMaturedUnbondingOps empties and returns list of matured unbonding operation ids (if it exists)
func (Keeper) EmptyPendingVSC ¶
func (k Keeper) EmptyPendingVSC(ctx sdk.Context, chainID string) (packets []ccv.ValidatorSetChangePacketData)
EmptyPendingVSC empties and returns the list of pending ValidatorSetChange packets for chain ID (if it exists)
func (Keeper) EmptySlashAcks ¶
EmptySlashAcks empties and returns the slash acks for a given chain ID
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
func (Keeper) GetChainToChannel ¶
GetChainToChannel gets the CCV channelID for the given consumer chainID
func (Keeper) GetChannelToChain ¶
GetChannelToChain gets the consumer chainID for a given CCV channelID
func (Keeper) GetConsumerClientId ¶
GetConsumerClientId returns the client ID for the given chain ID.
func (Keeper) GetConsumerGenesis ¶
func (k Keeper) GetConsumerGenesis(ctx sdk.Context, chainID string) (consumertypes.GenesisState, bool)
func (Keeper) GetFeeCollectorAddressStr ¶
func (Keeper) GetInitChainHeight ¶
GetInitChainHeight returns the provider block height when the given consumer chain was initiated
func (Keeper) GetLockUnbondingOnTimeout ¶
GetLockUnbondingOnTimeout returns the mapping from the given consumer chain ID to a boolean value indicating whether the unbonding operation funds should be locked on CCV channel timeout
func (Keeper) GetMaturedUnbondingOps ¶
GetMaturedUnbondingOps returns the list of matured unbonding operation ids
func (Keeper) GetPendingCreateProposal ¶
func (k Keeper) GetPendingCreateProposal(ctx sdk.Context, timestamp time.Time, chainID string) types.CreateConsumerChainProposal
GetPendingCreateProposal retrieves a pending proposal to create a consumer chain client (by spawn time and chain id)
func (Keeper) GetPendingStopProposal ¶
GetPendingStopProposal returns a boolean if a pending stop proposal exists for the given consumer chain ID and the timestamp
func (Keeper) GetPendingVSCs ¶
func (k Keeper) GetPendingVSCs(ctx sdk.Context, chainID string) (packets []ccv.ValidatorSetChangePacketData, found bool)
GetPendingVSCs returns the list of pending ValidatorSetChange packets stored under chain ID
func (Keeper) GetSlashAcks ¶
GetSlashAcks returns the slash acks stored under the given chain ID
func (Keeper) GetTemplateClient ¶
func (k Keeper) GetTemplateClient(ctx sdk.Context) *ibctmtypes.ClientState
GetTemplateClient returns the template client for provider proposals
func (Keeper) GetUnbondingOp ¶
Get UnbondingOp by unique ID
func (Keeper) GetUnbondingOpIndex ¶
func (k Keeper) GetUnbondingOpIndex(ctx sdk.Context, chainID string, valsetUpdateID uint64) ([]uint64, bool)
This index allows retrieving UnbondingDelegationEntries by chainID and valsetUpdateID
func (Keeper) GetUnbondingOpsFromIndex ¶
func (k Keeper) GetUnbondingOpsFromIndex(ctx sdk.Context, chainID string, valsetUpdateID uint64) (entries []ccv.UnbondingOp, found bool)
Retrieve UnbondingDelegationEntries by chainID and valsetUpdateID
func (Keeper) GetValidatorSetUpdateId ¶
func (Keeper) GetValsetUpdateBlockHeight ¶
GetValsetUpdateBlockHeight gets the block height for a given valset update id
func (Keeper) HandleSlashPacket ¶
func (k Keeper) HandleSlashPacket(ctx sdk.Context, chainID string, data ccv.SlashPacketData) (success bool, err error)
HandleSlashPacket slash and jail a misbehaving validator according the infraction type
func (Keeper) IncrementValidatorSetUpdateId ¶
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, genState *types.GenesisState)
func (Keeper) IterateChannelToChain ¶
func (k Keeper) IterateChannelToChain(ctx sdk.Context, cb func(ctx sdk.Context, channelID, chainID string) (stop bool))
IterateChannelToChain iterates over the channel to chain mappings and calls the provided callback until the iteration ends or the callback returns stop=true
func (Keeper) IterateConsumerChains ¶
func (k Keeper) IterateConsumerChains(ctx sdk.Context, cb func(ctx sdk.Context, chainID string) (stop bool))
IterateConsumerChains iterates over all of the consumer chains that the provider module controls. It calls the provided callback function which takes in a chainID and returns a stop boolean which will stop the iteration.
func (Keeper) IterateOverUnbondingOpIndex ¶
func (k Keeper) IterateOverUnbondingOpIndex(ctx sdk.Context, chainID string, cb func(vscID uint64, ubdIndex []uint64) bool)
IterateOverUnbondingOpIndex iterates over the unbonding indexes for a given chain id.
func (Keeper) IteratePendingCreateProposal ¶
IteratePendingCreateProposal iterates over the pending proposals to create consumer chain clients in order and creates the consumer client if the spawn time has passed, otherwise it will break out of loop and return.
func (Keeper) IteratePendingStopProposal ¶
IteratePendingStopProposal iterates over the pending stop proposals in order and stop the chain if the stop time has passed, otherwise it will break out of loop and return.
func (Keeper) IterateSlashAcks ¶
IterateSlashAcks iterates through the slash acks set in the store
func (Keeper) MakeConsumerGenesis ¶
func (k Keeper) MakeConsumerGenesis(ctx sdk.Context) (gen consumertypes.GenesisState, err error)
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) exported.Acknowledgement
OnRecvSlashPacket slashes and jails the given validator in the packet data
func (Keeper) OnRecvVSCMaturedPacket ¶
func (k Keeper) OnRecvVSCMaturedPacket( ctx sdk.Context, packet channeltypes.Packet, data ccv.VSCMaturedPacketData, ) exported.Acknowledgement
OnRecvVSCMaturedPacket handles a VSCMatured packet
func (Keeper) OnTimeoutPacket ¶
OnTimeoutPacket aborts the transaction if no chain exists for the destination channel, otherwise it stops the chain
func (Keeper) PendingCreateProposalIterator ¶
func (Keeper) PendingStopProposalIterator ¶
func (Keeper) SendPendingVSCPackets ¶
Sends all pending ValidatorSetChangePackets to the specified chain
func (Keeper) SendValidatorUpdates ¶
SendValidatorUpdates sends latest validator updates to every registered consumer chain
func (Keeper) SetChainToChannel ¶
SetChainToChannel sets the mapping from a consumer chainID to the CCV channel ID for that consumer chain.
func (Keeper) SetChannelToChain ¶
SetChannelToChain sets the mapping from the CCV channel ID to the consumer chainID.
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.
func (Keeper) SetConsumerClientId ¶
SetConsumerClientId sets the client ID for the given chain ID
func (Keeper) SetConsumerGenesis ¶
func (k Keeper) SetConsumerGenesis(ctx sdk.Context, chainID string, gen consumertypes.GenesisState) error
func (Keeper) SetInitChainHeight ¶
SetInitChainHeight sets the provider block height when the given consumer chain was initiated
func (Keeper) SetLockUnbondingOnTimeout ¶
SetLockUnbondingOnTimeout locks the unbonding operation funds in case of a CCV channel timeouts for the given consumer chain ID
func (Keeper) SetPendingCreateProposal ¶
func (k Keeper) SetPendingCreateProposal(ctx sdk.Context, clientInfo *types.CreateConsumerChainProposal) error
SetPendingCreateProposal stores a pending proposal to create a consumer chain client
func (Keeper) SetPendingStopProposal ¶
SetPendingStopProposal sets the consumer chain ID for the given timestamp
func (Keeper) SetSlashAcks ¶
SetSlashAcks sets the slash acks under the given chain ID
func (Keeper) SetUnbondingOp ¶
Save UnbondingOp by unique ID
func (Keeper) SetUnbondingOpIndex ¶
func (k Keeper) SetUnbondingOpIndex(ctx sdk.Context, chainID string, valsetUpdateID uint64, IDs []uint64)
This index allows retreiving UnbondingDelegationEntries by chainID and valsetUpdateID
func (Keeper) SetValidatorSetUpdateId ¶
func (Keeper) SetValsetUpdateBlockHeight ¶
SetValsetUpdateBlockHeight sets the block height for a given valset update id
func (Keeper) StopConsumerChain ¶
func (k Keeper) StopConsumerChain(ctx sdk.Context, chainID string, lockUbd, closeChan bool) (err error)
StopConsumerChain cleans up the states for the given consumer chain ID and, if the given lockUbd is false, it completes the outstanding unbonding operations lock by the consumer chain.
func (Keeper) StopConsumerChainProposal ¶
func (k Keeper) StopConsumerChainProposal(ctx sdk.Context, p *types.StopConsumerChainProposal) error
StopConsumerChainProposal stops a consumer chain and released the outstanding unbonding operations. If the stop time hasn't already passed, it stores the proposal as a pending proposal.
type StakingHooks ¶
type StakingHooks struct { stakingtypes.StakingHooksTemplate // contains filtered or unexported fields }
func (StakingHooks) AfterUnbondingInitiated ¶
func (h StakingHooks) AfterUnbondingInitiated(ctx sdk.Context, ID uint64)
This stores a record of each unbonding op from staking, allowing us to track which consumer chains have unbonded