types

package
v6.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: Apache-2.0 Imports: 38 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"
	EventTypeAddConsumerRewardDenom     = "add_consumer_reward_denom"
	EventTypeRemoveConsumerRewardDenom  = "remove_consumer_reward_denom"
	EventTypeSubmitConsumerMisbehaviour = "submit_consumer_misbehaviour"
	EventTypeSubmitConsumerDoubleVoting = "submit_consumer_double_voting"
	EventTypeExecuteConsumerChainSlash  = "execute_consumer_chain_slash"
	EventTypeConsumerSlashRequest       = "consumer_slash_request"

	AttributeKeyAckSuccess            = "success"
	AttributeKeyAck                   = "acknowledgement"
	AttributeKeyAckError              = "error"
	AttributeInfractionHeight         = "infraction_height"
	AttributeConsumerHeight           = "consumer_height"
	AttributeTimestamp                = "timestamp"
	AttributeInitialHeight            = "initial_height"
	AttributeInitializationTimeout    = "initialization_timeout"
	AttributeTrustingPeriod           = "trusting_period"
	AttributeUnbondingPeriod          = "unbonding_period"
	AttributeProviderValidatorAddress = "provider_validator_address"
	AttributeConsumerConsensusPubKey  = "consumer_consensus_pub_key"
	AttributeConsumerMisbehaviour     = "consumer_misbehaviour"
	AttributeMisbehaviourClientId     = "misbehaviour_client_id"
	AttributeMisbehaviourHeight1      = "misbehaviour_height_1"
	AttributeMisbehaviourHeight2      = "misbehaviour_height_2"
	AttributeConsumerDoubleVoting     = "consumer_double_voting"
	AttributeChainID                  = "chain_id"
	AttributeValidatorAddress         = "validator_address"
	AttributeInfractionType           = "infraction_type"
	AttributeValSetUpdateID           = "valset_update_id"
)

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

	// Default retry delay period is 1 hour.
	DefaultRetryDelayPeriod = time.Hour
)
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 (
	ErrInvalidPacketData           = errorsmod.Register(ModuleName, 1, "invalid CCV packet data")
	ErrInvalidVersion              = errorsmod.Register(ModuleName, 2, "invalid CCV version")
	ErrInvalidChannelFlow          = errorsmod.Register(ModuleName, 3, "invalid message sent to channel end")
	ErrInvalidGenesis              = errorsmod.Register(ModuleName, 4, "invalid genesis state")
	ErrDuplicateChannel            = errorsmod.Register(ModuleName, 5, "CCV channel already exists")
	ErrInvalidVSCMaturedId         = errorsmod.Register(ModuleName, 6, "invalid vscId for VSC packet")
	ErrInvalidVSCMaturedTime       = errorsmod.Register(ModuleName, 7, "invalid maturity time for VSC packet")
	ErrInvalidHandshakeMetadata    = errorsmod.Register(ModuleName, 8, "invalid provider handshake metadata")
	ErrChannelNotFound             = errorsmod.Register(ModuleName, 9, "channel not found")
	ErrClientNotFound              = errorsmod.Register(ModuleName, 10, "client not found")
	ErrInvalidConsumerState        = errorsmod.Register(ModuleName, 11, "provider chain has invalid state for consumer chain")
	ErrInvalidConsumerClient       = errorsmod.Register(ModuleName, 12, "ccv channel is not built on correct client")
	ErrInvalidProposal             = errorsmod.Register(ModuleName, 13, "invalid proposal")
	ErrDuplicateConsumerChain      = errorsmod.Register(ModuleName, 14, "consumer chain already exists")
	ErrConsumerChainNotFound       = errorsmod.Register(ModuleName, 15, "consumer chain not found")
	ErrInvalidDoubleVotingEvidence = errorsmod.Register(ModuleName, 16, "invalid consumer double voting evidence")
	ErrStoreKeyNotFound            = errorsmod.Register(ModuleName, 17, "store key not found")
	ErrStoreUnmarshal              = errorsmod.Register(ModuleName, 18, "cannot unmarshal value from store")
	ErrInvalidConsumerId           = errorsmod.Register(ModuleName, 19, "invalid consumer id")
)

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")
	KeyRewardDenoms                      = []byte("RewardDenoms")
	KeyProviderRewardDenoms              = []byte("ProviderRewardDenoms")
	KeyRetryDelayPeriod                  = []byte("RetryDelayPeriod")
)

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 (

	// 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 (
	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")

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.

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 CreateTransferMemo added in v6.2.0

func CreateTransferMemo(consumerId, chainId string) (string, error)

CreateTransferMemo creates a memo for the IBC transfer of ICS rewards. Note that the memo follows the Fungible Token Transfer v2 standard https://github.com/cosmos/ibc/blob/main/spec/app/ics-020-fungible-token-transfer/README.md#using-the-memo-field

func GetConsAddrFromBech32

func GetConsAddrFromBech32(bech32str string) (sdk.ConsAddress, error)

GetConsAddrFromBech32 returns a ConsAddress from a Bech32 with an arbitrary prefix

func GetLastBondedValidatorsUtil

func GetLastBondedValidatorsUtil(ctx sdk.Context, stakingKeeper StakingKeeper, maxVals uint32) ([]stakingtypes.Validator, error)

GetLastBondedValidatorsUtil iterates the last validator powers in the staking module and returns the first maxVals many validators with the largest powers.

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

func ValidateAccAddress(i interface{}) error

func ValidateBool

func ValidateBool(i interface{}) error

func ValidateChannelIdentifier

func ValidateChannelIdentifier(i interface{}) error

func ValidateConsumerId added in v6.2.0

func ValidateConsumerId(consumerId string) error

ValidateConsumerId validates the provided consumer id and returns an error if it is not valid

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 ValidateString

func ValidateString(i interface{}) error

func ValidateStringFraction

func ValidateStringFraction(i interface{}) error

Types

type AccountKeeper

type AccountKeeper interface {
	GetModuleAccount(ctx context.Context, name string) sdk.ModuleAccountI
	AddressCodec() addresscodec.Codec
}

AccountKeeper defines the expected account keeper used for simulations

type BankKeeper

type BankKeeper interface {
	GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin
	GetAllBalances(ctx context.Context, addr sdk.AccAddress) sdk.Coins
	SendCoinsFromModuleToModule(ctx context.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)
	ClientStore(ctx sdk.Context, clientID string) storetypes.KVStore
	SetClientState(ctx sdk.Context, clientID string, clientState ibcexported.ClientState)
	GetClientConsensusState(ctx sdk.Context, clientID string, height ibcexported.Height) (ibcexported.ConsensusState, bool)
}

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 ConsumerGenesisState

type ConsumerGenesisState struct {
	Params   ConsumerParams `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
	Provider ProviderInfo   `protobuf:"bytes,2,opt,name=provider,proto3" json:"provider"`
	// true for new chain, false for chain restart.
	NewChain bool `protobuf:"varint,3,opt,name=new_chain,json=newChain,proto3" json:"new_chain,omitempty"`
}

ConsumerGenesisState defines shared genesis information between provider and consumer

func DefaultConsumerGenesisState

func DefaultConsumerGenesisState() *ConsumerGenesisState

DefaultConsumerGenesisState 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 NewInitialConsumerGenesisState

func NewInitialConsumerGenesisState(cs *ibctmtypes.ClientState, consState *ibctmtypes.ConsensusState,
	initValSet []abci.ValidatorUpdate, params ConsumerParams,
) *ConsumerGenesisState

NewInitialConsumerGenesisState returns a ConsumerGenesisState for a completely new consumer chain.

func (*ConsumerGenesisState) Descriptor

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

func (*ConsumerGenesisState) GetNewChain

func (m *ConsumerGenesisState) GetNewChain() bool

func (*ConsumerGenesisState) GetParams

func (m *ConsumerGenesisState) GetParams() ConsumerParams

func (*ConsumerGenesisState) GetProvider

func (m *ConsumerGenesisState) GetProvider() ProviderInfo

func (*ConsumerGenesisState) Marshal

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

func (*ConsumerGenesisState) MarshalTo

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

func (*ConsumerGenesisState) MarshalToSizedBuffer

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

func (*ConsumerGenesisState) ProtoMessage

func (*ConsumerGenesisState) ProtoMessage()

func (*ConsumerGenesisState) Reset

func (m *ConsumerGenesisState) Reset()

func (*ConsumerGenesisState) Size

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

func (*ConsumerGenesisState) String

func (m *ConsumerGenesisState) String() string

func (*ConsumerGenesisState) Unmarshal

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

func (ConsumerGenesisState) Validate

func (gs ConsumerGenesisState) Validate() error

func (*ConsumerGenesisState) XXX_DiscardUnknown

func (m *ConsumerGenesisState) XXX_DiscardUnknown()

func (*ConsumerGenesisState) XXX_Marshal

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

func (*ConsumerGenesisState) XXX_Merge

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

func (*ConsumerGenesisState) XXX_Size

func (m *ConsumerGenesisState) XXX_Size() int

func (*ConsumerGenesisState) XXX_Unmarshal

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

type ConsumerHooks

type ConsumerHooks interface {
	AfterValidatorBonded(ctx context.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) Validate

func (cp ConsumerPacketData) Validate() (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 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 ConsumerParams

type ConsumerParams 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"`
	// !!! DEPRECATED !!! soft_opt_out_threshold is deprecated. see docs/docs/adrs/adr-015-partial-set-security.md
	SoftOptOutThreshold string `protobuf:"bytes,10,opt,name=soft_opt_out_threshold,json=softOptOutThreshold,proto3" json:"soft_opt_out_threshold,omitempty"` // Deprecated: Do not use.
	// 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"`
	// The period after which a consumer can retry sending a throttled packet.
	RetryDelayPeriod time.Duration `protobuf:"bytes,13,opt,name=retry_delay_period,json=retryDelayPeriod,proto3,stdduration" json:"retry_delay_period"`
	// The consumer ID of this consumer chain. Used by the consumer module to send
	// ICS rewards.
	ConsumerId string `protobuf:"bytes,14,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"`
}

ConsumerParams 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.

func DefaultParams

func DefaultParams() ConsumerParams

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,
	rewardDenoms, providerRewardDenoms []string, retryDelayPeriod time.Duration,
	consumerId string,
) ConsumerParams

