exported

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthTypes        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTypes          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
)
View Source
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",
}
View Source
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

This section is empty.

Types

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 Slasher

type Slasher interface {
	GetValidatorSigningInfo(ctx sdk.Context, address sdk.ConsAddress) (info slashingtypes.ValidatorSigningInfo, found bool)
	SignedBlocksWindow(ctx sdk.Context) (res int64)
	GetValidatorMissedBlockBitArray(ctx sdk.Context, address sdk.ConsAddress, index int64) bool
}

Slasher provides functionality to manage slashing info for a validator

type Snapshot

type Snapshot struct {
	Validators                 []Validator                            `protobuf:"bytes,1,rep,name=validators,proto3" json:"validators"`
	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"`
	TotalShareCount            github_com_cosmos_cosmos_sdk_types.Int `` /* 148-byte string literal not displayed */
	Counter                    int64                                  `protobuf:"varint,5,opt,name=counter,proto3" json:"counter,omitempty"`
	KeyShareDistributionPolicy exported.KeyShareDistributionPolicy    `` /* 204-byte string literal not displayed */
	CorruptionThreshold        int64                                  `protobuf:"varint,7,opt,name=corruption_threshold,json=corruptionThreshold,proto3" json:"corruption_threshold,omitempty"`
}

func NewSnapshot added in v0.9.0

func NewSnapshot(
	validators []Validator,
	timestamp time.Time,
	height int64,
	totalShareCount sdk.Int,
	counter int64,
	keyShareDistributionPolicy tss.KeyShareDistributionPolicy,
	corruptionThreshold int64,
) Snapshot

NewSnapshot is the constructor of Snapshot

func (*Snapshot) Descriptor

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

func (Snapshot) GetSuccinctJSON

func (m Snapshot) GetSuccinctJSON() ([]byte, error)

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

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

func (*Snapshot) MarshalTo

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

func (*Snapshot) MarshalToSizedBuffer

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

func (*Snapshot) ProtoMessage

func (*Snapshot) ProtoMessage()

func (*Snapshot) Reset

func (m *Snapshot) Reset()

func (*Snapshot) Size

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

func (*Snapshot) String

func (m *Snapshot) String() string

func (*Snapshot) Unmarshal

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

func (Snapshot) UnpackInterfaces

func (m Snapshot) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error

UnpackInterfaces implements UnpackInterfacesMessage

func (Snapshot) Validate added in v0.9.0

func (m Snapshot) Validate() error

Validate returns an error if the snapshot is not valid; nil otherwise

func (*Snapshot) XXX_DiscardUnknown

func (m *Snapshot) XXX_DiscardUnknown()

func (*Snapshot) XXX_Marshal

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

func (*Snapshot) XXX_Merge

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

func (*Snapshot) XXX_Size

func (m *Snapshot) XXX_Size() int

func (*Snapshot) XXX_Unmarshal

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

type Snapshotter

type Snapshotter interface {
	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 Tss

type Tss interface {
	GetSuspendedUntil(ctx sdk.Context, validator sdk.ValAddress) int64
	GetNextKey(ctx sdk.Context, chain nexus.Chain, keyRole tss.KeyRole) (tss.Key, bool)
	IsOperatorAvailable(ctx sdk.Context, validator sdk.ValAddress, keyIDs ...tss.KeyID) bool
	GetKeyRequirement(ctx sdk.Context, keyRole tss.KeyRole, keyType tss.KeyType) (tss.KeyRequirement, bool)
	HasMissedTooManyBlocks(ctx sdk.Context, address sdk.ConsAddress) (bool, error)
}

Tss provides functionality to tss module

type Validator

type Validator struct {
	SDKValidator *types.Any `protobuf:"bytes,1,opt,name=sdk_validator,json=sdkValidator,proto3" json:"sdk_validator,omitempty"`
	ShareCount   int64      `protobuf:"varint,2,opt,name=share_count,json=shareCount,proto3" json:"share_count,omitempty"`
}

func NewValidator

func NewValidator(validator SDKValidator, shareCount int64) Validator

NewValidator is the constructor for Validator

func (*Validator) Descriptor

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

func (Validator) GetSDKValidator

func (m Validator) GetSDKValidator() SDKValidator

GetSDKValidator returns the SdkValidator

func (*Validator) Marshal

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

func (*Validator) MarshalTo

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

func (*Validator) MarshalToSizedBuffer

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

func (*Validator) ProtoMessage

func (*Validator) ProtoMessage()

func (*Validator) Reset

func (m *Validator) Reset()

func (*Validator) Size

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

func (*Validator) String

func (m *Validator) String() string

func (*Validator) Unmarshal

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

func (Validator) UnpackInterfaces

func (m Validator) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error

UnpackInterfaces implements UnpackInterfacesMessage

func (Validator) Validate added in v0.9.0

func (m Validator) Validate() error

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 (m *Validator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Validator) XXX_Merge

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

func (*Validator) XXX_Size

func (m *Validator) XXX_Size() int

func (*Validator) XXX_Unmarshal

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

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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