types

package
v0.50.7 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 39 Imported by: 2,234

Documentation

Overview

NOTE: Usage of x/params to manage parameters is deprecated in favor of x/gov controlled execution of MsgUpdateParams messages. These types remains solely for migration purposes and will be removed in a future release.

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	EventTypeSlash    = "slash"
	EventTypeLiveness = "liveness"

	AttributeKeyAddress      = "address"
	AttributeKeyHeight       = "height"
	AttributeKeyPower        = "power"
	AttributeKeyReason       = "reason"
	AttributeKeyJailed       = "jailed"
	AttributeKeyMissedBlocks = "missed_blocks"
	AttributeKeyBurnedCoins  = "burned_coins"

	AttributeValueUnspecified      = "unspecified"
	AttributeValueDoubleSign       = "double_sign"
	AttributeValueMissingSignature = "missing_signature"
)

Slashing module event types

View Source
const (
	// ModuleName is the name of the module
	ModuleName = "slashing"

	// StoreKey is the store key string for slashing
	StoreKey = ModuleName

	// RouterKey is the message route for slashing
	RouterKey = ModuleName

	// MissedBlockBitmapChunkSize defines the chunk size, in number of bits, of a
	// validator missed block bitmap. Chunks are used to reduce the storage and
	// write overhead of IAVL nodes. The total size of the bitmap is roughly in
	// the range [0, SignedBlocksWindow) where each bit represents a block. A
	// validator's IndexOffset modulo the SignedBlocksWindow is used to retrieve
	// the chunk in that bitmap range. Once the chunk is retrieved, the same index
	// is used to check or flip a bit, where if a bit is set, it indicates the
	// validator missed that block.
	//
	// For a bitmap of N items, i.e. a validator's signed block window, the amount
	// of write complexity per write with a factor of f being the overhead of
	// IAVL being un-optimized, i.e. 2-4, is as follows:
	//
	// ChunkSize + (f * 256 <IAVL leaf hash>) + 256 * log_2(N / ChunkSize)
	//
	// As for the storage overhead, with the same factor f, it is as follows:
	// (N - 256) + (N / ChunkSize) * (512 * f)
	MissedBlockBitmapChunkSize = 1024 // 2^10 bits
)
View Source
const (
	DefaultSignedBlocksWindow   = int64(100)
	DefaultDowntimeJailDuration = 60 * 10 * time.Second
)

Default parameter namespace

View Source
const (
	QueryParameters   = "parameters"
	QuerySigningInfo  = "signingInfo"
	QuerySigningInfos = "signingInfos"
)

Query endpoints supported by the slashing querier

Variables

View Source
var (
	ErrNoValidatorForAddress        = errors.Register(ModuleName, 2, "address is not associated with any known validator")
	ErrBadValidatorAddr             = errors.Register(ModuleName, 3, "validator does not exist for that address")
	ErrValidatorJailed              = errors.Register(ModuleName, 4, "validator still jailed; cannot be unjailed")
	ErrValidatorNotJailed           = errors.Register(ModuleName, 5, "validator not jailed; cannot be unjailed")
	ErrMissingSelfDelegation        = errors.Register(ModuleName, 6, "validator has no self-delegation; cannot be unjailed")
	ErrSelfDelegationTooLowToUnjail = errors.Register(ModuleName, 7, "validator's self delegation less than minimum; cannot be unjailed")
	ErrNoSigningInfoFound           = errors.Register(ModuleName, 8, "no validator signing info found")
	ErrValidatorTombstoned          = errors.Register(ModuleName, 9, "validator already tombstoned")
)

x/slashing module sentinel errors

View Source
var (
	ErrInvalidLengthGenesis        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGenesis          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ParamsKey                           = []byte{0x00} // Prefix for params key
	ValidatorSigningInfoKeyPrefix       = []byte{0x01} // Prefix for signing info
	ValidatorMissedBlockBitmapKeyPrefix = []byte{0x02} // Prefix for missed block bitmap
	AddrPubkeyRelationKeyPrefix         = []byte{0x03} // Prefix for address-pubkey relation
)
View Source
var (
	DefaultMinSignedPerWindow      = math.LegacyNewDecWithPrec(5, 1)
	DefaultSlashFractionDoubleSign = math.LegacyNewDec(1).Quo(math.LegacyNewDec(20))
	DefaultSlashFractionDowntime   = math.LegacyNewDec(1).Quo(math.LegacyNewDec(100))
)
View Source
var (
	KeySignedBlocksWindow      = []byte("SignedBlocksWindow")
	KeyMinSignedPerWindow      = []byte("MinSignedPerWindow")
	KeyDowntimeJailDuration    = []byte("DowntimeJailDuration")
	KeySlashFractionDoubleSign = []byte("SlashFractionDoubleSign")
	KeySlashFractionDowntime   = []byte("SlashFractionDowntime")
)

Parameter store keys

View Source
var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthSlashing        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowSlashing          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupSlashing = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTx        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTx          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
)

Functions

func AddrPubkeyRelationKey

func AddrPubkeyRelationKey(addr []byte) []byte

AddrPubkeyRelationKey gets pubkey relation key used to get the pubkey from the address

func ParamKeyTable deprecated

func ParamKeyTable() paramtypes.KeyTable

Deprecated: ParamKeyTable for slashing module

func RegisterInterfaces added in v0.40.0

func RegisterInterfaces(registry types.InterfaceRegistry)

RegisterInterfaces registers the interfaces types with the Interface Registry.

func RegisterLegacyAminoCodec added in v0.40.0

func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

RegisterLegacyAminoCodec registers concrete types on LegacyAmino codec

func RegisterMsgServer added in v0.40.0

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

func RegisterQueryHandler added in v0.40.0

func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterQueryHandler registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterQueryHandlerClient added in v0.40.0

func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error