NewParams creates new consumer parameters with provided arguments

func (*ConsumerParams) Descriptor

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

func (*ConsumerParams) GetBlocksPerDistributionTransmission

func (m *ConsumerParams) GetBlocksPerDistributionTransmission() int64

func (*ConsumerParams) GetCcvTimeoutPeriod

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

func (*ConsumerParams) GetConsumerId added in v6.2.0

func (m *ConsumerParams) GetConsumerId() string

func (*ConsumerParams) GetConsumerRedistributionFraction

func (m *ConsumerParams) GetConsumerRedistributionFraction() string

func (*ConsumerParams) GetDistributionTransmissionChannel

func (m *ConsumerParams) GetDistributionTransmissionChannel() string

func (*ConsumerParams) GetEnabled

func (m *ConsumerParams) GetEnabled() bool

func (*ConsumerParams) GetHistoricalEntries

func (m *ConsumerParams) GetHistoricalEntries() int64

func (*ConsumerParams) GetProviderFeePoolAddrStr

func (m *ConsumerParams) GetProviderFeePoolAddrStr() string

func (*ConsumerParams) GetProviderRewardDenoms

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

func (*ConsumerParams) GetRetryDelayPeriod

func (m *ConsumerParams) GetRetryDelayPeriod() time.Duration

