types

package module
v0.0.0-...-dd29c9a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2023 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeTimeout                     = "timeout"
	EventTypePacket                      = "ccv_packet"
	EventTypeChannelEstablished          = "channel_established"
	EventTypeFeeTransferChannelOpened    = "fee_transfer_channel_opened"
	EventTypeConsumerClientCreated       = "consumer_client_created"
	EventTypeAssignConsumerKey           = "assign_consumer_key"
	EventTypeRegisterConsumerRewardDenom = "register_consumer_reward_denom"

	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"

	AttributeConsumerRewardDenom     = "consumer_reward_denom"
	AttributeConsumerRewardDepositor = "consumer_reward_depositor"
)

CCV events

View Source
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"
)
View Source
const (
	// about 2 hr at 7.6 seconds per blocks
	DefaultBlocksPerDistributionTransmission = 1000

	// Default transfer timeout period is 1 hour, less than the default blocks
	// per dist transmission * average block time.
	// Since IBC token transfers do not have to be in order, it could be easier
	// to reason about the distribution protocol if the previous reward times out
	// before sending the next one. Note that on timeout, the transferred funds are
	// added back to the pool, so the next transfer will include them as well.
	DefaultTransferTimeoutPeriod = time.Hour

	// The default fraction of tokens allocated to the consumer redistribution address
	// during distribution events. The fraction is a string representing a
	// decimal number. For example "0.75" would represent 75%.
	DefaultConsumerRedistributeFrac = "0.75"

	// Default number of historical info entries to persist in store.
	// We use the same default as the staking module, but use a signed integer
	// so that negative values can be caught during parameter validation in a readable way,
	// (and for consistency with other protobuf schemas defined for ccv).
	DefaultHistoricalEntries = int64(stakingtypes.DefaultHistoricalEntries)

	// In general, the default unbonding period on the consumer is one day less
	// than the default unbonding period on the provider, where the provider uses
	// the staking module default.
	DefaultConsumerUnbondingPeriod = stakingtypes.DefaultUnbondingTime - 24*time.Hour

	// By default, the bottom 5% of the validator set can opt out of validating consumer chains
	DefaultSoftOptOutThreshold = "0.05"
)
View Source
const (
	// Default timeout period is 4 weeks to ensure channel doesn't close on timeout
	DefaultCCVTimeoutPeriod = 4 * 7 * 24 * time.Hour
)

Variables

View Source
var (

	// The result ack that has historically been sent from the provider.
	// A provider with v1 throttling sends these acks for all successfully recv packets.
	V1Result = PacketAckResult([]byte{byte(1)})
	// Slash packet handled result ack, sent by a throttling v2 provider to indicate that a slash packet was handled.
	SlashPacketHandledResult = PacketAckResult([]byte{byte(2)})
	// Slash packet bounced result ack, sent by a throttling v2 provider to indicate that a slash packet was NOT handled
	// and should eventually be retried.
	SlashPacketBouncedResult = PacketAckResult([]byte{byte(3)})
)
View Source
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)
)
View Source
var (
	ErrInvalidPacketData        = errorsmod.Register(ModuleName, 2, "invalid CCV packet data")
	ErrInvalidPacketTimeout     = errorsmod.Register(ModuleName, 3, "invalid packet timeout")
	ErrInvalidVersion           = errorsmod.Register(ModuleName, 4, "invalid CCV version")
	ErrInvalidChannelFlow       = errorsmod.Register(ModuleName, 5, "invalid message sent to channel end")
	ErrInvalidConsumerChain     = errorsmod.Register(ModuleName, 6, "invalid consumer chain")
	ErrInvalidProviderChain     = errorsmod.Register(ModuleName, 7, "invalid provider chain")
	ErrInvalidStatus            = errorsmod.Register(ModuleName, 8, "invalid channel status")
	ErrInvalidGenesis           = errorsmod.Register(ModuleName, 9, "invalid genesis state")
	ErrDuplicateChannel         = errorsmod.Register(ModuleName, 10, "CCV channel already exists")
	ErrInvalidVSCMaturedId      = errorsmod.Register(ModuleName, 11, "invalid vscId for VSC packet")
	ErrInvalidVSCMaturedTime    = errorsmod.Register(ModuleName, 12, "invalid maturity time for VSC packet")
	ErrInvalidConsumerState     = errorsmod.Register(ModuleName, 13, "provider chain has invalid state for consumer chain")
	ErrInvalidConsumerClient    = errorsmod.Register(ModuleName, 14, "ccv channel is not built on correct client")
	ErrInvalidProposal          = errorsmod.Register(ModuleName, 15, "invalid proposal")
	ErrInvalidHandshakeMetadata = errorsmod.Register(ModuleName, 16, "invalid provider handshake metadata")
	ErrChannelNotFound          = errorsmod.Register(ModuleName, 17, "channel not found")
	ErrClientNotFound           = errorsmod.Register(ModuleName, 18, "client not found")
	ErrDuplicateConsumerChain   = errorsmod.Register(ModuleName, 19, "consumer chain already exists")
	ErrConsumerChainNotFound    = errorsmod.Register(ModuleName, 20, "consumer chain not found")
)

CCV sentinel errors

View Source
var (
	KeyEnabled                           = []byte("Enabled")
	KeyBlocksPerDistributionTransmission = []byte("BlocksPerDistributionTransmission")
	KeyDistributionTransmissionChannel   = []byte("DistributionTransmissionChannel")
	KeyProviderFeePoolAddrStr            = []byte("ProviderFeePoolAddrStr")
	KeyTransferTimeoutPeriod             = []byte("TransferTimeoutPeriod")
	KeyConsumerRedistributionFrac        = []byte("ConsumerRedistributionFraction")
	KeyHistoricalEntries                 = []byte("HistoricalEntries")
	KeyConsumerUnbondingPeriod           = []byte("UnbondingPeriod")
	KeySoftOptOutThreshold               = []byte("SoftOptOutThreshold")
	KeyRewardDenoms                      = []byte("RewardDenoms")
	KeyProviderRewardDenoms              = []byte("ProviderRewardDenoms")
)

Reflection based keys for params subspace