RegisterQueryHandlerClient registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "QueryClient" to call the correct interceptors.

func RegisterQueryHandlerFromEndpoint added in v0.40.0

func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterQueryHandlerServer added in v0.40.0

func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error

RegisterQueryHandlerServer registers the http handlers for service Query to "mux". UnaryRPC :call QueryServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer added in v0.40.0

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

func ValidateGenesis

func ValidateGenesis(data GenesisState) error

ValidateGenesis validates the slashing genesis parameters

func ValidatorMissedBlockBitmapKey added in v0.50.1

func ValidatorMissedBlockBitmapKey(v sdk.ConsAddress, chunkIndex int64) []byte

ValidatorMissedBlockBitmapKey returns the key for a validator's missed block bitmap chunk.

func ValidatorMissedBlockBitmapPrefixKey added in v0.50.1

func ValidatorMissedBlockBitmapPrefixKey(v sdk.ConsAddress) []byte

ValidatorMissedBlockBitmapPrefixKey returns the key prefix for a validator's missed block bitmap.

func ValidatorSigningInfoAddress

func ValidatorSigningInfoAddress(key []byte) (v sdk.ConsAddress)

ValidatorSigningInfoAddress - extract the address from a validator signing info key

func ValidatorSigningInfoKey

func ValidatorSigningInfoKey(v sdk.ConsAddress) []byte

ValidatorSigningInfoKey - stored by *Consensus* address (not operator address)

Types

type AccountKeeper

type AccountKeeper interface {
	GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI
	IterateAccounts(ctx context.Context, process func(sdk.AccountI) (stop bool))
}

AccountKeeper expected account keeper

type BankKeeper

type BankKeeper interface {
	GetAllBalances(ctx context.Context, addr sdk.AccAddress) sdk.Coins
	GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin
	LockedCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins
	SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins
}

BankKeeper defines the expected interface needed to retrieve account balances.

type GenesisState

type GenesisState struct {
	// params defines all the parameters of the module.
	Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
	// signing_infos represents a map between validator addresses and their
	// signing infos.
	SigningInfos []SigningInfo `protobuf:"bytes,2,rep,name=signing_infos,json=signingInfos,proto3" json:"signing_infos"`
	// missed_blocks represents a map between validator addresses and their
	// missed blocks.
	MissedBlocks []ValidatorMissedBlocks `protobuf:"bytes,3,rep,name=missed_blocks,json=missedBlocks,proto3" json:"missed_blocks"`
}

GenesisState defines the slashing module's genesis state.

func DefaultGenesisState

func DefaultGenesisState() *GenesisState

DefaultGenesisState - default GenesisState used by Cosmos Hub

func NewGenesisState

func NewGenesisState(
	params Params, signingInfos []SigningInfo, missedBlocks []ValidatorMissedBlocks,
) *GenesisState

NewGenesisState creates a new GenesisState object

func (*GenesisState) Descriptor added in v0.40.0

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

func (*GenesisState) GetMissedBlocks added in v0.40.0

func (m *GenesisState) GetMissedBlocks() []ValidatorMissedBlocks

func (*GenesisState) GetParams added in v0.40.0

func (m *GenesisState) GetParams() Params

func (*GenesisState) GetSigningInfos added in v0.40.0

func (m *GenesisState) GetSigningInfos() []SigningInfo

func (*GenesisState) Marshal added in v0.40.0

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

func (*GenesisState) MarshalTo added in v0.40.0

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

func (*GenesisState) MarshalToSizedBuffer added in v0.40.0

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

func (*GenesisState) ProtoMessage added in v0.40.0

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset added in v0.40.0

func (m *GenesisState) Reset()

func (*GenesisState) Size added in v0.40.0

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

func (*GenesisState) String added in v0.40.0

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal added in v0.40.0

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

func (*GenesisState) XXX_DiscardUnknown added in v0.40.0

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal added in v0.40.0

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

func (*GenesisState) XXX_Merge added in v0.40.0

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

func (*GenesisState) XXX_Size added in v0.40.0

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal added in v0.40.0

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

type MissedBlock

type MissedBlock struct {
	// index is the height at which the block was missed.
	Index int64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
	// missed is the missed status.
	Missed bool `protobuf:"varint,2,opt,name=missed,proto3" json:"missed,omitempty"`
}

MissedBlock contains height and missed status as boolean.

func NewMissedBlock

func NewMissedBlock(index int64, missed bool) MissedBlock

NewMissedBlock creates a new MissedBlock instance

func (*MissedBlock) Descriptor added in v0.40.0

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

func (*MissedBlock) GetIndex added in v0.40.0

func (m *MissedBlock) GetIndex() int64

func (*MissedBlock) GetMissed added in v0.40.0

func (m *MissedBlock) GetMissed() bool

func (*MissedBlock) Marshal added in v0.40.0

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

func (*MissedBlock) MarshalTo added in v0.40.0

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

func (*MissedBlock) MarshalToSizedBuffer added in v0.40.0

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

func (*MissedBlock) ProtoMessage added in v0.40.0

func (*MissedBlock) ProtoMessage()

func (*MissedBlock) Reset added in v0.40.0

func (m *MissedBlock) Reset()

func (*MissedBlock) Size added in v0.40.0

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

func (*MissedBlock) String added in v0.40.0

func (m *MissedBlock) String() string

func (*MissedBlock) Unmarshal added in v0.40.0

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

func (*MissedBlock) XXX_DiscardUnknown added in v0.40.0

func (m *MissedBlock) XXX_DiscardUnknown()

func (*MissedBlock) XXX_Marshal added in v0.40.0

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

func (*MissedBlock) XXX_Merge added in v0.40.0

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

func (*MissedBlock) XXX_Size added in v0.40.0

func (m *MissedBlock) XXX_Size() int

func (*MissedBlock) XXX_Unmarshal added in v0.40.0

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