func (*ConsumerParams) GetRewardDenoms

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

func (*ConsumerParams) GetSoftOptOutThreshold deprecated

func (m *ConsumerParams) GetSoftOptOutThreshold() string

Deprecated: Do not use.

func (*ConsumerParams) GetTransferTimeoutPeriod

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

func (*ConsumerParams) GetUnbondingPeriod

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

func (*ConsumerParams) Marshal

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

func (*ConsumerParams) MarshalTo

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

func (*ConsumerParams) MarshalToSizedBuffer

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

func (*ConsumerParams) ParamSetPairs

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

ParamSetPairs implements params.ParamSet

func (*ConsumerParams) ProtoMessage

func (*ConsumerParams) ProtoMessage()

func (*ConsumerParams) Reset

func (m *ConsumerParams) Reset()

func (*ConsumerParams) Size

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

func (*ConsumerParams) String

func (m *ConsumerParams) String() string

func (*ConsumerParams) Unmarshal

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

func (ConsumerParams) Validate

func (p ConsumerParams) Validate() error

Validate all ccv-consumer module parameters

func (*ConsumerParams) XXX_DiscardUnknown

func (m *ConsumerParams) XXX_DiscardUnknown()

func (*ConsumerParams) XXX_Marshal

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

func (*ConsumerParams) XXX_Merge

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

func (*ConsumerParams) XXX_Size

func (m *ConsumerParams) XXX_Size() int

func (*ConsumerParams) XXX_Unmarshal

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

type DistributionKeeper

