Documentation ¶
Index ¶
- Variables
- func QuadraticWeightFunc(consensusPower sdk.Uint) sdk.Uint
- type Participant
- func (*Participant) Descriptor() ([]byte, []int)
- func (m Participant) GetAddress() sdk.ValAddress
- func (m *Participant) Marshal() (dAtA []byte, err error)
- func (m *Participant) MarshalTo(dAtA []byte) (int, error)
- func (m *Participant) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Participant) ProtoMessage()
- func (m *Participant) Reset()
- func (m *Participant) Size() (n int)
- func (m *Participant) String() string
- func (m *Participant) Unmarshal(dAtA []byte) error
- func (m Participant) ValidateBasic() error
- func (m *Participant) XXX_DiscardUnknown()
- func (m *Participant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Participant) XXX_Merge(src proto.Message)
- func (m *Participant) XXX_Size() int
- func (m *Participant) XXX_Unmarshal(b []byte) error
- type SDKValidator
- type Snapshot
- func (m Snapshot) CalculateMinPassingWeight(threshold utils.Threshold) sdk.Uint
- func (*Snapshot) Descriptor() ([]byte, []int)
- func (m Snapshot) GetParticipantAddresses() []sdk.ValAddress
- func (m Snapshot) GetParticipantWeight(participant sdk.ValAddress) sdk.Uint
- func (m Snapshot) GetParticipantsWeight() sdk.Uint
- func (m Snapshot) GetSuccinctJSON() ([]byte, error)
- func (m Snapshot) GetValidator(address sdk.ValAddress) (Validator, bool)
- func (m *Snapshot) Marshal() (dAtA []byte, err error)
- func (m *Snapshot) MarshalTo(dAtA []byte) (int, error)
- func (m *Snapshot) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Snapshot) ProtoMessage()
- func (m *Snapshot) Reset()
- func (m *Snapshot) Size() (n int)
- func (m *Snapshot) String() string
- func (m *Snapshot) Unmarshal(dAtA []byte) error
- func (m Snapshot) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error
- func (m Snapshot) Validate() error
- func (m Snapshot) ValidateBasic() error
- func (m *Snapshot) XXX_DiscardUnknown()
- func (m *Snapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Snapshot) XXX_Merge(src proto.Message)
- func (m *Snapshot) XXX_Size() int
- func (m *Snapshot) XXX_Unmarshal(b []byte) error
- type Snapshotter
- type Validator
- func (*Validator) Descriptor() ([]byte, []int)
- func (m Validator) GetSDKValidator() SDKValidator
- func (m *Validator) Marshal() (dAtA []byte, err error)
- func (m *Validator) MarshalTo(dAtA []byte) (int, error)
- func (m *Validator) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Validator) ProtoMessage()
- func (m *Validator) Reset()
- func (m *Validator) Size() (n int)
- func (m *Validator) String() string
- func (m *Validator) Unmarshal(dAtA []byte) error
- func (m Validator) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error
- func (m Validator) Validate() error
- func (m *Validator) XXX_DiscardUnknown()
- func (m *Validator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Validator) XXX_Merge(src proto.Message)
- func (m *Validator) XXX_Size() int
- func (m *Validator) XXX_Unmarshal(b []byte) error
- type ValidatorI
- type ValidatorIllegibility
- func (ValidatorIllegibility) EnumDescriptor() ([]byte, []int)
- func (v ValidatorIllegibility) FilterIllegibilityForMultisigSigning() ValidatorIllegibility
- func (v ValidatorIllegibility) FilterIllegibilityForNewKey() ValidatorIllegibility
- func (v ValidatorIllegibility) FilterIllegibilityForTssSigning() ValidatorIllegibility
- func (v ValidatorIllegibility) Is(illegibility ValidatorIllegibility) bool
- func (v ValidatorIllegibility) String() string
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") )
var ValidatorIllegibility_name = map[int32]string{
0: "VALIDATOR_ILLEGIBILITY_UNSPECIFIED",
1: "VALIDATOR_ILLEGIBILITY_TOMBSTONED",
2: "VALIDATOR_ILLEGIBILITY_JAILED",
4: "VALIDATOR_ILLEGIBILITY_MISSED_TOO_MANY_BLOCKS",
8: "VALIDATOR_ILLEGIBILITY_NO_PROXY_REGISTERED",
16: "VALIDATOR_ILLEGIBILITY_TSS_SUSPENDED",
32: "VALIDATOR_ILLEGIBILITY_PROXY_INSUFICIENT_FUNDS",
}
var ValidatorIllegibility_value = map[string]int32{
"VALIDATOR_ILLEGIBILITY_UNSPECIFIED": 0,
"VALIDATOR_ILLEGIBILITY_TOMBSTONED": 1,
"VALIDATOR_ILLEGIBILITY_JAILED": 2,
"VALIDATOR_ILLEGIBILITY_MISSED_TOO_MANY_BLOCKS": 4,
"VALIDATOR_ILLEGIBILITY_NO_PROXY_REGISTERED": 8,
"VALIDATOR_ILLEGIBILITY_TSS_SUSPENDED": 16,
"VALIDATOR_ILLEGIBILITY_PROXY_INSUFICIENT_FUNDS": 32,
}
Functions ¶
Types ¶
type Participant ¶ added in v0.21.0
type Participant struct { Address github_com_cosmos_cosmos_sdk_types.ValAddress `protobuf:"bytes,1,opt,name=address,proto3,casttype=github.com/cosmos/cosmos-sdk/types.ValAddress" json:"address,omitempty"` Weight github_com_cosmos_cosmos_sdk_types.Uint `protobuf:"bytes,2,opt,name=weight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Uint" json:"weight"` }
func NewParticipant ¶ added in v0.21.0
func NewParticipant(address sdk.ValAddress, weight sdk.Uint) Participant
NewParticipant is the constructor of Participant
func (*Participant) Descriptor ¶ added in v0.21.0
func (*Participant) Descriptor() ([]byte, []int)
func (Participant) GetAddress ¶ added in v0.21.0
func (m Participant) GetAddress() sdk.ValAddress
GetAddress returns the address of the participant
func (*Participant) Marshal ¶ added in v0.21.0
func (m *Participant) Marshal() (dAtA []byte, err error)
func (*Participant) MarshalTo ¶ added in v0.21.0
func (m *Participant) MarshalTo(dAtA []byte) (int, error)
func (*Participant) MarshalToSizedBuffer ¶ added in v0.21.0
func (m *Participant) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*Participant) ProtoMessage ¶ added in v0.21.0
func (*Participant) ProtoMessage()
func (*Participant) Reset ¶ added in v0.21.0
func (m *Participant) Reset()
func (*Participant) Size ¶ added in v0.21.0
func (m *Participant) Size() (n int)
func (*Participant) String ¶ added in v0.21.0
func (m *Participant) String() string
func (*Participant) Unmarshal ¶ added in v0.21.0
func (m *Participant) Unmarshal(dAtA []byte) error
func (Participant) ValidateBasic ¶ added in v0.21.0
func (m Participant) ValidateBasic() error
ValidateBasic returns an error if the given participant is invalid; nil otherwise
func (*Participant) XXX_DiscardUnknown ¶ added in v0.21.0
func (m *Participant) XXX_DiscardUnknown()
func (*Participant) XXX_Marshal ¶ added in v0.21.0
func (m *Participant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Participant) XXX_Merge ¶ added in v0.21.0
func (m *Participant) XXX_Merge(src proto.Message)
func (*Participant) XXX_Size ¶ added in v0.21.0
func (m *Participant) XXX_Size() int
func (*Participant) XXX_Unmarshal ¶ added in v0.21.0
func (m *Participant) XXX_Unmarshal(b []byte) error
type SDKValidator ¶
type SDKValidator interface { proto.Message codectypes.UnpackInterfacesMessage GetOperator() sdk.ValAddress GetConsAddr() (sdk.ConsAddress, error) GetConsensusPower(sdk.Int) int64 IsJailed() bool IsBonded() bool }
SDKValidator is an interface for a Cosmos validator account
type Snapshot ¶
type Snapshot struct { Validators []Validator `protobuf:"bytes,1,rep,name=validators,proto3" json:"validators"` // Deprecated: Do not use. /* 148-byte string literal not displayed */ Counter int64 `protobuf:"varint,5,opt,name=counter,proto3" json:"counter,omitempty"` // Deprecated: Do not use. /* 204-byte string literal not displayed */ CorruptionThreshold int64 `protobuf:"varint,7,opt,name=corruption_threshold,json=corruptionThreshold,proto3" json:"corruption_threshold,omitempty"` // Deprecated: Do not use. Timestamp time.Time `protobuf:"bytes,2,opt,name=timestamp,proto3,stdtime" json:"timestamp"` Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` Participants map[string]Participant `` /* 155-byte string literal not displayed */ BondedWeight github_com_cosmos_cosmos_sdk_types.Uint `` /* 138-byte string literal not displayed */ }
func NewSnapshot ¶ added in v0.9.0
func NewSnapshot(timestamp time.Time, height int64, participants []Participant, bondedWeight sdk.Uint) Snapshot
NewSnapshot is the constructor of Snapshot
func (Snapshot) CalculateMinPassingWeight ¶ added in v0.21.0
CalculateMinPassingWeight returns the minimum amount of weights to pass the given threshold
func (*Snapshot) Descriptor ¶
func (Snapshot) GetParticipantAddresses ¶ added in v0.21.0
func (m Snapshot) GetParticipantAddresses() []sdk.ValAddress
GetParticipantAddresses returns the addresses of all participants in the snapshot
func (Snapshot) GetParticipantWeight ¶ added in v0.21.0
func (m Snapshot) GetParticipantWeight(participant sdk.ValAddress) sdk.Uint
GetParticipantWeight returns the weight of the given participant
func (Snapshot) GetParticipantsWeight ¶ added in v0.21.0
GetParticipantsWeight returns the sum of all participants' weights
func (Snapshot) GetSuccinctJSON ¶
GetSuccinctJSON marshals the snapshot as JSON without including the SDKValidator data
func (Snapshot) GetValidator ¶
func (m Snapshot) GetValidator(address sdk.ValAddress) (Validator, bool)
GetValidator returns the validator for a given address, if it is part of the snapshot
func (*Snapshot) MarshalToSizedBuffer ¶
func (*Snapshot) ProtoMessage ¶
func (*Snapshot) ProtoMessage()
func (Snapshot) UnpackInterfaces ¶
func (m Snapshot) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error
UnpackInterfaces implements UnpackInterfacesMessage
func (Snapshot) Validate ¶ added in v0.9.0
Validate returns an error if the snapshot is not valid; nil otherwise Deprecated
func (Snapshot) ValidateBasic ¶ added in v0.21.0
ValidateBasic returns an error if the given snapshot is invalid; nil otherwise
func (*Snapshot) XXX_DiscardUnknown ¶
func (m *Snapshot) XXX_DiscardUnknown()
func (*Snapshot) XXX_Marshal ¶
func (*Snapshot) XXX_Unmarshal ¶
type Snapshotter ¶
type Snapshotter interface { CreateSnapshot(ctx sdk.Context, candidates []sdk.ValAddress, filterFunc func(ValidatorI) bool, weightFunc func(consensusPower sdk.Uint) sdk.Uint, threshold utils.Threshold) (Snapshot, error) GetLatestSnapshot(ctx sdk.Context) (Snapshot, bool) GetSnapshot(ctx sdk.Context, seqNo int64) (Snapshot, bool) TakeSnapshot(ctx sdk.Context, keyRequirement tss.KeyRequirement) (Snapshot, error) GetOperator(ctx sdk.Context, proxy sdk.AccAddress) sdk.ValAddress GetProxy(ctx sdk.Context, principal sdk.ValAddress) (addr sdk.AccAddress, active bool) GetValidatorIllegibility(ctx sdk.Context, validator SDKValidator) (ValidatorIllegibility, error) }
Snapshotter represents the interface for the snapshot module's functionality
type Validator ¶
type Validator struct { SDKValidator *types.Any `protobuf:"bytes,1,opt,name=sdk_validator,json=sdkValidator,proto3" json:"sdk_validator,omitempty"` }
func NewValidator ¶
func NewValidator(validator SDKValidator, shareCount int64) Validator
NewValidator is the constructor for Validator
func (*Validator) Descriptor ¶
func (Validator) GetSDKValidator ¶
func (m Validator) GetSDKValidator() SDKValidator
GetSDKValidator returns the SdkValidator
func (*Validator) MarshalToSizedBuffer ¶
func (*Validator) ProtoMessage ¶
func (*Validator) ProtoMessage()
func (Validator) UnpackInterfaces ¶
func (m Validator) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error
UnpackInterfaces implements UnpackInterfacesMessage
func (Validator) Validate ¶ added in v0.9.0
Validate returns an error if the validator is not valid; nil otherwise
func (*Validator) XXX_DiscardUnknown ¶
func (m *Validator) XXX_DiscardUnknown()
func (*Validator) XXX_Marshal ¶
func (*Validator) XXX_Unmarshal ¶
type ValidatorI ¶ added in v0.21.0
type ValidatorI interface { GetConsensusPower(sdk.Int) int64 // validation power in tendermint GetOperator() sdk.ValAddress // operator address to receive/return validators coins GetConsAddr() (sdk.ConsAddress, error) // validation consensus address IsJailed() bool // whether the validator is jailed IsBonded() bool // whether the validator is bonded }
ValidatorI provides necessary functions to the validator information
type ValidatorIllegibility ¶
type ValidatorIllegibility int32
const ( // these enum values are used for bitwise operations, therefore they need to // be powers of 2 None ValidatorIllegibility = 0 Tombstoned ValidatorIllegibility = 1 Jailed ValidatorIllegibility = 2 MissedTooManyBlocks ValidatorIllegibility = 4 NoProxyRegistered ValidatorIllegibility = 8 TssSuspended ValidatorIllegibility = 16 ProxyInsuficientFunds ValidatorIllegibility = 32 )
func GetValidatorIllegibilities ¶
func GetValidatorIllegibilities() []ValidatorIllegibility
GetValidatorIllegibilities returns all validator illegibilities
func (ValidatorIllegibility) EnumDescriptor ¶
func (ValidatorIllegibility) EnumDescriptor() ([]byte, []int)
func (ValidatorIllegibility) FilterIllegibilityForMultisigSigning ¶ added in v0.14.0
func (v ValidatorIllegibility) FilterIllegibilityForMultisigSigning() ValidatorIllegibility
FilterIllegibilityForMultisigSigning filters the illegibility to only leave those ones related to handling of signing - filter out MissedTooManyBlocks so that even potentially offline validators can submit signature(s) - filter out ProxyInsuficientFunds so that validators with proxy account having low balance can submit signature(s)
func (ValidatorIllegibility) FilterIllegibilityForNewKey ¶
func (v ValidatorIllegibility) FilterIllegibilityForNewKey() ValidatorIllegibility
FilterIllegibilityForNewKey filters the illegibility to only leave those ones related to handling of new key
func (ValidatorIllegibility) FilterIllegibilityForTssSigning ¶ added in v0.14.0
func (v ValidatorIllegibility) FilterIllegibilityForTssSigning() ValidatorIllegibility
FilterIllegibilityForTssSigning filters the illegibility to only leave those ones related to handling of signing
func (ValidatorIllegibility) Is ¶
func (v ValidatorIllegibility) Is(illegibility ValidatorIllegibility) bool
Is returns true if the illegibility contains the given one; false otherwise
func (ValidatorIllegibility) String ¶
func (v ValidatorIllegibility) String() string
String returns a comma-separated string representation of illegibility