type MsgClient added in v0.40.0

type MsgClient interface {
	// Unjail defines a method for unjailing a jailed validator, thus returning
	// them into the bonded validator set, so they can begin receiving provisions
	// and rewards again.
	Unjail(ctx context.Context, in *MsgUnjail, opts ...grpc.CallOption) (*MsgUnjailResponse, error)
	// UpdateParams defines a governance operation for updating the x/slashing module
	// parameters. The authority defaults to the x/gov module account.
	//
	// Since: cosmos-sdk 0.47
	UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
}

MsgClient is the client API for Msg service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewMsgClient added in v0.40.0

func NewMsgClient(cc grpc1.ClientConn) MsgClient

type MsgServer added in v0.40.0

type MsgServer interface {
	// Unjail defines a method for unjailing a jailed validator, thus returning
	// them into the bonded validator set, so they can begin receiving provisions
	// and rewards again.
	Unjail(context.Context, *MsgUnjail) (*MsgUnjailResponse, error)
	// UpdateParams defines a governance operation for updating the x/slashing module
	// parameters. The authority defaults to the x/gov module account.
	//
	// Since: cosmos-sdk 0.47
	UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
}

MsgServer is the server API for Msg service.

type MsgUnjail

type MsgUnjail struct {
	ValidatorAddr string `protobuf:"bytes,1,opt,name=validator_addr,json=validatorAddr,proto3" json:"address"`
}

MsgUnjail defines the Msg/Unjail request type

func NewMsgUnjail

func NewMsgUnjail(validatorAddr string) *MsgUnjail

NewMsgUnjail creates a new MsgUnjail instance

func (*MsgUnjail) Descriptor

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

func (*MsgUnjail) Equal

func (this *MsgUnjail) Equal(that interface{}) bool

func (*MsgUnjail) Marshal

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

func (*MsgUnjail) MarshalTo

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

func (*MsgUnjail) MarshalToSizedBuffer

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

func (*MsgUnjail) ProtoMessage

func (*MsgUnjail) ProtoMessage()

func (*MsgUnjail) Reset

func (m *MsgUnjail) Reset()

func (*MsgUnjail) Size

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

func (*MsgUnjail) String

func (m *MsgUnjail) String() string

func (*MsgUnjail) Unmarshal

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

func (*MsgUnjail) XXX_DiscardUnknown

func (m *MsgUnjail) XXX_DiscardUnknown()

func (*MsgUnjail) XXX_Marshal

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

func (*MsgUnjail) XXX_Merge

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

func (*MsgUnjail) XXX_Size

func (m *MsgUnjail) XXX_Size() int

func (*MsgUnjail) XXX_Unmarshal

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

type MsgUnjailResponse added in v0.40.0

type MsgUnjailResponse struct {
}

MsgUnjailResponse defines the Msg/Unjail response type

func (*MsgUnjailResponse) Descriptor added in v0.40.0

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

func (*MsgUnjailResponse) Equal added in v0.40.0

func (this *MsgUnjailResponse) Equal(that interface{}) bool

func (*MsgUnjailResponse) Marshal added in v0.40.0

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

func (*MsgUnjailResponse) MarshalTo added in v0.40.0

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

func (*MsgUnjailResponse) MarshalToSizedBuffer added in v0.40.0

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

func (*MsgUnjailResponse) ProtoMessage added in v0.40.0

func (*MsgUnjailResponse) ProtoMessage()

func (*MsgUnjailResponse) Reset added in v0.40.0

func (m *MsgUnjailResponse) Reset()

func (*MsgUnjailResponse) Size added in v0.40.0

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

func (*MsgUnjailResponse) String added in v0.40.0

func (m *MsgUnjailResponse) String() string

func (*MsgUnjailResponse) Unmarshal added in v0.40.0

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

func (*MsgUnjailResponse) XXX_DiscardUnknown added in v0.40.0

func (m *MsgUnjailResponse) XXX_DiscardUnknown()

func (*MsgUnjailResponse) XXX_Marshal added in v0.40.0

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

func (*MsgUnjailResponse) XXX_Merge added in v0.40.0

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

func (*MsgUnjailResponse) XXX_Size added in v0.40.0

func (m *MsgUnjailResponse) XXX_Size() int

func (*MsgUnjailResponse) XXX_Unmarshal added in v0.40.0

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

type MsgUpdateParams added in v0.47.0

type MsgUpdateParams struct {
	// authority is the address that controls the module (defaults to x/gov unless overwritten).
	Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
	// params defines the x/slashing parameters to update.
	//
	// NOTE: All parameters must be supplied.
	Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"`
}

MsgUpdateParams is the Msg/UpdateParams request type.

Since: cosmos-sdk 0.47

func (*MsgUpdateParams) Descriptor added in v0.47.0

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

func (*MsgUpdateParams) Equal added in v0.47.0

func (this *MsgUpdateParams) Equal(that interface{}) bool

func (*MsgUpdateParams) GetAuthority added in v0.47.0

func (m *MsgUpdateParams) GetAuthority() string

func (*MsgUpdateParams) GetParams added in v0.47.0

func (m *MsgUpdateParams) GetParams() Params

func (*MsgUpdateParams) Marshal added in v0.47.0

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

func (*MsgUpdateParams) MarshalTo added in v0.47.0

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

func (*MsgUpdateParams) MarshalToSizedBuffer added in v0.47.0

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

func (*MsgUpdateParams) ProtoMessage added in v0.47.0

func (*MsgUpdateParams) ProtoMessage()

func (*MsgUpdateParams) Reset added in v0.47.0

func (m *MsgUpdateParams) Reset()

func (*MsgUpdateParams) Size added in v0.47.0

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

func (*MsgUpdateParams) String added in v0.47.0

func (m *MsgUpdateParams) String() string

func (*MsgUpdateParams) Unmarshal added in v0.47.0

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

