da

package
v0.8.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtendShares

func ExtendShares(squareSize uint64, shares [][]byte) (*rsmt2d.ExtendedDataSquare, error)

func GenerateEmptyShares

func GenerateEmptyShares(size int) [][]byte

GenerateEmptyShares generate an array of empty shares

Types

type DataAvailabilityHeader

type DataAvailabilityHeader struct {
	// RowRoot_j 	= root((M_{j,1} || M_{j,2} || ... || M_{j,2k} ))
	RowsRoots [][]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. Therefor the original Block.Data is arranged in a k × k matrix, which is then "extended" to a 2k × 2k matrix applying multiple times Reed-Solomon encoding. For details see Section 5.2: https://arxiv.org/abs/1809.09044 or the Celestia specification: https://github.com/celestiaorg/celestia-specs/blob/master/src/specs/data_structures.md#availabledataheader

func DataAvailabilityHeaderFromProto

func DataAvailabilityHeaderFromProto(dahp *daproto.DataAvailabilityHeader) (dah *DataAvailabilityHeader, err error)

func MinDataAvailabilityHeader

func MinDataAvailabilityHeader() DataAvailabilityHeader

MinDataAvailabilityHeader returns the minimum valid data availability header. It is equal to the data availability header for an empty block

func NewDataAvailabilityHeader

func NewDataAvailabilityHeader(eds *rsmt2d.ExtendedDataSquare) DataAvailabilityHeader

NewDataAvailabilityHeader generates a DataAvailability header using the provided square size and shares

func (*DataAvailabilityHeader) Equals

Equals checks equality of two DAHeaders.

func (*DataAvailabilityHeader) Hash

func (dah *DataAvailabilityHeader) Hash() []byte

Hash computes and caches the merkle root of the row and column roots.

func (*DataAvailabilityHeader) IsZero

func (dah *DataAvailabilityHeader) IsZero() bool

func (*DataAvailabilityHeader) String

func (dah *DataAvailabilityHeader) String() string

String returns hex representation of merkle hash of the DAHeader.

func (*DataAvailabilityHeader) ToProto

func (*DataAvailabilityHeader) ValidateBasic

func (dah *DataAvailabilityHeader) ValidateBasic() error

ValidateBasic runs stateless checks on the DataAvailabilityHeader.

Jump to

Keyboard shortcuts

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