View Source
var (
	ErrInvalidLengthSharedConsumer        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowSharedConsumer          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupSharedConsumer = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthWire        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowWire          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupWire = fmt.Errorf("proto: unexpected end of group")
)
View Source
var ConsumerPacketDataType_name = map[int32]string{
	0: "CONSUMER_PACKET_TYPE_UNSPECIFIED",
	1: "CONSUMER_PACKET_TYPE_SLASH",
	2: "CONSUMER_PACKET_TYPE_VSCM",
}
View Source
var ConsumerPacketDataType_value = map[string]int32{
	"CONSUMER_PACKET_TYPE_UNSPECIFIED": 0,
	"CONSUMER_PACKET_TYPE_SLASH":       1,
	"CONSUMER_PACKET_TYPE_VSCM":        2,
}
View Source
var InfractionType_name = map[int32]string{
	0: "INFRACTION_TYPE_UNSPECIFIED",
	1: "INFRACTION_TYPE_DOUBLE_SIGN",
	2: "INFRACTION_TYPE_DOWNTIME",
}
View Source
var InfractionType_value = map[string]int32{
	"INFRACTION_TYPE_UNSPECIFIED": 0,
	"INFRACTION_TYPE_DOUBLE_SIGN": 1,
	"INFRACTION_TYPE_DOWNTIME":    2,
}
View Source
var KeyCCVTimeoutPeriod = []byte("CcvTimeoutPeriod")

Functions

func AccumulateChanges

func AccumulateChanges(currentChanges, newChanges []abci.ValidatorUpdate) []abci.ValidatorUpdate

func AppendMany

func AppendMany(byteses ...[]byte) (out []byte)

AppendMany appends a variable number of byte slices together

func CalculateTrustPeriod

func CalculateTrustPeriod(unbondingPeriod time.Duration, defaultTrustPeriodFraction string) (time.Duration, error)

func NewErrorAcknowledgementWithLog

func NewErrorAcknowledgementWithLog(ctx sdk.Context, err error) channeltypes.Acknowledgement

func PanicIfZeroOrNil

func PanicIfZeroOrNil(x interface{}, nameForPanicMsg string)

func ParamKeyTable

func ParamKeyTable() paramtypes.KeyTable

ParamKeyTable type declaration for parameters

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 SendIBCPacket

func SendIBCPacket(
	ctx sdk.Context,
	scopedKeeper ScopedKeeper,
	channelKeeper ChannelKeeper,
	sourceChannelID string,
	sourcePortID string,
	packetData []byte,
	timeoutPeriod time.Duration,
) error

SendIBCPacket sends an IBC packet with packetData over the source channelID and portID

func TMCryptoPublicKeyToConsAddr

func TMCryptoPublicKeyToConsAddr(k tmprotocrypto.PublicKey) (sdk.ConsAddress, error)

TMCryptoPublicKeyToConsAddr converts a TM public key to an SDK public key and returns the associated consensus address

func ValidateBech32

func ValidateBech32(i interface{}) error

func ValidateBool

func ValidateBool(i interface{}) error

func ValidateChannelIdentifier

func ValidateChannelIdentifier(i interface{}) error

func ValidateDenoms

func ValidateDenoms(i interface{}) error

func ValidateDistributionTransmissionChannel

func ValidateDistributionTransmissionChannel(i interface{}) error

func ValidateDuration

func ValidateDuration(i interface{}) error

func ValidateInt64

func ValidateInt64(i interface{}) error

func ValidatePositiveInt64

func ValidatePositiveInt64(i interface{}) error

func ValidateProviderFeePoolAddrStr

func ValidateProviderFeePoolAddrStr(i interface{}) error

func ValidateSoftOptOutThreshold

func ValidateSoftOptOutThreshold(i interface{}) error

func ValidateString

func ValidateString(i interface{}) error

func ValidateStringFraction

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,
		chanCap *capabilitytypes.Capability,
		sourcePort string,
		sourceChannel string,
		timeoutHeight clienttypes.Height,
		timeoutTimestamp uint64,
		data []byte,
	) (sequence uint64, err 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
	GetChannelConnection(ctx sdk.Context, portID, channelID string) (string, ibcexported.ConnectionI, 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, valAddresses sdk.ValAddress) error
}

ConsumerHooks event hooks for newly bonded cross-chain validators

type ConsumerPacketData

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 NewConsumerPacketData

func NewConsumerPacketData(cpdType ConsumerPacketDataType, data isConsumerPacketData_Data) ConsumerPacketData

func (*ConsumerPacketData) Descriptor

func (*ConsumerPacketData) Descriptor() ([]byte, []int)

func (ConsumerPacketData) GetBytes

func (cp ConsumerPacketData) GetBytes() []byte

Convert to bytes while maintaining over the wire compatibility with previous versions.

func (*ConsumerPacketData) GetData

func (m *ConsumerPacketData) GetData() isConsumerPacketData_Data

func (*ConsumerPacketData) GetSlashPacketData

func (m *ConsumerPacketData) GetSlashPacketData() *SlashPacketData

func (*ConsumerPacketData) GetType

func (*ConsumerPacketData) GetVscMaturedPacketData

func (m *ConsumerPacketData) GetVscMaturedPacketData() *VSCMaturedPacketData

func (*ConsumerPacketData) Marshal

func (m *ConsumerPacketData) Marshal() (dAtA []byte, err error)

func (*ConsumerPacketData) MarshalTo

func (m *ConsumerPacketData) MarshalTo(dAtA []byte) (int, error)

func (*ConsumerPacketData) MarshalToSizedBuffer

func (m *ConsumerPacketData) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ConsumerPacketData) ProtoMessage

func (*ConsumerPacketData) ProtoMessage()

func (*ConsumerPacketData) Reset

func (m *ConsumerPacketData) Reset()

func (*ConsumerPacketData) Size

func (m *ConsumerPacketData) Size() (n int)

func (*ConsumerPacketData) String

func (m *ConsumerPacketData) String() string

func (ConsumerPacketData) ToV1Bytes

func (cp ConsumerPacketData) ToV1Bytes() []byte

ToV1Bytes converts the ConsumerPacketData to JSON byte array compatible with the format used by ICS versions using cosmos-sdk v45 (ICS v1 and ICS v2).

func (*ConsumerPacketData) Unmarshal

func (m *ConsumerPacketData) Unmarshal(dAtA []byte) error

func (ConsumerPacketData) ValidateBasic

func (cp ConsumerPacketData) ValidateBasic() (err error)

func (*ConsumerPacketData) XXX_DiscardUnknown

func (m *ConsumerPacketData) XXX_DiscardUnknown()

func (*ConsumerPacketData) XXX_Marshal

func (m *ConsumerPacketData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ConsumerPacketData) XXX_Merge

func (m *ConsumerPacketData) XXX_Merge(src proto.Message)

func (*ConsumerPacketData) XXX_OneofWrappers

func (*ConsumerPacketData) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*ConsumerPacketData) XXX_Size

func (m *ConsumerPacketData) XXX_Size() int