func (*MsgUpdateParams) XXX_DiscardUnknown added in v0.47.0

func (m *MsgUpdateParams) XXX_DiscardUnknown()

func (*MsgUpdateParams) XXX_Marshal added in v0.47.0

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

func (*MsgUpdateParams) XXX_Merge added in v0.47.0

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

func (*MsgUpdateParams) XXX_Size added in v0.47.0

func (m *MsgUpdateParams) XXX_Size() int

func (*MsgUpdateParams) XXX_Unmarshal added in v0.47.0

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

type MsgUpdateParamsResponse added in v0.47.0

type MsgUpdateParamsResponse struct {
}

MsgUpdateParamsResponse defines the response structure for executing a MsgUpdateParams message.

Since: cosmos-sdk 0.47

func (*MsgUpdateParamsResponse) Descriptor added in v0.47.0

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

func (*MsgUpdateParamsResponse) Equal added in v0.47.0

func (this *MsgUpdateParamsResponse) Equal(that interface{}) bool

func (*MsgUpdateParamsResponse) Marshal added in v0.47.0

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

func (*MsgUpdateParamsResponse) MarshalTo added in v0.47.0

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

func (*MsgUpdateParamsResponse) MarshalToSizedBuffer added in v0.47.0

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

func (*MsgUpdateParamsResponse) ProtoMessage added in v0.47.0

func (*MsgUpdateParamsResponse) ProtoMessage()

func (*MsgUpdateParamsResponse) Reset added in v0.47.0

func (m *MsgUpdateParamsResponse) Reset()

func (*MsgUpdateParamsResponse) Size added in v0.47.0

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

func (*MsgUpdateParamsResponse) String added in v0.47.0

func (m *MsgUpdateParamsResponse) String() string

func (*MsgUpdateParamsResponse) Unmarshal added in v0.47.0

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

func (*MsgUpdateParamsResponse) XXX_DiscardUnknown added in v0.47.0

func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown()

func (*MsgUpdateParamsResponse) XXX_Marshal added in v0.47.0

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

func (*MsgUpdateParamsResponse) XXX_Merge added in v0.47.0

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

func (*MsgUpdateParamsResponse) XXX_Size added in v0.47.0

func (m *MsgUpdateParamsResponse) XXX_Size() int

func (*MsgUpdateParamsResponse) XXX_Unmarshal added in v0.47.0

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

type ParamSubspace

type ParamSubspace interface {
	HasKeyTable() bool
	WithKeyTable(table paramtypes.KeyTable) paramtypes.Subspace
	Get(ctx sdk.Context, key []byte, ptr interface{})
	GetParamSet(ctx sdk.Context, ps paramtypes.ParamSet)
	SetParamSet(ctx sdk.Context, ps paramtypes.ParamSet)
}

ParamSubspace defines the expected Subspace interfacace

type Params

type Params struct {
	SignedBlocksWindow      int64                       `protobuf:"varint,1,opt,name=signed_blocks_window,json=signedBlocksWindow,proto3" json:"signed_blocks_window,omitempty"`
	MinSignedPerWindow      cosmossdk_io_math.LegacyDec `` /* 148-byte string literal not displayed */
	DowntimeJailDuration    time.Duration               `protobuf:"bytes,3,opt,name=downtime_jail_duration,json=downtimeJailDuration,proto3,stdduration" json:"downtime_jail_duration"`
	SlashFractionDoubleSign cosmossdk_io_math.LegacyDec `` /* 163-byte string literal not displayed */
	SlashFractionDowntime   cosmossdk_io_math.LegacyDec `` /* 155-byte string literal not displayed */
}

Params represents the parameters used for by the slashing module.

func DefaultParams

func DefaultParams() Params

DefaultParams defines the parameters for this module

func NewParams

func NewParams(
	signedBlocksWindow int64, minSignedPerWindow math.LegacyDec, downtimeJailDuration time.Duration,
	slashFractionDoubleSign, slashFractionDowntime math.LegacyDec,
) Params

NewParams creates a new Params object

func (*Params) Descriptor added in v0.40.0

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

func (*Params) Equal added in v0.40.0

func (this *Params) Equal(that interface{}) bool

func (*Params) GetDowntimeJailDuration added in v0.40.0

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

func (*Params) GetSignedBlocksWindow added in v0.40.0

func (m *Params) GetSignedBlocksWindow() int64

func (*Params) Marshal added in v0.40.0

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

func (*Params) MarshalTo added in v0.40.0

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

func (*Params) MarshalToSizedBuffer added in v0.40.0

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

func (*Params) ParamSetPairs deprecated

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

Deprecated: ParamSetPairs implements params.ParamSet

func (*Params) ProtoMessage added in v0.40.0

func (*Params) ProtoMessage()

func (*Params) Reset added in v0.40.0

func (m *Params) Reset()

func (*Params) Size added in v0.40.0

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

func (*Params) String

func (m *Params) String() string

func (*Params) Unmarshal added in v0.40.0

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

func (Params) Validate added in v0.47.0

func (p Params) Validate() error

Validate validates the params

func (*Params) XXX_DiscardUnknown added in v0.40.0

func (m *Params) XXX_DiscardUnknown()

func (*Params) XXX_Marshal added in v0.40.0

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

func (*Params) XXX_Merge added in v0.40.0

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

func (*Params) XXX_Size added in v0.40.0

func (m *Params) XXX_Size() int

func (*Params) XXX_Unmarshal added in v0.40.0

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

type QueryClient added in v0.40.0

type QueryClient interface {
	// Params queries the parameters of slashing module
	Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
	// SigningInfo queries the signing info of given cons address
	SigningInfo(ctx context.Context, in *QuerySigningInfoRequest, opts ...grpc.CallOption) (*QuerySigningInfoResponse, error)
	// SigningInfos queries signing info of all validators
	SigningInfos(ctx context.Context, in *QuerySigningInfosRequest, opts ...grpc.CallOption) (*QuerySigningInfosResponse, error)
}