type DistributionKeeper interface {
	FundCommunityPool(ctx context.Context, amount sdk.Coins, sender sdk.AccAddress) error
	GetCommunityTax(ctx context.Context) (math.LegacyDec, error)
	AllocateTokensToValidator(ctx context.Context, validator stakingtypes.ValidatorI, reward sdk.DecCoins) error
}

DistributionKeeper defines the expected interface of the distribution keeper

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

type IBCCoreKeeper interface {
	ChannelOpenInit(
		goCtx context.Context,
		msg *channeltypes.MsgChannelOpenInit,
	) (*channeltypes.MsgChannelOpenInitResponse, error)
}

IBCCoreKeeper defines the expected interface needed for opening 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 committed. 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 LegacyParamSubspace

type LegacyParamSubspace interface {
	Get(ctx sdktypes.Context, key []byte, ptr interface{})
}

helper interface sdk::paramtypes.ParamSpace implicitly implements this interface because it implements the Get(ctx sdk.Context, key []byte, ptr interface{}) since only Get(...) is needed to migrate params we can ignore the other methods on paramtypes.ParamSpace.

type PacketAckResult

type PacketAckResult []byte

type PortKeeper

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

PortKeeper defines the expected IBC port keeper

type ProviderInfo

type ProviderInfo struct {
	// ProviderClientState filled in on new chain, nil on restart.
	ClientState *_07_tendermint.ClientState `protobuf:"bytes,1,opt,name=client_state,json=clientState,proto3" json:"client_state,omitempty"`
	// ProviderConsensusState filled in on new chain, nil on restart.
	ConsensusState *_07_tendermint.ConsensusState `protobuf:"bytes,2,opt,name=consensus_state,json=consensusState,proto3" json:"consensus_state,omitempty"`
	// InitialValset filled in on new chain and on restart.
	InitialValSet []types.ValidatorUpdate `protobuf:"bytes,3,rep,name=initial_val_set,json=initialValSet,proto3" json:"initial_val_set"`
}

ProviderInfo defines all information a consumer needs from a provider Shared data type between provider and consumer

func (*ProviderInfo) Descriptor

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

func (*ProviderInfo) GetClientState

func (m *ProviderInfo) GetClientState() *_07_tendermint.ClientState

func (*ProviderInfo) GetConsensusState

func (m *ProviderInfo) GetConsensusState() *_07_tendermint.ConsensusState

func (*ProviderInfo) GetInitialValSet

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

func (*ProviderInfo) Marshal

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

func (*ProviderInfo) MarshalTo

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

func (*ProviderInfo) MarshalToSizedBuffer

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

func (*ProviderInfo) ProtoMessage

func (*ProviderInfo) ProtoMessage()

func (*ProviderInfo) Reset

func (m *ProviderInfo) Reset()

func (*ProviderInfo) Size

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

func (*ProviderInfo) String

func (m *ProviderInfo) String() string

func (*ProviderInfo) Unmarshal

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

func (*ProviderInfo) XXX_DiscardUnknown

func (m *ProviderInfo) XXX_DiscardUnknown()

func (*ProviderInfo) XXX_Marshal

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

func (*ProviderInfo) XXX_Merge

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

func (*ProviderInfo) XXX_Size

func (m *ProviderInfo) XXX_Size() int

func (*ProviderInfo) XXX_Unmarshal

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

type RewardMemo added in v6.2.0

type RewardMemo struct {
	ConsumerId string `json:"consumerId"`
	ChainId    string `json:"chainId"`
	Memo       string `json:"memo"`
}

func GetRewardMemoFromTransferMemo added in v6.2.0

func GetRewardMemoFromTransferMemo(memo string) (RewardMemo, error)

func NewRewardMemo added in v6.2.0

func NewRewardMemo(consumerId, chainId, memo string) RewardMemo

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

func (vdt SlashPacketData) Validate() 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(context.Context, sdk.ConsAddress, time.Time) error // called from provider keeper only
	GetValidatorSigningInfo(context.Context, sdk.ConsAddress) (slashingtypes.ValidatorSigningInfo, error)
	SetValidatorSigningInfo(context.Context, sdk.ConsAddress, slashingtypes.ValidatorSigningInfo) error
	DowntimeJailDuration(context.Context) (time.Duration, error)
	SlashFractionDowntime(context.Context) (math.LegacyDec, error)
	SlashFractionDoubleSign(context.Context) (math.LegacyDec, error)
	Tombstone(context.Context, sdk.ConsAddress) error
	IsTombstoned(context.Context, sdk.ConsAddress) bool
}