func (*ConsumerPacketData) XXX_Unmarshal

func (m *ConsumerPacketData) XXX_Unmarshal(b []byte) error

type ConsumerPacketDataList

type ConsumerPacketDataList struct {
	List []ConsumerPacketData `protobuf:"bytes,1,rep,name=list,proto3" json:"list"`
}

ConsumerPacketDataList is a list of consumer packet data packets.

Note this type is is used internally to the consumer CCV module for exporting / importing state in InitGenesis and ExportGenesis, AND included in the consumer genesis type (reffed by provider and consumer modules), hence this is a shared type.

func (*ConsumerPacketDataList) Descriptor

func (*ConsumerPacketDataList) Descriptor() ([]byte, []int)

func (*ConsumerPacketDataList) GetList

func (*ConsumerPacketDataList) Marshal

func (m *ConsumerPacketDataList) Marshal() (dAtA []byte, err error)

func (*ConsumerPacketDataList) MarshalTo

func (m *ConsumerPacketDataList) MarshalTo(dAtA []byte) (int, error)

func (*ConsumerPacketDataList) MarshalToSizedBuffer

func (m *ConsumerPacketDataList) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ConsumerPacketDataList) ProtoMessage

func (*ConsumerPacketDataList) ProtoMessage()

func (*ConsumerPacketDataList) Reset

func (m *ConsumerPacketDataList) Reset()

func (*ConsumerPacketDataList) Size

func (m *ConsumerPacketDataList) Size() (n int)

func (*ConsumerPacketDataList) String

func (m *ConsumerPacketDataList) String() string

func (*ConsumerPacketDataList) Unmarshal

func (m *ConsumerPacketDataList) Unmarshal(dAtA []byte) error

func (*ConsumerPacketDataList) XXX_DiscardUnknown

func (m *ConsumerPacketDataList) XXX_DiscardUnknown()

func (*ConsumerPacketDataList) XXX_Marshal

func (m *ConsumerPacketDataList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ConsumerPacketDataList) XXX_Merge

func (m *ConsumerPacketDataList) XXX_Merge(src proto.Message)

func (*ConsumerPacketDataList) XXX_Size

func (m *ConsumerPacketDataList) XXX_Size() int

func (*ConsumerPacketDataList) XXX_Unmarshal

func (m *ConsumerPacketDataList) XXX_Unmarshal(b []byte) error

type ConsumerPacketDataType

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

func (ConsumerPacketDataType) EnumDescriptor() ([]byte, []int)

func (ConsumerPacketDataType) String

func (x ConsumerPacketDataType) String() string

type ConsumerPacketDataV1

type ConsumerPacketDataV1 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:
	//	*ConsumerPacketDataV1_SlashPacketData
	//	*ConsumerPacketDataV1_VscMaturedPacketData
	Data isConsumerPacketDataV1_Data `protobuf_oneof:"data"`
}

ConsumerPacketData contains a consumer packet data and a type tag that is compatible with ICS v1 and v2 over the wire. It is not used for internal storage.

func (*ConsumerPacketDataV1) Descriptor

func (*ConsumerPacketDataV1) Descriptor() ([]byte, []int)

func (*ConsumerPacketDataV1) GetData

func (m *ConsumerPacketDataV1) GetData() isConsumerPacketDataV1_Data

func (*ConsumerPacketDataV1) GetSlashPacketData

func (m *ConsumerPacketDataV1) GetSlashPacketData() *SlashPacketDataV1

func (*ConsumerPacketDataV1) GetType

func (*ConsumerPacketDataV1) GetVscMaturedPacketData

func (m *ConsumerPacketDataV1) GetVscMaturedPacketData() *VSCMaturedPacketData

func (*ConsumerPacketDataV1) Marshal

func (m *ConsumerPacketDataV1) Marshal() (dAtA []byte, err error)

func (*ConsumerPacketDataV1) MarshalTo

func (m *ConsumerPacketDataV1) MarshalTo(dAtA []byte) (int, error)

func (*ConsumerPacketDataV1) MarshalToSizedBuffer

func (m *ConsumerPacketDataV1) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ConsumerPacketDataV1) ProtoMessage

func (*ConsumerPacketDataV1) ProtoMessage()

func (*ConsumerPacketDataV1) Reset

func (m *ConsumerPacketDataV1) Reset()

func (*ConsumerPacketDataV1) Size

func (m *ConsumerPacketDataV1) Size() (n int)

func (*ConsumerPacketDataV1) String

func (m *ConsumerPacketDataV1) String() string

func (*ConsumerPacketDataV1) Unmarshal

func (m *ConsumerPacketDataV1) Unmarshal(dAtA []byte) error

func (*ConsumerPacketDataV1) XXX_DiscardUnknown

func (m *ConsumerPacketDataV1) XXX_DiscardUnknown()

func (*ConsumerPacketDataV1) XXX_Marshal

func (m *ConsumerPacketDataV1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ConsumerPacketDataV1) XXX_Merge

func (m *ConsumerPacketDataV1) XXX_Merge(src proto.Message)

func (*ConsumerPacketDataV1) XXX_OneofWrappers

func (*ConsumerPacketDataV1) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*ConsumerPacketDataV1) XXX_Size

func (m *ConsumerPacketDataV1) XXX_Size() int

func (*ConsumerPacketDataV1) XXX_Unmarshal

func (m *ConsumerPacketDataV1) XXX_Unmarshal(b []byte) error

type ConsumerPacketDataV1_SlashPacketData

type ConsumerPacketDataV1_SlashPacketData struct {
	SlashPacketData *SlashPacketDataV1 `protobuf:"bytes,2,opt,name=slashPacketData,proto3,oneof" json:"slashPacketData,omitempty"`
}

func (*ConsumerPacketDataV1_SlashPacketData) MarshalTo

func (m *ConsumerPacketDataV1_SlashPacketData) MarshalTo(dAtA []byte) (int, error)

func (*ConsumerPacketDataV1_SlashPacketData) MarshalToSizedBuffer

func (m *ConsumerPacketDataV1_SlashPacketData) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ConsumerPacketDataV1_SlashPacketData) Size

type ConsumerPacketDataV1_VscMaturedPacketData

type ConsumerPacketDataV1_VscMaturedPacketData struct {
	VscMaturedPacketData *VSCMaturedPacketData `protobuf:"bytes,3,opt,name=vscMaturedPacketData,proto3,oneof" json:"vscMaturedPacketData,omitempty"`
}

func (*ConsumerPacketDataV1_VscMaturedPacketData) MarshalTo