QueryClient is the client API for Query service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewQueryClient added in v0.40.0

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryParamsRequest added in v0.40.0

type QueryParamsRequest struct {
}

QueryParamsRequest is the request type for the Query/Params RPC method

func (*QueryParamsRequest) Descriptor added in v0.40.0

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

func (*QueryParamsRequest) Marshal added in v0.40.0

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

func (*QueryParamsRequest) MarshalTo added in v0.40.0

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

func (*QueryParamsRequest) MarshalToSizedBuffer added in v0.40.0

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

func (*QueryParamsRequest) ProtoMessage added in v0.40.0

func (*QueryParamsRequest) ProtoMessage()

func (*QueryParamsRequest) Reset added in v0.40.0

func (m *QueryParamsRequest) Reset()

func (*QueryParamsRequest) Size added in v0.40.0

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

func (*QueryParamsRequest) String added in v0.40.0

func (m *QueryParamsRequest) String() string

func (*QueryParamsRequest) Unmarshal added in v0.40.0

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

func (*QueryParamsRequest) XXX_DiscardUnknown added in v0.40.0

func (m *QueryParamsRequest) XXX_DiscardUnknown()

func (*QueryParamsRequest) XXX_Marshal added in v0.40.0

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

func (*QueryParamsRequest) XXX_Merge added in v0.40.0

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

func (*QueryParamsRequest) XXX_Size added in v0.40.0

func (m *QueryParamsRequest) XXX_Size() int

func (*QueryParamsRequest) XXX_Unmarshal added in v0.40.0

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

type QueryParamsResponse added in v0.40.0

type QueryParamsResponse struct {
	Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
}

QueryParamsResponse is the response type for the Query/Params RPC method

func (*QueryParamsResponse) Descriptor added in v0.40.0

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

func (*QueryParamsResponse) GetParams added in v0.40.0

func (m *QueryParamsResponse) GetParams() Params

func (*QueryParamsResponse) Marshal added in v0.40.0

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

func (*QueryParamsResponse) MarshalTo added in v0.40.0

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

func (*QueryParamsResponse) MarshalToSizedBuffer added in v0.40.0

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

func (*QueryParamsResponse) ProtoMessage added in v0.40.0

func (*QueryParamsResponse) ProtoMessage()

func (*QueryParamsResponse) Reset added in v0.40.0

func (m *QueryParamsResponse) Reset()

func (*QueryParamsResponse) Size added in v0.40.0

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

func (*QueryParamsResponse) String added in v0.40.0

func (m *QueryParamsResponse) String() string

func (*QueryParamsResponse) Unmarshal added in v0.40.0

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

func (*QueryParamsResponse) XXX_DiscardUnknown added in v0.40.0

func (m *QueryParamsResponse) XXX_DiscardUnknown()

func (*QueryParamsResponse) XXX_Marshal added in v0.40.0

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

func (*QueryParamsResponse) XXX_Merge added in v0.40.0

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

func (*QueryParamsResponse) XXX_Size added in v0.40.0

func (m *QueryParamsResponse) XXX_Size() int

func (*QueryParamsResponse) XXX_Unmarshal added in v0.40.0

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

type QueryServer added in v0.40.0

type QueryServer interface {
	// Params queries the parameters of slashing module
	Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
	// SigningInfo queries the signing info of given cons address
	SigningInfo(context.Context, *QuerySigningInfoRequest) (*QuerySigningInfoResponse, error)
	// SigningInfos queries signing info of all validators
	SigningInfos(context.Context, *QuerySigningInfosRequest) (*QuerySigningInfosResponse, error)
}

QueryServer is the server API for Query service.

type QuerySigningInfoRequest added in v0.40.0

type QuerySigningInfoRequest struct {
	// cons_address is the address to query signing info of
	ConsAddress string `protobuf:"bytes,1,opt,name=cons_address,json=consAddress,proto3" json:"cons_address,omitempty"`
}

QuerySigningInfoRequest is the request type for the Query/SigningInfo RPC method

func (*QuerySigningInfoRequest) Descriptor added in v0.40.0

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

func (*QuerySigningInfoRequest) GetConsAddress added in v0.40.0

func (m *QuerySigningInfoRequest) GetConsAddress() string

func (*QuerySigningInfoRequest) Marshal added in v0.40.0

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

func (*QuerySigningInfoRequest) MarshalTo added in v0.40.0

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

func (*QuerySigningInfoRequest) MarshalToSizedBuffer added in v0.40.0

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

func (*QuerySigningInfoRequest) ProtoMessage added in v0.40.0

func (*QuerySigningInfoRequest) ProtoMessage()

func (*QuerySigningInfoRequest) Reset added in v0.40.0

func (m *QuerySigningInfoRequest) Reset()

func (*QuerySigningInfoRequest) Size added in v0.40.0

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

func (*QuerySigningInfoRequest) String added in v0.40.0

func (m *QuerySigningInfoRequest) String() string

func (*QuerySigningInfoRequest) Unmarshal added in v0.40.0

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

func (*QuerySigningInfoRequest) XXX_DiscardUnknown added in v0.40.0

func (m *QuerySigningInfoRequest) XXX_DiscardUnknown()

func (*QuerySigningInfoRequest) XXX_Marshal added in v0.40.0

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

func (*QuerySigningInfoRequest) XXX_Merge added in v0.40.0

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

func (*QuerySigningInfoRequest) XXX_Size added in v0.40.0

func (m *QuerySigningInfoRequest) XXX_Size() int

func (*QuerySigningInfoRequest) XXX_Unmarshal added in v0.40.0

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

type QuerySigningInfoResponse added in v0.40.0

