types

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientID

type ClientID string

ClientID represents the ID of a client.

func NewClientIDFromInt

func NewClientIDFromInt(id int) ClientID

func (ClientID) Bytes

func (cid ClientID) Bytes() []byte

func (ClientID) Pb

func (cid ClientID) Pb() string

Pb converts a ClientID to its underlying native type.

type EpochNr

type EpochNr uint64

EpochNr represents the number of an epoch.

func (EpochNr) Bytes

func (e EpochNr) Bytes() []byte

func (EpochNr) Pb

func (e EpochNr) Pb() uint64

Pb converts an EpochNr number to its underlying native type.

type RetentionIndex

type RetentionIndex uint64

RetentionIndex represents an abstract notion of system progress used in garbage collection. The basic idea is to associate various parts of the system (parts of the state, even whole modules) that are subject to eventual garbage collection with a retention index. As the system progresses, the retention index monotonically increases and parts of the system associated with a lower retention index can be garbage-collected.

func (RetentionIndex) Bytes

func (ri RetentionIndex) Bytes() []byte

Bytes converts a RetentionIndex to a slice of bytes (useful for serialization).

func (RetentionIndex) Pb

func (ri RetentionIndex) Pb() uint64

Pb converts a RetentionIndex to its underlying native type.

type SeqNr

type SeqNr uint64

SeqNr represents the sequence number of a batch as assigned by the ordering protocol.

func (SeqNr) Bytes

func (sn SeqNr) Bytes() []byte

Bytes converts a SeqNr to a slice of bytes (useful for serialization).

func (SeqNr) Pb

func (sn SeqNr) Pb() uint64

Pb converts a SeqNr to its underlying native type.

type TxID

type TxID = string

TxID is a unique identifier of a transaction.

type TxNo

type TxNo uint64

TxNo represents a request number a client assigns to its requests.

func (TxNo) Bytes

func (rn TxNo) Bytes() []byte

Bytes converts a TxNo to a slice of bytes (useful for serialization).

func (TxNo) Pb

func (rn TxNo) Pb() uint64

Pb converts a TxNo to its underlying native type.

type VoteWeight

type VoteWeight string

VoteWeight represents the weight of a node's vote when gathering quorums. The underlying type is a string containing a decimal integer representation of the weight. This is required to support large integers that would not fit in a native data type like uint64. For example, this can occur if Trantor is used as a PoS system with cryptocurrency units as weights. We do not store the weights directly as big.Int, since that would make it harder to use them in protocol buffers. Instead, when performing mathematical operations on weights, we convert them to the big.Int type.

func (VoteWeight) BigInt added in v0.4.3

func (vw VoteWeight) BigInt() *big.Int

BigInt converts a VoteWeight (normally represented as a string) to a big.Int. BigInt panics if the underlying string is not a valid decimal representation of an integer. Thus, BigInt must not be called on received input without having validated VoteWeight by calling the IsValid method.

func (VoteWeight) Bytes

func (vw VoteWeight) Bytes() []byte

func (VoteWeight) IsValid added in v0.4.3

func (vw VoteWeight) IsValid() bool

func (VoteWeight) Pb added in v0.4.3

func (vw VoteWeight) Pb() string

func (VoteWeight) String added in v0.4.3

func (vw VoteWeight) String() string

Jump to

Keyboard shortcuts

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