func (m *ConsumerPacketDataV1_VscMaturedPacketData) MarshalTo(dAtA []byte) (int, error)

func (*ConsumerPacketDataV1_VscMaturedPacketData) MarshalToSizedBuffer

func (m *ConsumerPacketDataV1_VscMaturedPacketData) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ConsumerPacketDataV1_VscMaturedPacketData) Size

type ConsumerPacketData_SlashPacketData

type ConsumerPacketData_SlashPacketData struct {
	SlashPacketData *SlashPacketData `protobuf:"bytes,2,opt,name=slashPacketData,proto3,oneof" json:"slashPacketData,omitempty"`
}

func (*ConsumerPacketData_SlashPacketData) MarshalTo

func (m *ConsumerPacketData_SlashPacketData) MarshalTo(dAtA []byte) (int, error)

func (*ConsumerPacketData_SlashPacketData) MarshalToSizedBuffer

func (m *ConsumerPacketData_SlashPacketData) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ConsumerPacketData_SlashPacketData) Size

type ConsumerPacketData_VscMaturedPacketData

type ConsumerPacketData_VscMaturedPacketData struct {
	VscMaturedPacketData *VSCMaturedPacketData `protobuf:"bytes,3,opt,name=vscMaturedPacketData,proto3,oneof" json:"vscMaturedPacketData,omitempty"`
}

func (*ConsumerPacketData_VscMaturedPacketData) MarshalTo

func (m *ConsumerPacketData_VscMaturedPacketData) MarshalTo(dAtA []byte) (int, error)

func (*ConsumerPacketData_VscMaturedPacketData) MarshalToSizedBuffer

func (m *ConsumerPacketData_VscMaturedPacketData) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ConsumerPacketData_VscMaturedPacketData) Size

type DistributionKeeper

type DistributionKeeper interface {
	FundCommunityPool(ctx sdk.Context, amount sdk.Coins, sender sdk.AccAddress) error
}

DistributionKeeper defines the expected interface of the distribution keeper

type EvidenceKeeper

type EvidenceKeeper interface {
	HandleEquivocationEvidence(ctx sdk.Context, evidence *evidencetypes.Equivocation)
}

type ExportedIsConsumerPacketData_Data

type ExportedIsConsumerPacketData_Data interface {
	// contains filtered or unexported methods
}

An exported wrapper around the auto generated isConsumerPacketData_Data interface, only for AppendPendingPacket to accept the interface as an argument.

type GenesisState

type GenesisState struct {
	Params            Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
	ProviderClientId  string `protobuf:"bytes,2,opt,name=provider_client_id,json=providerClientId,proto3" json:"provider_client_id,omitempty"`
	ProviderChannelId string `protobuf:"bytes,3,opt,name=provider_channel_id,json=providerChannelId,proto3" json:"provider_channel_id,omitempty"`
	NewChain          bool   `protobuf:"varint,4,opt,name=new_chain,json=newChain,proto3" json:"new_chain,omitempty"`
	// ProviderClientState filled in on new chain, nil on restart.
	ProviderClientState *_07_tendermint.ClientState `protobuf:"bytes,5,opt,name=provider_client_state,json=providerClientState,proto3" json:"provider_client_state,omitempty"`
	// ProviderConsensusState filled in on new chain, nil on restart.
	ProviderConsensusState *_07_tendermint.ConsensusState `` /* 129-byte string literal not displayed */
	// MaturingPackets nil on new chain, filled in on restart.
	MaturingPackets []MaturingVSCPacket `protobuf:"bytes,7,rep,name=maturing_packets,json=maturingPackets,proto3" json:"maturing_packets"`
	// InitialValset filled in on new chain and on restart.
	InitialValSet []types.ValidatorUpdate `protobuf:"bytes,8,rep,name=initial_val_set,json=initialValSet,proto3" json:"initial_val_set"`
	// HeightToValsetUpdateId nil on new chain, filled in on restart.
	HeightToValsetUpdateId []HeightToValsetUpdateID `protobuf:"bytes,9,rep,name=height_to_valset_update_id,json=heightToValsetUpdateId,proto3" json:"height_to_valset_update_id"`
	// OutstandingDowntimes nil on new chain, filled  in on restart.
	OutstandingDowntimeSlashing []OutstandingDowntime `` /* 135-byte string literal not displayed */
	// PendingConsumerPackets nil on new chain, filled in on restart.
	PendingConsumerPackets ConsumerPacketDataList `protobuf:"bytes,11,opt,name=pending_consumer_packets,json=pendingConsumerPackets,proto3" json:"pending_consumer_packets"`
	// LastTransmissionBlockHeight nil on new chain, filled in on restart.
	LastTransmissionBlockHeight LastTransmissionBlockHeight `` /* 137-byte string literal not displayed */
	PreCCV                      bool                        `protobuf:"varint,13,opt,name=preCCV,proto3" json:"preCCV,omitempty"`
}

GenesisState defines the CCV consumer chain genesis state.

Note this type is referenced in both the consumer and provider CCV modules, and persisted on the provider, see MakeConsumerGenesis and SetConsumerGenesis.

TODO: Rename to ConsumerGenesisState. See https://github.com/cosmos/interchain-security/issues/1206

func DefaultGenesisState

func DefaultGenesisState() *GenesisState

DefaultGenesisState returns a default disabled consumer chain genesis state. This allows the module to be hooked up to app without getting use unless explicitly specified in genesis.

func NewInitialGenesisState

func NewInitialGenesisState(cs *ibctmtypes.ClientState, consState *ibctmtypes.ConsensusState,
	initValSet []abci.ValidatorUpdate, params Params,
) *GenesisState

NewInitialGenesisState returns a consumer GenesisState for a completely new consumer chain.

func NewRestartGenesisState

func NewRestartGenesisState(
	clientID, channelID string,
	maturingPackets []MaturingVSCPacket,
	initValSet []abci.ValidatorUpdate,
	heightToValsetUpdateIDs []HeightToValsetUpdateID,
	pendingConsumerPackets ConsumerPacketDataList,
	outstandingDowntimes []OutstandingDowntime,
	lastTransBlockHeight LastTransmissionBlockHeight,
	params Params,
) *GenesisState

NewRestartGenesisState returns a consumer GenesisState that has already been established.

func (*GenesisState) Descriptor

func (*GenesisState) Descriptor() ([]byte, []int)

func (*GenesisState) GetHeightToValsetUpdateId

func (m *GenesisState) GetHeightToValsetUpdateId() []HeightToValsetUpdateID

func (*GenesisState) GetInitialValSet