type QuerySigningInfoResponse struct {
	// val_signing_info is the signing info of requested val cons address
	ValSigningInfo ValidatorSigningInfo `protobuf:"bytes,1,opt,name=val_signing_info,json=valSigningInfo,proto3" json:"val_signing_info"`
}

QuerySigningInfoResponse is the response type for the Query/SigningInfo RPC method

func (*QuerySigningInfoResponse) Descriptor added in v0.40.0

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

func (*QuerySigningInfoResponse) GetValSigningInfo added in v0.40.0

func (m *QuerySigningInfoResponse) GetValSigningInfo() ValidatorSigningInfo

func (*QuerySigningInfoResponse) Marshal added in v0.40.0

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

func (*QuerySigningInfoResponse) MarshalTo added in v0.40.0

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

func (*QuerySigningInfoResponse) MarshalToSizedBuffer added in v0.40.0

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

func (*QuerySigningInfoResponse) ProtoMessage added in v0.40.0

func (*QuerySigningInfoResponse) ProtoMessage()

func (*QuerySigningInfoResponse) Reset added in v0.40.0

func (m *QuerySigningInfoResponse) Reset()

func (*QuerySigningInfoResponse) Size added in v0.40.0

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

func (*QuerySigningInfoResponse) String added in v0.40.0

func (m *QuerySigningInfoResponse) String() string

func (*QuerySigningInfoResponse) Unmarshal added in v0.40.0

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

func (*QuerySigningInfoResponse) XXX_DiscardUnknown added in v0.40.0

func (m *QuerySigningInfoResponse) XXX_DiscardUnknown()

func (*QuerySigningInfoResponse) XXX_Marshal added in v0.40.0

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

func (*QuerySigningInfoResponse) XXX_Merge added in v0.40.0

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

func (*QuerySigningInfoResponse) XXX_Size added in v0.40.0

func (m *QuerySigningInfoResponse) XXX_Size() int

func (*QuerySigningInfoResponse) XXX_Unmarshal added in v0.40.0

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

type QuerySigningInfosParams

type QuerySigningInfosParams struct {
	Page, Limit int
}

QuerySigningInfosParams defines the params for the following queries: - 'custom/slashing/signingInfos'

func NewQuerySigningInfosParams

func NewQuerySigningInfosParams(page, limit int) QuerySigningInfosParams

NewQuerySigningInfosParams creates a new QuerySigningInfosParams instance

type QuerySigningInfosRequest added in v0.40.0

