Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockID ¶
type BlockID struct { Hash cmbytes.HexBytes `json:"hash"` PartSetHeader PartSetHeader `json:"parts"` }
BlockID
type Commit ¶
type Commit struct { // NOTE: The signatures are in order of address to preserve the bonded // ValidatorSet order. // Any peer with a block can gossip signatures by index with a peer without // recalculating the active ValidatorSet. Height int64 `json:"height"` Round int32 `json:"round"` BlockID BlockID `json:"block_id"` Signatures []CommitSig `json:"signatures"` }
Commit contains the evidence that a block was committed by a set of validators. NOTE: Commit is empty for height 1, but never nil.
type CommitSig ¶
type CommitSig struct { BlockIDFlag BlockIDFlag `json:"block_id_flag"` ValidatorAddress Address `json:"validator_address"` Timestamp time.Time `json:"timestamp"` Signature []byte `json:"signature"` }
CommitSig is a part of the Vote included in a Commit.
type CoreBlob ¶
type CoreBlob struct { // NamespaceVersion is the version of the namespace. Used in conjunction // with NamespaceID to determine the namespace of this blob. NamespaceVersion uint8 // NamespaceID defines the namespace ID of this blob. Used in conjunction // with NamespaceVersion to determine the namespace of this blob. NamespaceID []byte // Data is the actual data of the blob. // (e.g. a block of a virtual sidechain). Data []byte // when encoded into shares. ShareVersion uint8 }
type DataAvailabilityHeader ¶
type DataAvailabilityHeader struct { // RowRoot_j = root((M_{j,1} || M_{j,2} || ... || M_{j,2k} )) RowRoots [][]byte `json:"row_roots"` // ColumnRoot_j = root((M_{1,j} || M_{2,j} || ... || M_{2k,j} )) ColumnRoots [][]byte `json:"column_roots"` // contains filtered or unexported fields }
DataAvailabilityHeader (DAHeader) contains the row and column roots of the erasure coded version of the data in Block.Data. The original Block.Data is split into shares and arranged in a square of width squareSize. Then, this square is "extended" into an extended data square (EDS) of width 2*squareSize by applying Reed-Solomon encoding.
func NewDataAvailabilityHeader ¶
func NewDataAvailabilityHeader(eds *rsmt2d.ExtendedDataSquare) (DataAvailabilityHeader, error)
NewDataAvailabilityHeader generates a DataAvailability header using the provided extended data square.
func (*DataAvailabilityHeader) Equals ¶
func (dah *DataAvailabilityHeader) Equals(to *DataAvailabilityHeader) bool
Equals checks equality of two DAHeaders.
func (*DataAvailabilityHeader) Hash ¶
func (dah *DataAvailabilityHeader) Hash() []byte
Hash computes the Merkle root of the row and column roots. Hash memoizes the result in `DataAvailabilityHeader.hash`.
func (*DataAvailabilityHeader) String ¶
func (dah *DataAvailabilityHeader) String() string
String returns hex representation of merkle hash of the DAHeader.
type PartSetHeader ¶
type Validator ¶
type Validator struct { Address Address `json:"address"` PubKey crypto.PubKey `json:"pub_key"` VotingPower int64 `json:"voting_power"` ProposerPriority int64 `json:"proposer_priority"` }
Volatile state for each Validator NOTE: The ProposerPriority is not included in Validator.Hash(); make sure to update that method if changes are made here
type ValidatorSet ¶
type ValidatorSet struct { // NOTE: persisted via reflect, must be exported. Validators []*Validator `json:"validators"` Proposer *Validator `json:"proposer"` }
ValidatorSet represent a set of *Validator at a given height.
The validators can be fetched by address or index. The index is in order of .VotingPower, so the indices are fixed for all rounds of a given blockchain height - ie. the validators are sorted by their voting power (descending). Secondary index - .Address (ascending).
On the other hand, the .ProposerPriority of each validator and the designated .GetProposer() of a set changes every round, upon calling .IncrementProposerPriority().
NOTE: Not goroutine-safe. NOTE: All get/set to validators should copy the value for safety.