func (m *GenesisState) GetInitialValSet() []types.ValidatorUpdate

func (*GenesisState) GetLastTransmissionBlockHeight

func (m *GenesisState) GetLastTransmissionBlockHeight() LastTransmissionBlockHeight

func (*GenesisState) GetMaturingPackets

func (m *GenesisState) GetMaturingPackets() []MaturingVSCPacket

func (*GenesisState) GetNewChain

func (m *GenesisState) GetNewChain() bool

func (*GenesisState) GetOutstandingDowntimeSlashing

func (m *GenesisState) GetOutstandingDowntimeSlashing() []OutstandingDowntime

func (*GenesisState) GetParams

func (m *GenesisState) GetParams() Params

func (*GenesisState) GetPendingConsumerPackets

func (m *GenesisState) GetPendingConsumerPackets() ConsumerPacketDataList

func (*GenesisState) GetPreCCV

func (m *GenesisState) GetPreCCV() bool

func (*GenesisState) GetProviderChannelId

func (m *GenesisState) GetProviderChannelId() string

func (*GenesisState) GetProviderClientId

func (m *GenesisState) GetProviderClientId() string

func (*GenesisState) GetProviderClientState

func (m *GenesisState) GetProviderClientState() *_07_tendermint.ClientState

func (*GenesisState) GetProviderConsensusState

func (m *GenesisState) GetProviderConsensusState() *_07_tendermint.ConsensusState

func (*GenesisState) Marshal

func (m *GenesisState) Marshal() (dAtA []byte, err error)

func (*GenesisState) MarshalTo

func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)

func (*GenesisState) MarshalToSizedBuffer

func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GenesisState) ProtoMessage

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset

func (m *GenesisState) Reset()

func (*GenesisState) Size

func (m *GenesisState) Size() (n int)

func (*GenesisState) String

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal

func (m *GenesisState) Unmarshal(dAtA []byte) error

func (GenesisState) Validate

func (gs GenesisState) Validate() error

func (*GenesisState) XXX_DiscardUnknown

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal

func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenesisState) XXX_Merge

func (m *GenesisState) XXX_Merge(src proto.Message)

func (*GenesisState) XXX_Size

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal

func (m *GenesisState) XXX_Unmarshal(b []byte) error

type HandshakeMetadata

type HandshakeMetadata struct {
	ProviderFeePoolAddr string `protobuf:"bytes,1,opt,name=provider_fee_pool_addr,json=providerFeePoolAddr,proto3" json:"provider_fee_pool_addr,omitempty"`
	Version             string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
}

Note this type is used during IBC handshake methods for both the consumer and provider

func (*HandshakeMetadata) Descriptor

func (*HandshakeMetadata) Descriptor() ([]byte, []int)

func (*HandshakeMetadata) GetProviderFeePoolAddr

func (m *HandshakeMetadata) GetProviderFeePoolAddr() string

func (*HandshakeMetadata) GetVersion

func (m *HandshakeMetadata) GetVersion() string

func (*HandshakeMetadata) Marshal

func (m *HandshakeMetadata) Marshal() (dAtA []byte, err error)

func (*HandshakeMetadata) MarshalTo

func (m *HandshakeMetadata) MarshalTo(dAtA []byte) (int, error)

func (*HandshakeMetadata) MarshalToSizedBuffer

func (m *HandshakeMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*HandshakeMetadata) ProtoMessage

func (*HandshakeMetadata) ProtoMessage()

func (*HandshakeMetadata) Reset

func (m *HandshakeMetadata) Reset()

func (*HandshakeMetadata) Size

func (m *HandshakeMetadata) Size() (n int)

func (*HandshakeMetadata) String

func (m *HandshakeMetadata) String() string

func (*HandshakeMetadata) Unmarshal

func (m *HandshakeMetadata) Unmarshal(dAtA []byte) error

func (*HandshakeMetadata) XXX_DiscardUnknown

func (m *HandshakeMetadata) XXX_DiscardUnknown()

func (*HandshakeMetadata) XXX_Marshal

func (m *HandshakeMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HandshakeMetadata) XXX_Merge

func (m *HandshakeMetadata) XXX_Merge(src proto.Message)

func (*HandshakeMetadata) XXX_Size

func (m *HandshakeMetadata) XXX_Size() int

func (*HandshakeMetadata) XXX_Unmarshal

func (m *HandshakeMetadata) XXX_Unmarshal(b []byte) error

type HeightToValsetUpdateID

type HeightToValsetUpdateID struct {
	Height         uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
	ValsetUpdateId uint64 `protobuf:"varint,2,opt,name=valset_update_id,json=valsetUpdateId,proto3" json:"valset_update_id,omitempty"`
}

HeightValsetUpdateID represents a mapping internal to the consumer CCV module AND used in shared consumer genesis state, which links a block height to each recv valset update id.

func (*HeightToValsetUpdateID) Descriptor

func (*HeightToValsetUpdateID) Descriptor() ([]byte, []int)

func (*HeightToValsetUpdateID) GetHeight

func (m *HeightToValsetUpdateID) GetHeight() uint64

func (*HeightToValsetUpdateID) GetValsetUpdateId

func (m *HeightToValsetUpdateID) GetValsetUpdateId() uint64

func (*HeightToValsetUpdateID) Marshal

func (m *HeightToValsetUpdateID) Marshal() (dAtA []byte, err error)

func (*HeightToValsetUpdateID) MarshalTo

func (m *HeightToValsetUpdateID) MarshalTo(dAtA []byte) (int, error)

func (*HeightToValsetUpdateID) MarshalToSizedBuffer

func (m *HeightToValsetUpdateID) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*HeightToValsetUpdateID) ProtoMessage

func (*HeightToValsetUpdateID) ProtoMessage()

func (*HeightToValsetUpdateID) Reset

func (m *HeightToValsetUpdateID) Reset()

func (*HeightToValsetUpdateID) Size

func (m *HeightToValsetUpdateID) Size() (n int)

func (*HeightToValsetUpdateID) String

func (m *HeightToValsetUpdateID) String() string

func (*HeightToValsetUpdateID) Unmarshal

func (m *HeightToValsetUpdateID) Unmarshal(dAtA []byte) error

func (*HeightToValsetUpdateID) XXX_DiscardUnknown

func (m *HeightToValsetUpdateID) XXX_DiscardUnknown()

func (*HeightToValsetUpdateID) XXX_Marshal

func (m *HeightToValsetUpdateID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HeightToValsetUpdateID) XXX_Merge

func (m *HeightToValsetUpdateID) XXX_Merge(src proto.Message)