type QuerySigningInfosRequest struct {
	Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QuerySigningInfosRequest is the request type for the Query/SigningInfos RPC method

func (*QuerySigningInfosRequest) Descriptor added in v0.40.0

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

func (*QuerySigningInfosRequest) GetPagination added in v0.40.0

func (m *QuerySigningInfosRequest) GetPagination() *query.PageRequest

func (*QuerySigningInfosRequest) Marshal added in v0.40.0

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

func (*QuerySigningInfosRequest) MarshalTo added in v0.40.0

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

func (*QuerySigningInfosRequest) MarshalToSizedBuffer added in v0.40.0

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

func (*QuerySigningInfosRequest) ProtoMessage added in v0.40.0

func (*QuerySigningInfosRequest) ProtoMessage()

func (*QuerySigningInfosRequest) Reset added in v0.40.0

func (m *QuerySigningInfosRequest) Reset()

func (*QuerySigningInfosRequest) Size added in v0.40.0

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

func (*QuerySigningInfosRequest) String added in v0.40.0

func (m *QuerySigningInfosRequest) String() string

func (*QuerySigningInfosRequest) Unmarshal added in v0.40.0

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

func (*QuerySigningInfosRequest) XXX_DiscardUnknown added in v0.40.0

func (m *QuerySigningInfosRequest) XXX_DiscardUnknown()

func (*QuerySigningInfosRequest) XXX_Marshal added in v0.40.0

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

func (*QuerySigningInfosRequest) XXX_Merge added in v0.40.0

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

func (*QuerySigningInfosRequest) XXX_Size added in v0.40.0

func (m *QuerySigningInfosRequest) XXX_Size() int

func (*QuerySigningInfosRequest) XXX_Unmarshal added in v0.40.0

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

type QuerySigningInfosResponse added in v0.40.0

type QuerySigningInfosResponse struct {
	// info is the signing info of all validators
	Info       []ValidatorSigningInfo `protobuf:"bytes,1,rep,name=info,proto3" json:"info"`
	Pagination *query.PageResponse    `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QuerySigningInfosResponse is the response type for the Query/SigningInfos RPC method

func (*QuerySigningInfosResponse) Descriptor added in v0.40.0

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

func (*QuerySigningInfosResponse) GetInfo added in v0.40.0

func (*QuerySigningInfosResponse) GetPagination added in v0.40.0

func (m *QuerySigningInfosResponse) GetPagination() *query.PageResponse

func (*QuerySigningInfosResponse) Marshal added in v0.40.0

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

func (*QuerySigningInfosResponse) MarshalTo added in v0.40.0

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

func (*QuerySigningInfosResponse) MarshalToSizedBuffer added in v0.40.0

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

func (*QuerySigningInfosResponse) ProtoMessage added in v0.40.0

func (*QuerySigningInfosResponse) ProtoMessage()

func (*QuerySigningInfosResponse) Reset added in v0.40.0

func (m *QuerySigningInfosResponse) Reset()

func (*QuerySigningInfosResponse) Size added in v0.40.0

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

func (*QuerySigningInfosResponse) String added in v0.40.0

func (m *QuerySigningInfosResponse) String() string

func (*QuerySigningInfosResponse) Unmarshal added in v0.40.0

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

func (*QuerySigningInfosResponse) XXX_DiscardUnknown added in v0.40.0

func (m *QuerySigningInfosResponse) XXX_DiscardUnknown()

func (*QuerySigningInfosResponse) XXX_Marshal added in v0.40.0

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

func (*QuerySigningInfosResponse) XXX_Merge added in v0.40.0

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

func (*QuerySigningInfosResponse) XXX_Size added in v0.40.0

func (m *QuerySigningInfosResponse) XXX_Size() int

func (*QuerySigningInfosResponse) XXX_Unmarshal added in v0.40.0

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

type SigningInfo added in v0.40.0

type SigningInfo struct {
	// address is the validator address.
	Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	// validator_signing_info represents the signing info of this validator.
	ValidatorSigningInfo ValidatorSigningInfo `protobuf:"bytes,2,opt,name=validator_signing_info,json=validatorSigningInfo,proto3" json:"validator_signing_info"`
}

SigningInfo stores validator signing info of corresponding address.

func (*SigningInfo) Descriptor added in v0.40.0

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

func (*SigningInfo) GetAddress added in v0.40.0

func (m *SigningInfo) GetAddress() string

func (*SigningInfo) GetValidatorSigningInfo added in v0.40.0

func (m *SigningInfo) GetValidatorSigningInfo() ValidatorSigningInfo

func (*SigningInfo) Marshal added in v0.40.0

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

func (*SigningInfo) MarshalTo added in v0.40.0

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

func (*SigningInfo) MarshalToSizedBuffer added in v0.40.0

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

func (*SigningInfo) ProtoMessage added in v0.40.0

func (*SigningInfo) ProtoMessage()

func (*SigningInfo) Reset added in v0.40.0

func (m *SigningInfo) Reset()

func (*SigningInfo) Size added in v0.40.0

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

func (*SigningInfo) String added in v0.40.0

func (m *SigningInfo) String() string

func (*SigningInfo) Unmarshal added in v0.40.0

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

func (*SigningInfo) XXX_DiscardUnknown added in v0.40.0

func (m *SigningInfo) XXX_DiscardUnknown()

func (*SigningInfo) XXX_Marshal added in v0.40.0

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

func (*SigningInfo) XXX_Merge added in v0.40.0

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

func (*SigningInfo) XXX_Size added in v0.40.0

func (m *SigningInfo) XXX_Size() int

func (*SigningInfo) XXX_Unmarshal added in v0.40.0

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

type StakingHooks

type StakingHooks interface {
	AfterValidatorCreated(ctx context.Context, valAddr sdk.ValAddress) error                           // Must be called when a validator is created
	BeforeValidatorModified(ctx context.Context, valAddr sdk.ValAddress) error                         // Must be called when a validator's state changes
	AfterValidatorRemoved(ctx context.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error // Must be called when a validator is deleted

	AfterValidatorBonded(ctx context.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error         // Must be called when a validator is bonded
	AfterValidatorBeginUnbonding(ctx context.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error // Must be called when a validator begins unbonding

	BeforeDelegationCreated(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error        // Must be called when a delegation is created
	BeforeDelegationSharesModified(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error // Must be called when a delegation's shares are modified
	BeforeDelegationRemoved(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error        // Must be called when a delegation is removed
	AfterDelegationModified(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
	BeforeValidatorSlashed(ctx context.Context, valAddr sdk.ValAddress, fraction math.LegacyDec) error
}

StakingHooks event hooks for staking validator object (noalias)

type StakingKeeper

type StakingKeeper interface {
	ValidatorAddressCodec() address.Codec
	ConsensusAddressCodec() address.Codec
	// iterate through validators by operator address, execute func for each validator
	IterateValidators(context.Context,
		func(index int64, validator stakingtypes.ValidatorI) (stop bool)) error

	Validator(context.Context, sdk.ValAddress) (stakingtypes.ValidatorI, error)            // get a particular validator by operator address
	ValidatorByConsAddr(context.Context, sdk.ConsAddress) (stakingtypes.ValidatorI, error) // get a particular validator by consensus address

	// slash the validator and delegators of the validator, specifying offense height, offense power, and slash fraction
	Slash(context.Context, sdk.ConsAddress, int64, int64, math.LegacyDec) (math.Int, error)
	SlashWithInfractionReason(context.Context, sdk.ConsAddress, int64, int64, math.LegacyDec, stakingtypes.Infraction) (math.Int, error)
	Jail(context.Context, sdk.ConsAddress) error   // jail a validator
	Unjail(context.Context, sdk.ConsAddress) error // unjail a validator

	// Delegation allows for getting a particular delegation for a given validator
	// and delegator outside the scope of the staking module.
	Delegation(context.Context, sdk.AccAddress, sdk.ValAddress) (stakingtypes.DelegationI, error)
	GetAllValidators(ctx context.Context) ([]stakingtypes.Validator, error)

	// MaxValidators returns the maximum amount of bonded validators
	MaxValidators(context.Context) (uint32, error)

	// IsValidatorJailed returns if the validator is jailed.
	IsValidatorJailed(ctx context.Context, addr sdk.ConsAddress) (bool, error)
}

StakingKeeper expected staking keeper

type UnimplementedMsgServer added in v0.40.0

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) Unjail added in v0.40.0

func (*UnimplementedMsgServer) UpdateParams added in v0.47.0

type UnimplementedQueryServer added in v0.40.0

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) Params added in v0.40.0

func (*UnimplementedQueryServer) SigningInfo added in v0.40.0

func (*UnimplementedQueryServer) SigningInfos added in v0.40.0

type ValidatorMissedBlocks added in v0.40.0

type ValidatorMissedBlocks struct {
	// address is the validator address.
	Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	// missed_blocks is an array of missed blocks by the validator.
	MissedBlocks []MissedBlock `protobuf:"bytes,2,rep,name=missed_blocks,json=missedBlocks,proto3" json:"missed_blocks"`
}

ValidatorMissedBlocks contains array of missed blocks of corresponding address.

func (*ValidatorMissedBlocks) Descriptor added in v0.40.0

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

func (*ValidatorMissedBlocks) GetAddress added in v0.40.0

func (m *ValidatorMissedBlocks) GetAddress() string

func (*ValidatorMissedBlocks) GetMissedBlocks added in v0.40.0

func (m *ValidatorMissedBlocks) GetMissedBlocks() []MissedBlock

func (*ValidatorMissedBlocks) Marshal added in v0.40.0

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

func (*ValidatorMissedBlocks) MarshalTo added in v0.40.0

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

func (*ValidatorMissedBlocks) MarshalToSizedBuffer added in v0.40.0

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

func (*ValidatorMissedBlocks) ProtoMessage added in v0.40.0

func (*ValidatorMissedBlocks) ProtoMessage()

func (*ValidatorMissedBlocks) Reset added in v0.40.0

func (m *ValidatorMissedBlocks) Reset()

func (*ValidatorMissedBlocks) Size added in v0.40.0

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

func (*ValidatorMissedBlocks) String added in v0.40.0

func (m *ValidatorMissedBlocks) String() string

func (*ValidatorMissedBlocks) Unmarshal added in v0.40.0

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

func (*ValidatorMissedBlocks) XXX_DiscardUnknown added in v0.40.0

func (m *ValidatorMissedBlocks) XXX_DiscardUnknown()

func (*ValidatorMissedBlocks) XXX_Marshal added in v0.40.0

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

func (*ValidatorMissedBlocks) XXX_Merge added in v0.40.0

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

func (*ValidatorMissedBlocks) XXX_Size added in v0.40.0

func (m *ValidatorMissedBlocks) XXX_Size() int

func (*ValidatorMissedBlocks) XXX_Unmarshal added in v0.40.0

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

type ValidatorSigningInfo

type ValidatorSigningInfo struct {
	Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	// Height at which validator was first a candidate OR was un-jailed
	StartHeight int64 `protobuf:"varint,2,opt,name=start_height,json=startHeight,proto3" json:"start_height,omitempty"`
	// Index which is incremented every time a validator is bonded in a block and
	// _may_ have signed a pre-commit or not. This in conjunction with the
	// signed_blocks_window param determines the index in the missed block bitmap.
	IndexOffset int64 `protobuf:"varint,3,opt,name=index_offset,json=indexOffset,proto3" json:"index_offset,omitempty"`
	// Timestamp until which the validator is jailed due to liveness downtime.
	JailedUntil time.Time `protobuf:"bytes,4,opt,name=jailed_until,json=jailedUntil,proto3,stdtime" json:"jailed_until"`
	// Whether or not a validator has been tombstoned (killed out of validator
	// set). It is set once the validator commits an equivocation or for any other
	// configured misbehavior.
	Tombstoned bool `protobuf:"varint,5,opt,name=tombstoned,proto3" json:"tombstoned,omitempty"`
	// A counter of missed (unsigned) blocks. It is used to avoid unnecessary
	// reads in the missed block bitmap.
	MissedBlocksCounter int64 `protobuf:"varint,6,opt,name=missed_blocks_counter,json=missedBlocksCounter,proto3" json:"missed_blocks_counter,omitempty"`
}

ValidatorSigningInfo defines a validator's signing info for monitoring their liveness activity.

func NewValidatorSigningInfo

func NewValidatorSigningInfo(
	consAddr sdk.ConsAddress, startHeight, indexOffset int64,
	jailedUntil time.Time, tombstoned bool, missedBlocksCounter int64,
) ValidatorSigningInfo

NewValidatorSigningInfo creates a new ValidatorSigningInfo instance

func UnmarshalValSigningInfo

func UnmarshalValSigningInfo(cdc codec.Codec, value []byte) (signingInfo ValidatorSigningInfo, err error)

UnmarshalValSigningInfo unmarshals a validator signing info from a store value

func (*ValidatorSigningInfo) Descriptor

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

func (*ValidatorSigningInfo) Equal

func (this *ValidatorSigningInfo) Equal(that interface{}) bool

func (*ValidatorSigningInfo) GetAddress

func (m *ValidatorSigningInfo) GetAddress() string

func (*ValidatorSigningInfo) GetIndexOffset

func (m *ValidatorSigningInfo) GetIndexOffset() int64

func (*ValidatorSigningInfo) GetJailedUntil

func (m *ValidatorSigningInfo) GetJailedUntil() time.Time

func (*ValidatorSigningInfo) GetMissedBlocksCounter

func (m *ValidatorSigningInfo) GetMissedBlocksCounter() int64

func (*ValidatorSigningInfo) GetStartHeight

func (m *ValidatorSigningInfo) GetStartHeight() int64

func (*ValidatorSigningInfo) GetTombstoned

func (m *ValidatorSigningInfo) GetTombstoned() bool

func (*ValidatorSigningInfo) Marshal

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

func (*ValidatorSigningInfo) MarshalTo

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

func (*ValidatorSigningInfo) MarshalToSizedBuffer

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

func (*ValidatorSigningInfo) ProtoMessage

func (*ValidatorSigningInfo) ProtoMessage()

func (*ValidatorSigningInfo) Reset

func (m *ValidatorSigningInfo) Reset()

func (*ValidatorSigningInfo) Size

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

func (*ValidatorSigningInfo) String

func (m *ValidatorSigningInfo) String() string

func (*ValidatorSigningInfo) Unmarshal

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

func (*ValidatorSigningInfo) XXX_DiscardUnknown

func (m *ValidatorSigningInfo) XXX_DiscardUnknown()

func (*ValidatorSigningInfo) XXX_Marshal

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

func (*ValidatorSigningInfo) XXX_Merge

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

func (*ValidatorSigningInfo) XXX_Size

func (m *ValidatorSigningInfo) XXX_Size() int

func (*ValidatorSigningInfo) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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