Documentation
¶
Index ¶
- Constants
- Variables
- func GetData(s Share) []byte
- type DataHash
- type Namespace
- func (n Namespace) Equals(target Namespace) bool
- func (n Namespace) ID() namespace.ID
- func (n Namespace) IsAboveMax(nodeHash []byte) bool
- func (n Namespace) IsBelowMin(nodeHash []byte) bool
- func (n Namespace) IsGreater(target Namespace) bool
- func (n Namespace) IsGreaterOrEqualThan(target Namespace) bool
- func (n Namespace) IsLess(target Namespace) bool
- func (n Namespace) IsLessOrEqual(target Namespace) bool
- func (n Namespace) IsOutsideRange(leftNodeHash, rightNodeHash []byte) bool
- func (n Namespace) Len() int
- func (n Namespace) Repeat(t int) []Namespace
- func (n Namespace) String() string
- func (n Namespace) ToAppNamespace() appns.Namespace
- func (n Namespace) ToNMT() namespace.ID
- func (n Namespace) Validate() error
- func (n Namespace) ValidateForBlob() error
- func (n Namespace) ValidateForData() error
- func (n Namespace) Version() byte
- type NamespacedRow
- type NamespacedShares
- type Root
- type Share
Constants ¶
const ( // Size is a system-wide size of a share, including both data and namespace GetNamespace Size = appconsts.ShareSize )
Variables ¶
var ( MaxReservedNamespace = Namespace(appns.MaxReservedNamespace.Bytes()) TailPaddingNamespace = Namespace(appns.TailPaddingNamespace.Bytes()) ReservedPaddingNamespace = Namespace(appns.ReservedPaddingNamespace.Bytes()) TxNamespace = Namespace(appns.TxNamespace.Bytes()) PayForBlobNamespace = Namespace(appns.PayForBlobNamespace.Bytes()) )
Various reserved namespaces.
var ( // DefaultRSMT2DCodec sets the default rsmt2d.Codec for shares. DefaultRSMT2DCodec = appconsts.DefaultCodec )
var ( // ErrNotAvailable is returned whenever DA sampling fails. ErrNotAvailable = errors.New("share: data not available") )
Functions ¶
Types ¶
type Namespace ¶
type Namespace []byte
Namespace represents namespace of a Share. Consists of version byte and namespace ID.
func GetNamespace ¶
GetNamespace slices Namespace out of the Share.
func NamespaceFromBytes ¶
NamespaceFromBytes converts bytes into Namespace and validates it.
func NewBlobNamespaceV0 ¶
NewBlobNamespaceV0 takes a variable size byte slice and creates a valid version 0 Blob Namespace. The byte slice must be <= 10 bytes. If it is less than 10 bytes, it will be left padded to size 10 with 0s. Use predefined namespaces above, if non-blob namespace is needed.
func (Namespace) IsAboveMax ¶
IsAboveMax checks if the namespace is above the maximum namespace of the given hash.
func (Namespace) IsBelowMin ¶
IsBelowMin checks if the target namespace is below the minimum namespace of the given hash.
func (Namespace) IsGreaterOrEqualThan ¶
IsGreaterOrEqualThan reports if the Namespace is greater or equal than the target.
func (Namespace) IsLessOrEqual ¶
IsLessOrEqual reports if the Namespace is less than the target.
func (Namespace) IsOutsideRange ¶
IsOutsideRange checks if the namespace is outside the min-max range of the given hashes.
func (Namespace) ToAppNamespace ¶
ToAppNamespace converts the Namespace to App's definition of Namespace. TODO: Unify types between node and app
func (Namespace) ToNMT ¶
ToNMT converts the whole Namespace(both Version and ID parts) into NMT's namespace.ID NOTE: Once https://github.com/celestiaorg/nmt/issues/206 is closed Namespace should become NNT's type.
func (Namespace) ValidateForBlob ¶
ValidateForBlob checks if the Namespace is valid blob namespace.
func (Namespace) ValidateForData ¶
ValidateForData checks if the Namespace is of real/useful data.
type NamespacedRow ¶
NamespacedRow represents all shares with proofs within a specific namespace of a single EDS row.
type NamespacedShares ¶
type NamespacedShares []NamespacedRow
NamespacedShares represents all shares with proofs within a specific namespace of an EDS.
type Root ¶
type Root = core.DataAvailabilityHeader
Root represents root commitment to multiple Shares. In practice, it is a commitment to all the Data in a square.