func (*HeightToValsetUpdateID) XXX_Size

func (m *HeightToValsetUpdateID) XXX_Size() int

func (*HeightToValsetUpdateID) XXX_Unmarshal

func (m *HeightToValsetUpdateID) XXX_Unmarshal(b []byte) error

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 {
	Transfer(context.Context, *transfertypes.MsgTransfer) (*transfertypes.MsgTransferResponse, error)
}

IBCTransferKeeper defines the expected interface needed for distribution transfer of tokens from the consumer to the provider chain

type InfractionType

type InfractionType int32

InfractionType indicates the infraction type a validator commited. NOTE: ccv.InfractionType to maintain compatibility between ICS versions using different versions of the cosmos-sdk and ibc-go modules.

const (
	// UNSPECIFIED defines an empty infraction type.
	InfractionEmpty InfractionType = 0
	// DOUBLE_SIGN defines a validator that double-signs a block.
	DoubleSign InfractionType = 1
	// DOWNTIME defines a validator that missed signing too many blocks.
	Downtime InfractionType = 2
)

func (InfractionType) EnumDescriptor

func (InfractionType) EnumDescriptor() ([]byte, []int)

func (InfractionType) String

func (x InfractionType) String() string

type LastTransmissionBlockHeight

type LastTransmissionBlockHeight struct {
	Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
}

LastTransmissionBlockHeight is the last time validator holding pools were transmitted to the provider chain. This type is used internally to the consumer CCV module AND used in shared consumer genesis state.

func (*LastTransmissionBlockHeight) Descriptor

func (*LastTransmissionBlockHeight) Descriptor() ([]byte, []int)

func (*LastTransmissionBlockHeight) GetHeight

func (m *LastTransmissionBlockHeight) GetHeight() int64

func (*LastTransmissionBlockHeight) Marshal

func (m *LastTransmissionBlockHeight) Marshal() (dAtA []byte, err error)

func (*LastTransmissionBlockHeight) MarshalTo

func (m *LastTransmissionBlockHeight) MarshalTo(dAtA []byte) (int, error)

func (*LastTransmissionBlockHeight) MarshalToSizedBuffer

func (m *LastTransmissionBlockHeight) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*LastTransmissionBlockHeight) ProtoMessage

func (*LastTransmissionBlockHeight) ProtoMessage()

func (*LastTransmissionBlockHeight) Reset

func (m *LastTransmissionBlockHeight) Reset()

func (*LastTransmissionBlockHeight) Size

func (m *LastTransmissionBlockHeight) Size() (n int)

func (*LastTransmissionBlockHeight) String

func (m *LastTransmissionBlockHeight) String() string

func (*LastTransmissionBlockHeight) Unmarshal

func (m *LastTransmissionBlockHeight) Unmarshal(dAtA []byte) error

func (*LastTransmissionBlockHeight) XXX_DiscardUnknown

func (m *LastTransmissionBlockHeight) XXX_DiscardUnknown()

func (*LastTransmissionBlockHeight) XXX_Marshal

func (m *LastTransmissionBlockHeight) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LastTransmissionBlockHeight) XXX_Merge

func (m *LastTransmissionBlockHeight) XXX_Merge(src proto.Message)

func (*LastTransmissionBlockHeight) XXX_Size

func (m *LastTransmissionBlockHeight) XXX_Size() int

func (*LastTransmissionBlockHeight) XXX_Unmarshal

func (m *LastTransmissionBlockHeight) XXX_Unmarshal(b []byte) error

type MaturingVSCPacket

type MaturingVSCPacket struct {
	VscId        uint64    `protobuf:"varint,1,opt,name=vscId,proto3" json:"vscId,omitempty"`
	MaturityTime time.Time `protobuf:"bytes,2,opt,name=maturity_time,json=maturityTime,proto3,stdtime" json:"maturity_time"`
}

MaturingVSCPacket represents a vsc packet that is maturing internal to the consumer CCV module, where the consumer has not yet relayed a VSCMatured packet back to the provider. This type is used internally to the consumer CCV module AND used in shared consumer genesis state.

func (*MaturingVSCPacket) Descriptor

func (*MaturingVSCPacket) Descriptor() ([]byte, []int)

func (*MaturingVSCPacket) GetMaturityTime

func (m *MaturingVSCPacket) GetMaturityTime() time.Time

func (*MaturingVSCPacket) GetVscId

func (m *MaturingVSCPacket) GetVscId() uint64

func (*MaturingVSCPacket) Marshal

func (m *MaturingVSCPacket) Marshal() (dAtA []byte, err error)

func (*MaturingVSCPacket) MarshalTo

func (m *MaturingVSCPacket) MarshalTo(dAtA []byte) (int, error)

func (*MaturingVSCPacket) MarshalToSizedBuffer

func (m *MaturingVSCPacket) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MaturingVSCPacket) ProtoMessage

func (*MaturingVSCPacket) ProtoMessage()

func (*MaturingVSCPacket) Reset

func (m *MaturingVSCPacket) Reset()

func (*MaturingVSCPacket) Size

func (m *MaturingVSCPacket) Size() (n int)

func (*MaturingVSCPacket) String

func (m *MaturingVSCPacket) String() string

func (*MaturingVSCPacket) Unmarshal

func (m *MaturingVSCPacket) Unmarshal(dAtA []byte) error

func (MaturingVSCPacket) Validate

func (mat MaturingVSCPacket) Validate() error

func (*MaturingVSCPacket) XXX_DiscardUnknown

func (m *MaturingVSCPacket) XXX_DiscardUnknown()

func (*MaturingVSCPacket) XXX_Marshal

func (m *MaturingVSCPacket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MaturingVSCPacket) XXX_Merge

func (m *MaturingVSCPacket) XXX_Merge(src proto.Message)

func (*MaturingVSCPacket) XXX_Size

func (m *MaturingVSCPacket) XXX_Size() int

func (*MaturingVSCPacket) XXX_Unmarshal

func (m *MaturingVSCPacket) XXX_Unmarshal(b []byte) error

type OutstandingDowntime

type OutstandingDowntime struct {
	ValidatorConsensusAddress string `` /* 138-byte string literal not displayed */
}

OutstandingDowntime defines the type used internally to the consumer CCV module, AND used in shared consumer genesis state, in order to not send multiple slashing requests for the same downtime infraction.

func (*OutstandingDowntime) Descriptor

func (*OutstandingDowntime) Descriptor() ([]byte, []int)

func (*OutstandingDowntime) GetValidatorConsensusAddress

func (m *OutstandingDowntime) GetValidatorConsensusAddress() string