SlashingKeeper defines the contract expected to perform ccv slashing

type StakingKeeper

type StakingKeeper interface {
	GetValidatorUpdates(ctx context.Context) ([]abci.ValidatorUpdate, error)
	UnbondingCanComplete(ctx context.Context, id uint64) error
	UnbondingTime(ctx context.Context) (time.Duration, error)
	GetValidatorByConsAddr(ctx context.Context, consAddr sdk.ConsAddress) (stakingtypes.Validator, error)
	GetLastValidatorPower(ctx context.Context, operator sdk.ValAddress) (int64, error)
	Jail(context.Context, sdk.ConsAddress) error // jail a validator
	Slash(ctx context.Context, consAddr sdk.ConsAddress, infractionHeight, power int64, slashFactor math.LegacyDec) (math.Int, error)
	SlashWithInfractionReason(ctx context.Context, consAddr sdk.ConsAddress, infractionHeight, power int64, slashFactor math.LegacyDec, infraction stakingtypes.Infraction) (math.Int, error)
	SlashUnbondingDelegation(ctx context.Context, unbondingDelegation stakingtypes.UnbondingDelegation, infractionHeight int64, slashFactor math.LegacyDec) (math.Int, error)
	SlashRedelegation(ctx context.Context, srcValidator stakingtypes.Validator, redelegation stakingtypes.Redelegation, infractionHeight int64, slashFactor math.LegacyDec) (math.Int, error)
	Unjail(ctx context.Context, addr sdk.ConsAddress) error
	GetValidator(ctx context.Context, addr sdk.ValAddress) (stakingtypes.Validator, error)
	IterateLastValidatorPowers(ctx context.Context, cb func(addr sdk.ValAddress, power int64) (stop bool)) error
	PowerReduction(ctx context.Context) math.Int
	PutUnbondingOnHold(ctx context.Context, id uint64) error
	IterateValidators(ctx context.Context, f func(index int64, validator stakingtypes.ValidatorI) (stop bool)) error
	Validator(ctx context.Context, addr sdk.ValAddress) (stakingtypes.ValidatorI, error)
	IsValidatorJailed(ctx context.Context, addr sdk.ConsAddress) (bool, error)
	ValidatorByConsAddr(ctx context.Context, consAddr sdk.ConsAddress) (stakingtypes.ValidatorI, error)
	Delegation(ctx context.Context, addr sdk.AccAddress, valAddr sdk.ValAddress) (stakingtypes.DelegationI, error)
	MaxValidators(ctx context.Context) (uint32, error)
	GetLastTotalPower(ctx context.Context) (math.Int, error)
	BondDenom(ctx context.Context) (string, error)
	GetUnbondingDelegationsFromValidator(ctx context.Context, valAddr sdk.ValAddress) ([]stakingtypes.UnbondingDelegation, error)
	GetRedelegationsFromSrcValidator(ctx context.Context, valAddr sdk.ValAddress) ([]stakingtypes.Redelegation, error)
	GetUnbondingType(ctx context.Context, id uint64) (stakingtypes.UnbondingType, error)
	MinCommissionRate(ctx context.Context) (math.LegacyDec, error)
	GetUnbondingDelegationByUnbondingID(ctx context.Context, id uint64) (stakingtypes.UnbondingDelegation, error)
	GetRedelegationByUnbondingID(ctx context.Context, id uint64) (stakingtypes.Redelegation, error)
	GetValidatorByUnbondingID(ctx context.Context, id uint64) (stakingtypes.Validator, error)
	GetBondedValidatorsByPower(ctx context.Context) ([]stakingtypes.Validator, error)
	ValidatorAddressCodec() addresscodec.Codec
	IterateDelegations(
		ctx context.Context, delegator sdk.AccAddress,
		fn func(index int64, delegation stakingtypes.DelegationI) (stop bool),
	) error
	IterateBondedValidatorsByPower(
		context.Context, func(index int64, validator stakingtypes.ValidatorI) (stop bool),
	) error
	StakingTokenSupply(ctx context.Context) (math.Int, error)
	BondedRatio(ctx context.Context) (math.LegacyDec, error)
	TotalBondedTokens(ctx context.Context) (math.Int, error)
}

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

func (mat VSCMaturedPacketData) Validate() error

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

func (vsc ValidatorSetChangePacketData) Validate() error

Validate 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

Jump to

Keyboard shortcuts

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