Documentation ¶
Index ¶
- Constants
- Variables
- func CalculateTrustPeriod(unbondingPeriod time.Duration, defaultTrustPeriodFraction string) (time.Duration, error)
- func RegisterInterfaces(registry codectypes.InterfaceRegistry)
- func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
- func RegisterMsgServer(s grpc1.Server, srv MsgServer)
- func RegisterQueryServer(s grpc1.Server, srv QueryServer)
- func ValidateBech32(i interface{}) error
- func ValidateBool(i interface{}) error
- func ValidateChannelIdentifier(i interface{}) error
- func ValidateDuration(i interface{}) error
- func ValidateInt64(i interface{}) error
- func ValidatePositiveInt64(i interface{}) error
- func ValidateString(i interface{}) error
- func ValidateStringFraction(i interface{}) error
- type AccountKeeper
- type BankKeeper
- type ChannelKeeper
- type ClientKeeper
- type ConnectionKeeper
- type ConsumerHooks
- type ConsumerPacketData
- func (*ConsumerPacketData) Descriptor() ([]byte, []int)
- func (cp ConsumerPacketData) GetBytes() []byte
- func (m *ConsumerPacketData) GetData() isConsumerPacketData_Data
- func (m *ConsumerPacketData) GetSlashPacketData() *SlashPacketData
- func (m *ConsumerPacketData) GetType() ConsumerPacketDataType
- func (m *ConsumerPacketData) GetVscMaturedPacketData() *VSCMaturedPacketData
- func (m *ConsumerPacketData) Marshal() (dAtA []byte, err error)
- func (m *ConsumerPacketData) MarshalTo(dAtA []byte) (int, error)
- func (m *ConsumerPacketData) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ConsumerPacketData) ProtoMessage()
- func (m *ConsumerPacketData) Reset()
- func (m *ConsumerPacketData) Size() (n int)
- func (m *ConsumerPacketData) String() string
- func (m *ConsumerPacketData) Unmarshal(dAtA []byte) error
- func (cp ConsumerPacketData) ValidateBasic() (err error)
- func (m *ConsumerPacketData) XXX_DiscardUnknown()
- func (m *ConsumerPacketData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ConsumerPacketData) XXX_Merge(src proto.Message)
- func (*ConsumerPacketData) XXX_OneofWrappers() []interface{}
- func (m *ConsumerPacketData) XXX_Size() int
- func (m *ConsumerPacketData) XXX_Unmarshal(b []byte) error
- type ConsumerPacketDataList
- func (*ConsumerPacketDataList) Descriptor() ([]byte, []int)
- func (m *ConsumerPacketDataList) GetList() []ConsumerPacketData
- func (m *ConsumerPacketDataList) Marshal() (dAtA []byte, err error)
- func (m *ConsumerPacketDataList) MarshalTo(dAtA []byte) (int, error)
- func (m *ConsumerPacketDataList) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ConsumerPacketDataList) ProtoMessage()
- func (m *ConsumerPacketDataList) Reset()
- func (m *ConsumerPacketDataList) Size() (n int)
- func (m *ConsumerPacketDataList) String() string
- func (m *ConsumerPacketDataList) Unmarshal(dAtA []byte) error
- func (m *ConsumerPacketDataList) XXX_DiscardUnknown()
- func (m *ConsumerPacketDataList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ConsumerPacketDataList) XXX_Merge(src proto.Message)
- func (m *ConsumerPacketDataList) XXX_Size() int
- func (m *ConsumerPacketDataList) XXX_Unmarshal(b []byte) error
- type ConsumerPacketDataType
- type ConsumerPacketData_SlashPacketData
- type ConsumerPacketData_VscMaturedPacketData
- type IBCCoreKeeper
- type IBCTransferKeeper
- type MaturedUnbondingOps
- func (*MaturedUnbondingOps) Descriptor() ([]byte, []int)
- func (m *MaturedUnbondingOps) GetIds() []uint64
- func (m *MaturedUnbondingOps) Marshal() (dAtA []byte, err error)
- func (m *MaturedUnbondingOps) MarshalTo(dAtA []byte) (int, error)
- func (m *MaturedUnbondingOps) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MaturedUnbondingOps) ProtoMessage()
- func (m *MaturedUnbondingOps) Reset()
- func (m *MaturedUnbondingOps) Size() (n int)
- func (m *MaturedUnbondingOps) String() string
- func (m *MaturedUnbondingOps) Unmarshal(dAtA []byte) error
- func (m *MaturedUnbondingOps) XXX_DiscardUnknown()
- func (m *MaturedUnbondingOps) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MaturedUnbondingOps) XXX_Merge(src proto.Message)
- func (m *MaturedUnbondingOps) XXX_Size() int
- func (m *MaturedUnbondingOps) XXX_Unmarshal(b []byte) error
- type MsgClient
- type MsgServer
- type PortKeeper
- type QueryClient
- type QueryServer
- type ScopedKeeper
- type SlashPacketData
- func (*SlashPacketData) Descriptor() ([]byte, []int)
- func (vdt SlashPacketData) GetBytes() []byte
- func (m *SlashPacketData) GetInfraction() types1.InfractionType
- func (m *SlashPacketData) GetValidator() types.Validator
- func (m *SlashPacketData) GetValsetUpdateId() uint64
- func (m *SlashPacketData) Marshal() (dAtA []byte, err error)
- func (m *SlashPacketData) MarshalTo(dAtA []byte) (int, error)
- func (m *SlashPacketData) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*SlashPacketData) ProtoMessage()
- func (m *SlashPacketData) Reset()
- func (m *SlashPacketData) Size() (n int)
- func (m *SlashPacketData) String() string
- func (m *SlashPacketData) Unmarshal(dAtA []byte) error
- func (vdt SlashPacketData) ValidateBasic() error
- func (m *SlashPacketData) XXX_DiscardUnknown()
- func (m *SlashPacketData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *SlashPacketData) XXX_Merge(src proto.Message)
- func (m *SlashPacketData) XXX_Size() int
- func (m *SlashPacketData) XXX_Unmarshal(b []byte) error
- type SlashingKeeper
- type StakingKeeper
- type UnimplementedMsgServer
- type UnimplementedQueryServer
- type VSCMaturedPacketData
- func (*VSCMaturedPacketData) Descriptor() ([]byte, []int)
- func (mat VSCMaturedPacketData) GetBytes() []byte
- func (m *VSCMaturedPacketData) GetValsetUpdateId() uint64
- func (m *VSCMaturedPacketData) Marshal() (dAtA []byte, err error)
- func (m *VSCMaturedPacketData) MarshalTo(dAtA []byte) (int, error)
- func (m *VSCMaturedPacketData) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*VSCMaturedPacketData) ProtoMessage()
- func (m *VSCMaturedPacketData) Reset()
- func (m *VSCMaturedPacketData) Size() (n int)
- func (m *VSCMaturedPacketData) String() string
- func (m *VSCMaturedPacketData) Unmarshal(dAtA []byte) error
- func (mat VSCMaturedPacketData) ValidateBasic() error
- func (m *VSCMaturedPacketData) XXX_DiscardUnknown()
- func (m *VSCMaturedPacketData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *VSCMaturedPacketData) XXX_Merge(src proto.Message)
- func (m *VSCMaturedPacketData) XXX_Size() int
- func (m *VSCMaturedPacketData) XXX_Unmarshal(b []byte) error
- type ValidatorSetChangePacketData
- func (*ValidatorSetChangePacketData) Descriptor() ([]byte, []int)
- func (vsc ValidatorSetChangePacketData) GetBytes() []byte
- func (m *ValidatorSetChangePacketData) GetSlashAcks() []string
- func (m *ValidatorSetChangePacketData) GetValidatorUpdates() []types.ValidatorUpdate
- func (m *ValidatorSetChangePacketData) GetValsetUpdateId() uint64
- func (m *ValidatorSetChangePacketData) Marshal() (dAtA []byte, err error)
- func (m *ValidatorSetChangePacketData) MarshalTo(dAtA []byte) (int, error)
- func (m *ValidatorSetChangePacketData) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ValidatorSetChangePacketData) ProtoMessage()
- func (m *ValidatorSetChangePacketData) Reset()
- func (m *ValidatorSetChangePacketData) Size() (n int)
- func (m *ValidatorSetChangePacketData) String() string
- func (m *ValidatorSetChangePacketData) Unmarshal(dAtA []byte) error
- func (vsc ValidatorSetChangePacketData) ValidateBasic() error
- func (m *ValidatorSetChangePacketData) XXX_DiscardUnknown()
- func (m *ValidatorSetChangePacketData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ValidatorSetChangePacketData) XXX_Merge(src proto.Message)
- func (m *ValidatorSetChangePacketData) XXX_Size() int
- func (m *ValidatorSetChangePacketData) XXX_Unmarshal(b []byte) error
- type ValidatorSetChangePackets
- func (*ValidatorSetChangePackets) Descriptor() ([]byte, []int)
- func (m *ValidatorSetChangePackets) GetList() []ValidatorSetChangePacketData
- func (m *ValidatorSetChangePackets) Marshal() (dAtA []byte, err error)
- func (m *ValidatorSetChangePackets) MarshalTo(dAtA []byte) (int, error)
- func (m *ValidatorSetChangePackets) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ValidatorSetChangePackets) ProtoMessage()
- func (m *ValidatorSetChangePackets) Reset()
- func (m *ValidatorSetChangePackets) Size() (n int)
- func (m *ValidatorSetChangePackets) String() string
- func (m *ValidatorSetChangePackets) Unmarshal(dAtA []byte) error
- func (m *ValidatorSetChangePackets) XXX_DiscardUnknown()
- func (m *ValidatorSetChangePackets) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ValidatorSetChangePackets) XXX_Merge(src proto.Message)
- func (m *ValidatorSetChangePackets) XXX_Size() int
- func (m *ValidatorSetChangePackets) XXX_Unmarshal(b []byte) error
Constants ¶
const ( EventTypeTimeout = "timeout" EventTypePacket = "ccv_packet" EventTypeChannelEstablished = "channel_established" EventTypeFeeTransferChannelOpened = "fee_transfer_channel_opened" EventTypeConsumerClientCreated = "consumer_client_created" EventTypeAssignConsumerKey = "assign_consumer_key" EventTypeExecuteConsumerChainSlash = "execute_consumer_chain_slash" EventTypeFeeDistribution = "fee_distribution" EventTypeConsumerSlashRequest = "consumer_slash_request" EventTypeVSCMatured = "vsc_matured" AttributeKeyAckSuccess = "success" AttributeKeyAck = "acknowledgement" AttributeKeyAckError = "error" AttributeChainID = "chain_id" AttributeValidatorAddress = "validator_address" AttributeValidatorConsumerAddress = "validator_consumer_address" AttributeInfractionType = "infraction_type" AttributeInfractionHeight = "infraction_height" AttributeConsumerHeight = "consumer_height" AttributeValSetUpdateID = "valset_update_id" AttributeTimestamp = "timestamp" AttributeInitialHeight = "initial_height" AttributeInitializationTimeout = "initialization_timeout" AttributeTrustingPeriod = "trusting_period" AttributeUnbondingPeriod = "unbonding_period" AttributeProviderValidatorAddress = "provider_validator_address" AttributeConsumerConsensusPubKey = "consumer_consensus_pub_key" AttributeDistributionCurrentHeight = "current_distribution_height" AttributeDistributionNextHeight = "next_distribution_height" AttributeDistributionFraction = "distribution_fraction" AttributeDistributionTotal = "total" AttributeDistributionToProvider = "provider_amount" )
CCV events
const ( // ModuleName defines the CCV module name ModuleName = "CCV" // Version defines the current version the IBC CCV provider and consumer // module supports Version = "1" // ProviderPortID is the default port id the provider CCV module binds to ProviderPortID = "provider" // ConsumerPortID is the default port id the consumer CCV module binds to ConsumerPortID = "consumer" RouterKey = ModuleName // StoreKey defines the primary module store key StoreKey = ModuleName // MemStoreKey defines the in-memory store key MemStoreKey = "mem_ccv" )
const ( // Default timeout period is 4 weeks to ensure channel doesn't close on timeout DefaultCCVTimeoutPeriod = 4 * 7 * 24 * time.Hour )
Variables ¶
var ( ErrInvalidLengthCcv = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowCcv = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupCcv = fmt.Errorf("proto: unexpected end of group") )
var ( // ModuleCdc references the global x/ibc-transfer module codec. Note, the codec // should ONLY be used in certain instances of tests and for JSON encoding. // // The actual codec used for serialization should be provided to x/ibc transfer and // defined at the application level. ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) // AminoCdc is a amino codec created to support amino json compatible msgs. AminoCdc = codec.NewAminoCodec(amino) )
var ( ErrInvalidPacketData = sdkerrors.Register(ModuleName, 2, "invalid CCV packet data") ErrInvalidPacketTimeout = sdkerrors.Register(ModuleName, 3, "invalid packet timeout") ErrInvalidVersion = sdkerrors.Register(ModuleName, 4, "invalid CCV version") ErrInvalidChannelFlow = sdkerrors.Register(ModuleName, 5, "invalid message sent to channel end") ErrInvalidConsumerChain = sdkerrors.Register(ModuleName, 6, "invalid consumer chain") ErrInvalidProviderChain = sdkerrors.Register(ModuleName, 7, "invalid provider chain") ErrInvalidStatus = sdkerrors.Register(ModuleName, 8, "invalid channel status") ErrInvalidGenesis = sdkerrors.Register(ModuleName, 9, "invalid genesis state") ErrDuplicateChannel = sdkerrors.Register(ModuleName, 10, "CCV channel already exists") ErrInvalidVSCMaturedId = sdkerrors.Register(ModuleName, 11, "invalid vscId for VSC packet") ErrInvalidVSCMaturedTime = sdkerrors.Register(ModuleName, 12, "invalid maturity time for VSC packet") ErrInvalidConsumerState = sdkerrors.Register(ModuleName, 13, "provider chain has invalid state for consumer chain") ErrInvalidConsumerClient = sdkerrors.Register(ModuleName, 14, "ccv channel is not built on correct client") ErrInvalidProposal = sdkerrors.Register(ModuleName, 15, "invalid proposal") ErrInvalidHandshakeMetadata = sdkerrors.Register(ModuleName, 16, "invalid provider handshake metadata") ErrChannelNotFound = sdkerrors.Register(ModuleName, 17, "channel not found") ErrClientNotFound = sdkerrors.Register(ModuleName, 18, "client not found") ErrDuplicateConsumerChain = sdkerrors.Register(ModuleName, 19, "consumer chain already exists") ErrConsumerChainNotFound = sdkerrors.Register(ModuleName, 20, "consumer chain not found") )
CCV sentinel errors
var ConsumerPacketDataType_name = map[int32]string{
0: "CONSUMER_PACKET_TYPE_UNSPECIFIED",
1: "CONSUMER_PACKET_TYPE_SLASH",
2: "CONSUMER_PACKET_TYPE_VSCM",
}
var ConsumerPacketDataType_value = map[string]int32{
"CONSUMER_PACKET_TYPE_UNSPECIFIED": 0,
"CONSUMER_PACKET_TYPE_SLASH": 1,
"CONSUMER_PACKET_TYPE_VSCM": 2,
}
var (
KeyCCVTimeoutPeriod = []byte("CcvTimeoutPeriod")
)
Functions ¶
func CalculateTrustPeriod ¶ added in v1.0.0
func RegisterInterfaces ¶
func RegisterInterfaces(registry codectypes.InterfaceRegistry)
RegisterInterfaces register the ibc transfer module interfaces to protobuf Any.
func RegisterLegacyAminoCodec ¶
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
RegisterLegacyAminoCodec registers the necessary x/ibc transfer interfaces and concrete types on the provided LegacyAmino codec. These types are used for Amino JSON serialization.
func RegisterMsgServer ¶
func RegisterQueryServer ¶
func RegisterQueryServer(s grpc1.Server, srv QueryServer)
func ValidateBech32 ¶ added in v0.2.0
func ValidateBech32(i interface{}) error
func ValidateBool ¶ added in v0.2.0
func ValidateBool(i interface{}) error
func ValidateChannelIdentifier ¶ added in v0.2.0
func ValidateChannelIdentifier(i interface{}) error
func ValidateDuration ¶ added in v0.2.0
func ValidateDuration(i interface{}) error
func ValidateInt64 ¶ added in v0.2.0
func ValidateInt64(i interface{}) error
func ValidatePositiveInt64 ¶ added in v0.2.0
func ValidatePositiveInt64(i interface{}) error
func ValidateString ¶ added in v0.2.0
func ValidateString(i interface{}) error
func ValidateStringFraction ¶ added in v1.0.0
func ValidateStringFraction(i interface{}) error
Types ¶
type AccountKeeper ¶
type AccountKeeper interface {
GetModuleAccount(ctx sdk.Context, name string) auth.ModuleAccountI
}
AccountKeeper defines the expected account keeper used for simulations
type BankKeeper ¶
type BankKeeper interface { GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) error }
BankKeeper defines the expected interface needed to retrieve account balances.
type ChannelKeeper ¶
type ChannelKeeper interface { GetChannel(ctx sdk.Context, srcPort, srcChan string) (channel channeltypes.Channel, found bool) GetNextSequenceSend(ctx sdk.Context, portID, channelID string) (uint64, bool) SendPacket(ctx sdk.Context, channelCap *capabilitytypes.Capability, packet ibcexported.PacketI) error WriteAcknowledgement(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet ibcexported.PacketI, acknowledgement ibcexported.Acknowledgement) error ChanCloseInit(ctx sdk.Context, portID, channelID string, chanCap *capabilitytypes.Capability) error }
ChannelKeeper defines the expected IBC channel keeper
type ClientKeeper ¶
type ClientKeeper interface { CreateClient(ctx sdk.Context, clientState ibcexported.ClientState, consensusState ibcexported.ConsensusState) (string, error) GetClientState(ctx sdk.Context, clientID string) (ibcexported.ClientState, bool) GetLatestClientConsensusState(ctx sdk.Context, clientID string) (ibcexported.ConsensusState, bool) GetSelfConsensusState(ctx sdk.Context, height ibcexported.Height) (ibcexported.ConsensusState, error) }
ClientKeeper defines the expected IBC client keeper
type ConnectionKeeper ¶
type ConnectionKeeper interface {
GetConnection(ctx sdk.Context, connectionID string) (conntypes.ConnectionEnd, bool)
}
ConnectionKeeper defines the expected IBC connection keeper
type ConsumerHooks ¶
type ConsumerHooks interface {
AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, _ sdk.ValAddress)
}
ConsumerHooks event hooks for newly bonded cross-chain validators
type ConsumerPacketData ¶ added in v1.0.0
type ConsumerPacketData struct { Type ConsumerPacketDataType `protobuf:"varint,1,opt,name=type,proto3,enum=interchain_security.ccv.v1.ConsumerPacketDataType" json:"type,omitempty"` // Types that are valid to be assigned to Data: // *ConsumerPacketData_SlashPacketData // *ConsumerPacketData_VscMaturedPacketData Data isConsumerPacketData_Data `protobuf_oneof:"data"` }
ConsumerPacketData contains a consumer packet data and a type tag
func (*ConsumerPacketData) Descriptor ¶ added in v1.0.0
func (*ConsumerPacketData) Descriptor() ([]byte, []int)
func (ConsumerPacketData) GetBytes ¶ added in v1.0.0
func (cp ConsumerPacketData) GetBytes() []byte
func (*ConsumerPacketData) GetData ¶ added in v1.0.0
func (m *ConsumerPacketData) GetData() isConsumerPacketData_Data
func (*ConsumerPacketData) GetSlashPacketData ¶ added in v1.0.0
func (m *ConsumerPacketData) GetSlashPacketData() *SlashPacketData
func (*ConsumerPacketData) GetType ¶ added in v1.0.0
func (m *ConsumerPacketData) GetType() ConsumerPacketDataType
func (*ConsumerPacketData) GetVscMaturedPacketData ¶ added in v1.0.0
func (m *ConsumerPacketData) GetVscMaturedPacketData() *VSCMaturedPacketData
func (*ConsumerPacketData) Marshal ¶ added in v1.0.0
func (m *ConsumerPacketData) Marshal() (dAtA []byte, err error)
func (*ConsumerPacketData) MarshalTo ¶ added in v1.0.0
func (m *ConsumerPacketData) MarshalTo(dAtA []byte) (int, error)
func (*ConsumerPacketData) MarshalToSizedBuffer ¶ added in v1.0.0
func (m *ConsumerPacketData) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ConsumerPacketData) ProtoMessage ¶ added in v1.0.0
func (*ConsumerPacketData) ProtoMessage()
func (*ConsumerPacketData) Reset ¶ added in v1.0.0
func (m *ConsumerPacketData) Reset()
func (*ConsumerPacketData) Size ¶ added in v1.0.0
func (m *ConsumerPacketData) Size() (n int)
func (*ConsumerPacketData) String ¶ added in v1.0.0
func (m *ConsumerPacketData) String() string
func (*ConsumerPacketData) Unmarshal ¶ added in v1.0.0
func (m *ConsumerPacketData) Unmarshal(dAtA []byte) error
func (ConsumerPacketData) ValidateBasic ¶ added in v1.0.0
func (cp ConsumerPacketData) ValidateBasic() (err error)
func (*ConsumerPacketData) XXX_DiscardUnknown ¶ added in v1.0.0
func (m *ConsumerPacketData) XXX_DiscardUnknown()
func (*ConsumerPacketData) XXX_Marshal ¶ added in v1.0.0
func (m *ConsumerPacketData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ConsumerPacketData) XXX_Merge ¶ added in v1.0.0
func (m *ConsumerPacketData) XXX_Merge(src proto.Message)
func (*ConsumerPacketData) XXX_OneofWrappers ¶ added in v1.0.0
func (*ConsumerPacketData) XXX_OneofWrappers() []interface{}
XXX_OneofWrappers is for the internal use of the proto package.
func (*ConsumerPacketData) XXX_Size ¶ added in v1.0.0
func (m *ConsumerPacketData) XXX_Size() int
func (*ConsumerPacketData) XXX_Unmarshal ¶ added in v1.0.0
func (m *ConsumerPacketData) XXX_Unmarshal(b []byte) error
type ConsumerPacketDataList ¶ added in v1.0.0
type ConsumerPacketDataList struct {
List []ConsumerPacketData `protobuf:"bytes,1,rep,name=list,proto3" json:"list"`
}
ConsumerPacketDataList is a list of consumer packet data packets.
func (*ConsumerPacketDataList) Descriptor ¶ added in v1.0.0
func (*ConsumerPacketDataList) Descriptor() ([]byte, []int)
func (*ConsumerPacketDataList) GetList ¶ added in v1.0.0
func (m *ConsumerPacketDataList) GetList() []ConsumerPacketData
func (*ConsumerPacketDataList) Marshal ¶ added in v1.0.0
func (m *ConsumerPacketDataList) Marshal() (dAtA []byte, err error)
func (*ConsumerPacketDataList) MarshalTo ¶ added in v1.0.0
func (m *ConsumerPacketDataList) MarshalTo(dAtA []byte) (int, error)
func (*ConsumerPacketDataList) MarshalToSizedBuffer ¶ added in v1.0.0
func (m *ConsumerPacketDataList) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ConsumerPacketDataList) ProtoMessage ¶ added in v1.0.0
func (*ConsumerPacketDataList) ProtoMessage()
func (*ConsumerPacketDataList) Reset ¶ added in v1.0.0
func (m *ConsumerPacketDataList) Reset()
func (*ConsumerPacketDataList) Size ¶ added in v1.0.0
func (m *ConsumerPacketDataList) Size() (n int)
func (*ConsumerPacketDataList) String ¶ added in v1.0.0
func (m *ConsumerPacketDataList) String() string
func (*ConsumerPacketDataList) Unmarshal ¶ added in v1.0.0
func (m *ConsumerPacketDataList) Unmarshal(dAtA []byte) error
func (*ConsumerPacketDataList) XXX_DiscardUnknown ¶ added in v1.0.0
func (m *ConsumerPacketDataList) XXX_DiscardUnknown()
func (*ConsumerPacketDataList) XXX_Marshal ¶ added in v1.0.0
func (m *ConsumerPacketDataList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ConsumerPacketDataList) XXX_Merge ¶ added in v1.0.0
func (m *ConsumerPacketDataList) XXX_Merge(src proto.Message)
func (*ConsumerPacketDataList) XXX_Size ¶ added in v1.0.0
func (m *ConsumerPacketDataList) XXX_Size() int
func (*ConsumerPacketDataList) XXX_Unmarshal ¶ added in v1.0.0
func (m *ConsumerPacketDataList) XXX_Unmarshal(b []byte) error
type ConsumerPacketDataType ¶ added in v1.0.0
type ConsumerPacketDataType int32
ConsumerPacketType indicates interchain security specific packet types.
const ( // UNSPECIFIED packet type UnspecifiedPacket ConsumerPacketDataType = 0 // Slash packet SlashPacket ConsumerPacketDataType = 1 // VSCMatured packet VscMaturedPacket ConsumerPacketDataType = 2 )
func (ConsumerPacketDataType) EnumDescriptor ¶ added in v1.0.0
func (ConsumerPacketDataType) EnumDescriptor() ([]byte, []int)
func (ConsumerPacketDataType) String ¶ added in v1.0.0
func (x ConsumerPacketDataType) String() string
type ConsumerPacketData_SlashPacketData ¶ added in v1.0.0
type ConsumerPacketData_SlashPacketData struct {
SlashPacketData *SlashPacketData `protobuf:"bytes,2,opt,name=slashPacketData,proto3,oneof" json:"slashPacketData,omitempty"`
}
func (*ConsumerPacketData_SlashPacketData) MarshalTo ¶ added in v1.0.0
func (m *ConsumerPacketData_SlashPacketData) MarshalTo(dAtA []byte) (int, error)
func (*ConsumerPacketData_SlashPacketData) MarshalToSizedBuffer ¶ added in v1.0.0
func (m *ConsumerPacketData_SlashPacketData) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ConsumerPacketData_SlashPacketData) Size ¶ added in v1.0.0
func (m *ConsumerPacketData_SlashPacketData) Size() (n int)
type ConsumerPacketData_VscMaturedPacketData ¶ added in v1.0.0
type ConsumerPacketData_VscMaturedPacketData struct {
VscMaturedPacketData *VSCMaturedPacketData `protobuf:"bytes,3,opt,name=vscMaturedPacketData,proto3,oneof" json:"vscMaturedPacketData,omitempty"`
}
func (*ConsumerPacketData_VscMaturedPacketData) MarshalTo ¶ added in v1.0.0
func (m *ConsumerPacketData_VscMaturedPacketData) MarshalTo(dAtA []byte) (int, error)
func (*ConsumerPacketData_VscMaturedPacketData) MarshalToSizedBuffer ¶ added in v1.0.0
func (m *ConsumerPacketData_VscMaturedPacketData) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ConsumerPacketData_VscMaturedPacketData) Size ¶ added in v1.0.0
func (m *ConsumerPacketData_VscMaturedPacketData) Size() (n int)
type IBCCoreKeeper ¶
type IBCCoreKeeper interface { ChannelOpenInit( goCtx context.Context, msg *channeltypes.MsgChannelOpenInit, ) (*channeltypes.MsgChannelOpenInitResponse, error) }
IBCKeeper defines the expected interface needed for openning a channel
type IBCTransferKeeper ¶
type IBCTransferKeeper interface { SendTransfer( ctx sdk.Context, sourcePort, sourceChannel string, token sdk.Coin, sender sdk.AccAddress, receiver string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64, ) error }
IBCTransferKeeper defines the expected interface needed for distribution transfer of tokens from the consumer to the provider chain
type MaturedUnbondingOps ¶ added in v0.2.0
type MaturedUnbondingOps struct {
Ids []uint64 `protobuf:"varint,1,rep,packed,name=ids,proto3" json:"ids,omitempty"`
}
MaturedUnbondingOps defines a list of ids corresponding to ids of matured unbonding operations.
func (*MaturedUnbondingOps) Descriptor ¶ added in v0.2.0
func (*MaturedUnbondingOps) Descriptor() ([]byte, []int)
func (*MaturedUnbondingOps) GetIds ¶ added in v0.2.0
func (m *MaturedUnbondingOps) GetIds() []uint64
func (*MaturedUnbondingOps) Marshal ¶ added in v0.2.0
func (m *MaturedUnbondingOps) Marshal() (dAtA []byte, err error)
func (*MaturedUnbondingOps) MarshalTo ¶ added in v0.2.0
func (m *MaturedUnbondingOps) MarshalTo(dAtA []byte) (int, error)
func (*MaturedUnbondingOps) MarshalToSizedBuffer ¶ added in v0.2.0
func (m *MaturedUnbondingOps) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MaturedUnbondingOps) ProtoMessage ¶ added in v0.2.0
func (*MaturedUnbondingOps) ProtoMessage()
func (*MaturedUnbondingOps) Reset ¶ added in v0.2.0
func (m *MaturedUnbondingOps) Reset()
func (*MaturedUnbondingOps) Size ¶ added in v0.2.0
func (m *MaturedUnbondingOps) Size() (n int)
func (*MaturedUnbondingOps) String ¶ added in v0.2.0
func (m *MaturedUnbondingOps) String() string
func (*MaturedUnbondingOps) Unmarshal ¶ added in v0.2.0
func (m *MaturedUnbondingOps) Unmarshal(dAtA []byte) error
func (*MaturedUnbondingOps) XXX_DiscardUnknown ¶ added in v0.2.0
func (m *MaturedUnbondingOps) XXX_DiscardUnknown()
func (*MaturedUnbondingOps) XXX_Marshal ¶ added in v0.2.0
func (m *MaturedUnbondingOps) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MaturedUnbondingOps) XXX_Merge ¶ added in v0.2.0
func (m *MaturedUnbondingOps) XXX_Merge(src proto.Message)
func (*MaturedUnbondingOps) XXX_Size ¶ added in v0.2.0
func (m *MaturedUnbondingOps) XXX_Size() int
func (*MaturedUnbondingOps) XXX_Unmarshal ¶ added in v0.2.0
func (m *MaturedUnbondingOps) XXX_Unmarshal(b []byte) error
type MsgClient ¶
type MsgClient interface { }
MsgClient is the client API for Msg service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewMsgClient ¶
func NewMsgClient(cc grpc1.ClientConn) MsgClient
type PortKeeper ¶
type PortKeeper interface {
BindPort(ctx sdk.Context, portID string) *capabilitytypes.Capability
}
PortKeeper defines the expected IBC port keeper
type QueryClient ¶
type QueryClient interface { }
QueryClient is the client API for Query service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewQueryClient ¶
func NewQueryClient(cc grpc1.ClientConn) QueryClient
type ScopedKeeper ¶ added in v0.1.4
type ScopedKeeper interface { GetCapability(ctx sdk.Context, name string) (*capabilitytypes.Capability, bool) AuthenticateCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) bool ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error }
type SlashPacketData ¶
type SlashPacketData struct { Validator types.Validator `protobuf:"bytes,1,opt,name=validator,proto3" json:"validator" yaml:"validator"` // map to the infraction block height on the provider ValsetUpdateId uint64 `protobuf:"varint,2,opt,name=valset_update_id,json=valsetUpdateId,proto3" json:"valset_update_id,omitempty"` // tell if the slashing is for a downtime or a double-signing infraction Infraction types1.InfractionType `protobuf:"varint,3,opt,name=infraction,proto3,enum=cosmos.staking.v1beta1.InfractionType" json:"infraction,omitempty"` }
This packet is sent from the consumer chain to the provider chain to request the slashing of a validator as a result of an infraction committed on the consumer chain.
func NewSlashPacketData ¶
func NewSlashPacketData(validator abci.Validator, valUpdateId uint64, infractionType stakingtypes.InfractionType) *SlashPacketData
func (*SlashPacketData) Descriptor ¶
func (*SlashPacketData) Descriptor() ([]byte, []int)
func (SlashPacketData) GetBytes ¶
func (vdt SlashPacketData) GetBytes() []byte
func (*SlashPacketData) GetInfraction ¶
func (m *SlashPacketData) GetInfraction() types1.InfractionType
func (*SlashPacketData) GetValidator ¶
func (m *SlashPacketData) GetValidator() types.Validator
func (*SlashPacketData) GetValsetUpdateId ¶
func (m *SlashPacketData) GetValsetUpdateId() uint64
func (*SlashPacketData) Marshal ¶
func (m *SlashPacketData) Marshal() (dAtA []byte, err error)
func (*SlashPacketData) MarshalToSizedBuffer ¶
func (m *SlashPacketData) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*SlashPacketData) ProtoMessage ¶
func (*SlashPacketData) ProtoMessage()
func (*SlashPacketData) Reset ¶
func (m *SlashPacketData) Reset()
func (*SlashPacketData) Size ¶
func (m *SlashPacketData) Size() (n int)
func (*SlashPacketData) String ¶
func (m *SlashPacketData) String() string
func (*SlashPacketData) Unmarshal ¶
func (m *SlashPacketData) Unmarshal(dAtA []byte) error
func (SlashPacketData) ValidateBasic ¶
func (vdt SlashPacketData) ValidateBasic() error
func (*SlashPacketData) XXX_DiscardUnknown ¶
func (m *SlashPacketData) XXX_DiscardUnknown()
func (*SlashPacketData) XXX_Marshal ¶
func (m *SlashPacketData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*SlashPacketData) XXX_Merge ¶
func (m *SlashPacketData) XXX_Merge(src proto.Message)
func (*SlashPacketData) XXX_Size ¶
func (m *SlashPacketData) XXX_Size() int
func (*SlashPacketData) XXX_Unmarshal ¶
func (m *SlashPacketData) XXX_Unmarshal(b []byte) error
type SlashingKeeper ¶
type SlashingKeeper interface { JailUntil(sdk.Context, sdk.ConsAddress, time.Time) // called from provider keeper only GetValidatorSigningInfo(ctx sdk.Context, address sdk.ConsAddress) (info slashingtypes.ValidatorSigningInfo, found bool) DowntimeJailDuration(sdk.Context) time.Duration SlashFractionDowntime(sdk.Context) sdk.Dec SlashFractionDoubleSign(ctx sdk.Context) (res sdk.Dec) Tombstone(sdk.Context, sdk.ConsAddress) IsTombstoned(sdk.Context, sdk.ConsAddress) bool }
SlashingKeeper defines the contract expected to perform ccv slashing
type StakingKeeper ¶
type StakingKeeper interface { GetValidatorUpdates(ctx sdk.Context) []abci.ValidatorUpdate UnbondingCanComplete(ctx sdk.Context, id uint64) error UnbondingTime(ctx sdk.Context) time.Duration GetValidatorByConsAddr(ctx sdk.Context, consAddr sdk.ConsAddress) (validator stakingtypes.Validator, found bool) GetLastValidatorPower(ctx sdk.Context, operator sdk.ValAddress) (power int64) // slash the validator and delegators of the validator, specifying offence height, offence power, and slash fraction Jail(sdk.Context, sdk.ConsAddress) // jail a validator Slash(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec, stakingtypes.InfractionType) GetValidator(ctx sdk.Context, addr sdk.ValAddress) (validator stakingtypes.Validator, found bool) IterateLastValidatorPowers(ctx sdk.Context, cb func(addr sdk.ValAddress, power int64) (stop bool)) PowerReduction(ctx sdk.Context) sdk.Int PutUnbondingOnHold(ctx sdk.Context, id uint64) error GetLastTotalPower(ctx sdk.Context) sdk.Int }
StakingKeeper defines the contract expected by provider-chain ccv module from a Staking Module that will keep track of the provider validator set. This version of the interchain-security protocol will mirror the provider chain's changes so we do not need a registry module between the staking module and CCV.
type UnimplementedMsgServer ¶
type UnimplementedMsgServer struct { }
UnimplementedMsgServer can be embedded to have forward compatible implementations.
type UnimplementedQueryServer ¶
type UnimplementedQueryServer struct { }
UnimplementedQueryServer can be embedded to have forward compatible implementations.
type VSCMaturedPacketData ¶
type VSCMaturedPacketData struct { // the id of the VSC packet that reached maturity ValsetUpdateId uint64 `protobuf:"varint,1,opt,name=valset_update_id,json=valsetUpdateId,proto3" json:"valset_update_id,omitempty"` }
This packet is sent from the consumer chain to the provider chain to notify that a VSC packet reached maturity on the consumer chain.
func NewVSCMaturedPacketData ¶
func NewVSCMaturedPacketData(valUpdateID uint64) *VSCMaturedPacketData
func (*VSCMaturedPacketData) Descriptor ¶
func (*VSCMaturedPacketData) Descriptor() ([]byte, []int)
func (VSCMaturedPacketData) GetBytes ¶
func (mat VSCMaturedPacketData) GetBytes() []byte
func (*VSCMaturedPacketData) GetValsetUpdateId ¶
func (m *VSCMaturedPacketData) GetValsetUpdateId() uint64
func (*VSCMaturedPacketData) Marshal ¶
func (m *VSCMaturedPacketData) Marshal() (dAtA []byte, err error)
func (*VSCMaturedPacketData) MarshalTo ¶
func (m *VSCMaturedPacketData) MarshalTo(dAtA []byte) (int, error)
func (*VSCMaturedPacketData) MarshalToSizedBuffer ¶
func (m *VSCMaturedPacketData) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*VSCMaturedPacketData) ProtoMessage ¶
func (*VSCMaturedPacketData) ProtoMessage()
func (*VSCMaturedPacketData) Reset ¶
func (m *VSCMaturedPacketData) Reset()
func (*VSCMaturedPacketData) Size ¶
func (m *VSCMaturedPacketData) Size() (n int)
func (*VSCMaturedPacketData) String ¶
func (m *VSCMaturedPacketData) String() string
func (*VSCMaturedPacketData) Unmarshal ¶
func (m *VSCMaturedPacketData) Unmarshal(dAtA []byte) error
func (VSCMaturedPacketData) ValidateBasic ¶
func (mat VSCMaturedPacketData) ValidateBasic() error
ValidateBasic is used for validating the VSCMatured packet data.
func (*VSCMaturedPacketData) XXX_DiscardUnknown ¶
func (m *VSCMaturedPacketData) XXX_DiscardUnknown()
func (*VSCMaturedPacketData) XXX_Marshal ¶
func (m *VSCMaturedPacketData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*VSCMaturedPacketData) XXX_Merge ¶
func (m *VSCMaturedPacketData) XXX_Merge(src proto.Message)
func (*VSCMaturedPacketData) XXX_Size ¶
func (m *VSCMaturedPacketData) XXX_Size() int
func (*VSCMaturedPacketData) XXX_Unmarshal ¶
func (m *VSCMaturedPacketData) XXX_Unmarshal(b []byte) error
type ValidatorSetChangePacketData ¶
type ValidatorSetChangePacketData struct { ValidatorUpdates []types.ValidatorUpdate `protobuf:"bytes,1,rep,name=validator_updates,json=validatorUpdates,proto3" json:"validator_updates" yaml:"validator_updates"` ValsetUpdateId uint64 `protobuf:"varint,2,opt,name=valset_update_id,json=valsetUpdateId,proto3" json:"valset_update_id,omitempty"` // consensus address of consumer chain validators // successfully slashed on the provider chain SlashAcks []string `protobuf:"bytes,3,rep,name=slash_acks,json=slashAcks,proto3" json:"slash_acks,omitempty"` }
This packet is sent from provider chain to consumer chain if the validator set for consumer chain changes (due to new bonding/unbonding messages or slashing events) A VSCMatured packet from consumer chain will be sent asynchronously once unbonding period is over, and this will function as `UnbondingOver` message for this packet.
func NewValidatorSetChangePacketData ¶
func NewValidatorSetChangePacketData(valUpdates []abci.ValidatorUpdate, valUpdateID uint64, SlashAcks []string) ValidatorSetChangePacketData
func (*ValidatorSetChangePacketData) Descriptor ¶
func (*ValidatorSetChangePacketData) Descriptor() ([]byte, []int)
func (ValidatorSetChangePacketData) GetBytes ¶
func (vsc ValidatorSetChangePacketData) GetBytes() []byte
func (*ValidatorSetChangePacketData) GetSlashAcks ¶
func (m *ValidatorSetChangePacketData) GetSlashAcks() []string
func (*ValidatorSetChangePacketData) GetValidatorUpdates ¶
func (m *ValidatorSetChangePacketData) GetValidatorUpdates() []types.ValidatorUpdate
func (*ValidatorSetChangePacketData) GetValsetUpdateId ¶
func (m *ValidatorSetChangePacketData) GetValsetUpdateId() uint64
func (*ValidatorSetChangePacketData) Marshal ¶
func (m *ValidatorSetChangePacketData) Marshal() (dAtA []byte, err error)
func (*ValidatorSetChangePacketData) MarshalTo ¶
func (m *ValidatorSetChangePacketData) MarshalTo(dAtA []byte) (int, error)
func (*ValidatorSetChangePacketData) MarshalToSizedBuffer ¶
func (m *ValidatorSetChangePacketData) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ValidatorSetChangePacketData) ProtoMessage ¶
func (*ValidatorSetChangePacketData) ProtoMessage()
func (*ValidatorSetChangePacketData) Reset ¶
func (m *ValidatorSetChangePacketData) Reset()
func (*ValidatorSetChangePacketData) Size ¶
func (m *ValidatorSetChangePacketData) Size() (n int)
func (*ValidatorSetChangePacketData) String ¶
func (m *ValidatorSetChangePacketData) String() string
func (*ValidatorSetChangePacketData) Unmarshal ¶
func (m *ValidatorSetChangePacketData) Unmarshal(dAtA []byte) error
func (ValidatorSetChangePacketData) ValidateBasic ¶
func (vsc ValidatorSetChangePacketData) ValidateBasic() error
ValidateBasic is used for validating the CCV packet data.
func (*ValidatorSetChangePacketData) XXX_DiscardUnknown ¶
func (m *ValidatorSetChangePacketData) XXX_DiscardUnknown()
func (*ValidatorSetChangePacketData) XXX_Marshal ¶
func (m *ValidatorSetChangePacketData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ValidatorSetChangePacketData) XXX_Merge ¶
func (m *ValidatorSetChangePacketData) XXX_Merge(src proto.Message)
func (*ValidatorSetChangePacketData) XXX_Size ¶
func (m *ValidatorSetChangePacketData) XXX_Size() int
func (*ValidatorSetChangePacketData) XXX_Unmarshal ¶
func (m *ValidatorSetChangePacketData) XXX_Unmarshal(b []byte) error
type ValidatorSetChangePackets ¶ added in v1.0.0
type ValidatorSetChangePackets struct {
List []ValidatorSetChangePacketData `protobuf:"bytes,1,rep,name=list,proto3" json:"list"`
}
List of ccv.ValidatorSetChangePacketData.
func (*ValidatorSetChangePackets) Descriptor ¶ added in v1.0.0
func (*ValidatorSetChangePackets) Descriptor() ([]byte, []int)
func (*ValidatorSetChangePackets) GetList ¶ added in v1.0.0
func (m *ValidatorSetChangePackets) GetList() []ValidatorSetChangePacketData
func (*ValidatorSetChangePackets) Marshal ¶ added in v1.0.0
func (m *ValidatorSetChangePackets) Marshal() (dAtA []byte, err error)
func (*ValidatorSetChangePackets) MarshalTo ¶ added in v1.0.0
func (m *ValidatorSetChangePackets) MarshalTo(dAtA []byte) (int, error)
func (*ValidatorSetChangePackets) MarshalToSizedBuffer ¶ added in v1.0.0
func (m *ValidatorSetChangePackets) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ValidatorSetChangePackets) ProtoMessage ¶ added in v1.0.0
func (*ValidatorSetChangePackets) ProtoMessage()
func (*ValidatorSetChangePackets) Reset ¶ added in v1.0.0
func (m *ValidatorSetChangePackets) Reset()
func (*ValidatorSetChangePackets) Size ¶ added in v1.0.0
func (m *ValidatorSetChangePackets) Size() (n int)
func (*ValidatorSetChangePackets) String ¶ added in v1.0.0
func (m *ValidatorSetChangePackets) String() string
func (*ValidatorSetChangePackets) Unmarshal ¶ added in v1.0.0
func (m *ValidatorSetChangePackets) Unmarshal(dAtA []byte) error
func (*ValidatorSetChangePackets) XXX_DiscardUnknown ¶ added in v1.0.0
func (m *ValidatorSetChangePackets) XXX_DiscardUnknown()
func (*ValidatorSetChangePackets) XXX_Marshal ¶ added in v1.0.0
func (m *ValidatorSetChangePackets) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ValidatorSetChangePackets) XXX_Merge ¶ added in v1.0.0
func (m *ValidatorSetChangePackets) XXX_Merge(src proto.Message)
func (*ValidatorSetChangePackets) XXX_Size ¶ added in v1.0.0
func (m *ValidatorSetChangePackets) XXX_Size() int
func (*ValidatorSetChangePackets) XXX_Unmarshal ¶ added in v1.0.0
func (m *ValidatorSetChangePackets) XXX_Unmarshal(b []byte) error