func (*OutstandingDowntime) Marshal

func (m *OutstandingDowntime) Marshal() (dAtA []byte, err error)

func (*OutstandingDowntime) MarshalTo

func (m *OutstandingDowntime) MarshalTo(dAtA []byte) (int, error)

func (*OutstandingDowntime) MarshalToSizedBuffer

func (m *OutstandingDowntime) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*OutstandingDowntime) ProtoMessage

func (*OutstandingDowntime) ProtoMessage()

func (*OutstandingDowntime) Reset

func (m *OutstandingDowntime) Reset()

func (*OutstandingDowntime) Size

func (m *OutstandingDowntime) Size() (n int)

func (*OutstandingDowntime) String

func (m *OutstandingDowntime) String() string

func (*OutstandingDowntime) Unmarshal

func (m *OutstandingDowntime) Unmarshal(dAtA []byte) error

func (*OutstandingDowntime) XXX_DiscardUnknown

func (m *OutstandingDowntime) XXX_DiscardUnknown()

func (*OutstandingDowntime) XXX_Marshal

func (m *OutstandingDowntime) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*OutstandingDowntime) XXX_Merge

func (m *OutstandingDowntime) XXX_Merge(src proto.Message)

func (*OutstandingDowntime) XXX_Size

func (m *OutstandingDowntime) XXX_Size() int

func (*OutstandingDowntime) XXX_Unmarshal

func (m *OutstandingDowntime) XXX_Unmarshal(b []byte) error

type PacketAckResult

type PacketAckResult []byte

type Params

type Params struct {
	// TODO: Remove enabled flag and find a better way to setup integration tests
	// See: https://github.com/cosmos/interchain-security/issues/339
	Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"`
	///////////////////////
	// Distribution Params
	// Number of blocks between ibc-token-transfers from the consumer chain to
	// the provider chain. Note that at this transmission event a fraction of
	// the accumulated tokens are divided and sent consumer redistribution
	// address.
	BlocksPerDistributionTransmission int64 `` /* 165-byte string literal not displayed */
	// Channel, and provider-chain receiving address to send distribution token
	// transfers over. These parameters is auto-set during the consumer <->
	// provider handshake procedure.
	DistributionTransmissionChannel string `` /* 156-byte string literal not displayed */
	ProviderFeePoolAddrStr          string `` /* 133-byte string literal not displayed */
	// Sent CCV related IBC packets will timeout after this duration
	CcvTimeoutPeriod time.Duration `protobuf:"bytes,5,opt,name=ccv_timeout_period,json=ccvTimeoutPeriod,proto3,stdduration" json:"ccv_timeout_period"`
	// Sent transfer related IBC packets will timeout after this duration
	TransferTimeoutPeriod time.Duration `` /* 128-byte string literal not displayed */
	// The fraction of tokens allocated to the consumer redistribution address
	// during distribution events. The fraction is a string representing a
	// decimal number. For example "0.75" would represent 75%.
	ConsumerRedistributionFraction string `` /* 153-byte string literal not displayed */
	// The number of historical info entries to persist in store.
	// This param is a part of the cosmos sdk staking module. In the case of
	// a ccv enabled consumer chain, the ccv module acts as the staking module.
	HistoricalEntries int64 `protobuf:"varint,8,opt,name=historical_entries,json=historicalEntries,proto3" json:"historical_entries,omitempty"`
	// Unbonding period for the consumer,
	// which should be smaller than that of the provider in general.
	UnbondingPeriod time.Duration `protobuf:"bytes,9,opt,name=unbonding_period,json=unbondingPeriod,proto3,stdduration" json:"unbonding_period"`
	// The threshold for the percentage of validators at the bottom of the set who
	// can opt out of running the consumer chain without being punished. For
	// example, a value of 0.05 means that the validators in the bottom 5% of the
	// set can opt out
	SoftOptOutThreshold string `protobuf:"bytes,10,opt,name=soft_opt_out_threshold,json=softOptOutThreshold,proto3" json:"soft_opt_out_threshold,omitempty"`
	// Reward denoms. These are the denominations which are allowed to be sent to
	// the provider as rewards.
	RewardDenoms []string `protobuf:"bytes,11,rep,name=reward_denoms,json=rewardDenoms,proto3" json:"reward_denoms,omitempty"`
	// Provider-originated reward denoms. These are denoms coming from the
	// provider which are allowed to be used as rewards. e.g. "uatom"
	ProviderRewardDenoms []string `protobuf:"bytes,12,rep,name=provider_reward_denoms,json=providerRewardDenoms,proto3" json:"provider_reward_denoms,omitempty"`
}

Params defines the parameters for CCV consumer module.

Note this type is referenced in both the consumer and provider CCV modules, and persisted on the provider, see MakeConsumerGenesis and SetConsumerGenesis.

TODO: Rename to ConsumerParams. See https://github.com/cosmos/interchain-security/issues/1206

func DefaultParams

func DefaultParams() Params

DefaultParams is the default params for the consumer module

func NewParams

func NewParams(enabled bool, blocksPerDistributionTransmission int64,
	distributionTransmissionChannel, providerFeePoolAddrStr string,
	ccvTimeoutPeriod, transferTimeoutPeriod time.Duration,
	consumerRedistributionFraction string, historicalEntries int64,
	consumerUnbondingPeriod time.Duration, softOptOutThreshold string, rewardDenoms, providerRewardDenoms []string,
) Params

NewParams creates new consumer parameters with provided arguments

func (*Params) Descriptor

func (*Params) Descriptor() ([]byte, []int)

func (*Params) GetBlocksPerDistributionTransmission

func (m *Params) GetBlocksPerDistributionTransmission() int64

func (*Params) GetCcvTimeoutPeriod

func (m *Params) GetCcvTimeoutPeriod() time.Duration

func (*Params) GetConsumerRedistributionFraction

func (m *Params) GetConsumerRedistributionFraction() string

func (*Params) GetDistributionTransmissionChannel

func (m *Params) GetDistributionTransmissionChannel() string

func (*Params) GetEnabled

func (m *Params) GetEnabled() bool

func (*Params) GetHistoricalEntries

func (m *Params) GetHistoricalEntries() int64

func (*Params) GetProviderFeePoolAddrStr

func (m *Params) GetProviderFeePoolAddrStr() string

func (*Params) GetProviderRewardDenoms

func (m *Params) GetProviderRewardDenoms() []string

func (*Params) GetRewardDenoms

func (m *Params) GetRewardDenoms() []string

func (*Params) GetSoftOptOutThreshold

func (m *Params) GetSoftOptOutThreshold() string

