types

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EventTypeKey is a reserved composite key for event name.
	EventTypeKey = "dvs.event"
	// DVSHashKey is a reserved key, used to specify DVS request's hash.
	// see EventBus#PublishEventTx
	DVSHashKey = "dvs.hash"

	// DVSHeightKey is a reserved key, used to specify DVS request block's height.
	DVSHeightKey = "dvs.height"
	DVSChainID   = "dvs.chainid"
)
View Source
const (
	EventTx  = "Tx"
	EventDVS = "Dvs"
)

Reserved event types (alphabetically sorted).

View Source
const DvsRequestKeySize = sha256.Size

DvsRequestKeySize is the size of the DVS request key index

Variables

View Source
var ErroringMockPVErr = errors.New("erroringMockPV always returns an error")
View Source
var (
	// MaxSignatureSize is a maximum allowed signature size for the Proposal
	// and Vote.
	// XXX: secp256k1 does not have Size nor MaxSize defined.
	MaxSignatureSize = cmtmath.MaxInt(ed25519.SignatureSize, 64)
)
View Source
var (
	PeerStateKey = "ConsensusReactor.peerState"
)

UNSTABLE

Functions

This section is empty.

Types

type DvsRequest

type DvsRequest []byte

func (DvsRequest) Hash

func (dvs DvsRequest) Hash() []byte

Hash computes the TMHASH hash of the wire encoded DVS request.

func (DvsRequest) Key

func (dvs DvsRequest) Key() DvsRequestKey

func (DvsRequest) String

func (dvs DvsRequest) String() string

String returns the hex-encoded DVS request as a string.

type DvsRequestKey

type DvsRequestKey [DvsRequestKeySize]byte

TxKey is the fixed length array key used as an index.

type ErrInvalidCommitHeight

type ErrInvalidCommitHeight struct {
	Expected int64
	Actual   int64
}

ErrInvalidCommitHeight is returned when we encounter a commit with an unexpected height.

func NewErrInvalidCommitHeight

func NewErrInvalidCommitHeight(expected, actual int64) ErrInvalidCommitHeight

func (ErrInvalidCommitHeight) Error

func (e ErrInvalidCommitHeight) Error() string

type ErrInvalidCommitSignatures

type ErrInvalidCommitSignatures struct {
	Expected int
	Actual   int
}

ErrInvalidCommitSignatures is returned when we encounter a commit where the number of signatures doesn't match the number of validators.

func NewErrInvalidCommitSignatures

func NewErrInvalidCommitSignatures(expected, actual int) ErrInvalidCommitSignatures

func (ErrInvalidCommitSignatures) Error

type ErroringMockPV

type ErroringMockPV struct {
	MockPV
}

func NewErroringMockPV

func NewErroringMockPV() *ErroringMockPV

type MockPV

type MockPV struct {
	PrivKey crypto.PrivKey
	// contains filtered or unexported fields
}

MockPV implements PrivValidator without any safety or persistence. Only use it for testing.

func NewMockPV

func NewMockPV() MockPV

func NewMockPVWithParams

func NewMockPVWithParams(privKey crypto.PrivKey, breakProposalSigning, breakVoteSigning bool) MockPV

NewMockPVWithParams allows one to create a MockPV instance, but with finer grained control over the operation of the mock validator. This is useful for mocking test failures.

func (MockPV) GetPubKey

func (pv MockPV) GetPubKey() (crypto.PubKey, error)

Implements PrivValidator.

type OperatorID

type OperatorID [32]byte

func GenOperatorIDByAddress

func GenOperatorIDByAddress(operatorAddress common.Address) OperatorID

GenOperatorIDByAddress by eth address

func GenOperatorIDOffChain

func GenOperatorIDOffChain(pubkey *bls.G1Point) OperatorID

GenOperatorIDOffChain by bls pubkey

func (*OperatorID) LogValue

func (o *OperatorID) LogValue() slog.Value

type PrivValidator

type PrivValidator interface {
	GetPubKey() (*bls.G1Point, error)
	SignBytes(bytes []byte) (*bls.Signature, error)
}

PrivValidator defines the functionality of a local PellDVS validator that signs votes and proposals, and never double signs.

type Signable

type Signable interface {
	SignBytes(chainID string) []byte
}

Signable is an interface for all signable things. It typically removes signatures before serializing. SignBytes returns the bytes to be signed NOTE: chainIDs are part of the SignBytes but not necessarily the object themselves. NOTE: Expected to panic if there is an error marshaling.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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