func (*Params) GetTransferTimeoutPeriod

func (m *Params) GetTransferTimeoutPeriod() time.Duration

func (*Params) GetUnbondingPeriod

func (m *Params) GetUnbondingPeriod() time.Duration

func (*Params) Marshal

func (m *Params) Marshal() (dAtA []byte, err error)

func (*Params) MarshalTo

func (m *Params) MarshalTo(dAtA []byte) (int, error)

func (*Params) MarshalToSizedBuffer

func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Params) ParamSetPairs

func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs

ParamSetPairs implements params.ParamSet

func (*Params) ProtoMessage

func (*Params) ProtoMessage()

func (*Params) Reset

func (m *Params) Reset()

func (*Params) Size

func (m *Params) Size() (n int)

func (*Params) String

func (m *Params) String() string

func (*Params) Unmarshal

func (m *Params) Unmarshal(dAtA []byte) error

func (Params) Validate

func (p Params) Validate() error

Validate all ccv-consumer module parameters

func (*Params) XXX_DiscardUnknown

func (m *Params) XXX_DiscardUnknown()

func (*Params) XXX_Marshal

func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Params) XXX_Merge

func (m *Params) XXX_Merge(src proto.Message)

func (*Params) XXX_Size

func (m *Params) XXX_Size() int

func (*Params) XXX_Unmarshal

func (m *Params) XXX_Unmarshal(b []byte) error

type PortKeeper

type PortKeeper interface {
	BindPort(ctx sdk.Context, portID string) *capabilitytypes.Capability
}

PortKeeper defines the expected IBC port keeper

type ScopedKeeper

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.Infraction `protobuf:"varint,3,opt,name=infraction,proto3,enum=cosmos.staking.v1beta1.Infraction" 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.Infraction) *SlashPacketData

func (*SlashPacketData) Descriptor

func (*SlashPacketData) Descriptor() ([]byte, []int)

func (*SlashPacketData) GetInfraction

func (m *SlashPacketData) GetInfraction() types1.Infraction

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) MarshalTo

func (m *SlashPacketData) MarshalTo(dAtA []byte) (int, 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) ToV1

func (vdt SlashPacketData) ToV1() *SlashPacketDataV1

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 SlashPacketDataV1

type SlashPacketDataV1 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 InfractionType `protobuf:"varint,3,opt,name=infraction,proto3,enum=interchain_security.ccv.v1.InfractionType" json:"infraction,omitempty"`
}

This packet is sent from the consumer chain to the provider chain It is backward compatible with the ICS v1 and v2 version of the packet.

func NewSlashPacketDataV1

func NewSlashPacketDataV1(validator abci.Validator, valUpdateId uint64, infractionType stakingtypes.Infraction) *SlashPacketDataV1

NewSlashPacketDataV1 creates a new SlashPacketDataV1 that uses ccv.InfractionTypes to maintain backward compatibility.

func (*SlashPacketDataV1) Descriptor

func (*SlashPacketDataV1) Descriptor() ([]byte, []int)

func (SlashPacketDataV1) FromV1

func (vdt1 SlashPacketDataV1) FromV1() *SlashPacketData

FromV1 converts SlashPacketDataV1 to SlashPacketData. Provider must handle both V1 and later versions of the SlashPacketData.

func (*SlashPacketDataV1) GetInfraction

func (m *SlashPacketDataV1) GetInfraction() InfractionType

func (*SlashPacketDataV1) GetValidator

func (m *SlashPacketDataV1) GetValidator() types.Validator

func (*SlashPacketDataV1) GetValsetUpdateId

func (m *SlashPacketDataV1) GetValsetUpdateId() uint64

func (*SlashPacketDataV1) Marshal

func (m *SlashPacketDataV1) Marshal() (dAtA []byte, err error)

func (*SlashPacketDataV1) MarshalTo

func (m *SlashPacketDataV1) MarshalTo(dAtA []byte) (int, error)

func (*SlashPacketDataV1) MarshalToSizedBuffer

func (m *SlashPacketDataV1) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SlashPacketDataV1) ProtoMessage

func (*SlashPacketDataV1) ProtoMessage()

func (*SlashPacketDataV1) Reset

func (m *SlashPacketDataV1) Reset()

func (*SlashPacketDataV1) Size

func (m *SlashPacketDataV1) Size() (n int)

func (*SlashPacketDataV1) String

func (m *SlashPacketDataV1) String() string

func (*SlashPacketDataV1) Unmarshal

func (m *SlashPacketDataV1) Unmarshal(dAtA []byte) error

func (*SlashPacketDataV1) XXX_DiscardUnknown

func (m *SlashPacketDataV1) XXX_DiscardUnknown()

func (*SlashPacketDataV1) XXX_Marshal

func (m *SlashPacketDataV1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SlashPacketDataV1) XXX_Merge

func (m *SlashPacketDataV1) XXX_Merge(src proto.Message)

func (*SlashPacketDataV1) XXX_Size

func (m *SlashPacketDataV1) XXX_Size() int

func (*SlashPacketDataV1) XXX_Unmarshal

func (m *SlashPacketDataV1) 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) math.Int
	SlashWithInfractionReason(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec, stakingtypes.Infraction) math.Int
	Unjail(ctx sdk.Context, addr sdk.ConsAddress)
	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) math.Int
	PutUnbondingOnHold(ctx sdk.Context, id uint64) error
	IterateValidators(ctx sdk.Context, f func(index int64, validator stakingtypes.ValidatorI) (stop bool))
	Validator(ctx sdk.Context, addr sdk.ValAddress) stakingtypes.ValidatorI
	IsValidatorJailed(ctx sdk.Context, addr sdk.ConsAddress) bool
	ValidatorByConsAddr(ctx sdk.Context, consAddr sdk.ConsAddress) stakingtypes.ValidatorI
	Delegation(ctx sdk.Context, addr sdk.AccAddress, valAddr sdk.ValAddress) stakingtypes.DelegationI
	MaxValidators(ctx sdk.Context) uint32
	GetLastTotalPower(ctx sdk.Context) math.Int
	GetLastValidators(ctx sdk.Context) (validators []stakingtypes.Validator)
	GetUnbondingType(ctx sdk.Context, id uint64) (unbondingType stakingtypes.UnbondingType, found bool)
	BondDenom(ctx sdk.Context) (res string)
}

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 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) 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

GetBytes marshals the ValidatorSetChangePacketData into JSON string bytes to be sent over the wire with IBC.

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 (*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

Directories

Path Synopsis
Package keeper is a generated GoMock package.
Package keeper is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL