Documentation
¶
Index ¶
Constants ¶
const ( NamespaceVersionIndex = 0 NamespaceVersionSize = 1 NamespaceIDSize = 28 NamespaceSize = NamespaceVersionSize + NamespaceIDSize NamespaceVersionZero = uint8(0) NamespaceVersionMax = uint8(255) NamespaceVersionZeroPrefixSize = 18 NamespaceVersionZeroDataSize = 10 )
Variables ¶
var ( ErrBlobNotFound = errors.New("blob: not found") ErrBlobSizeOverLimit = errors.New("blob: over size limit") ErrTxTimedOut = errors.New("timed out waiting for tx to be included in a block") ErrTxAlreadyInMempool = errors.New("tx already in mempool") ErrTxIncorrectAccountSequence = errors.New("incorrect account sequence") ErrContextDeadline = errors.New("context deadline") ErrHeightFromFuture = errors.New("given height is from the future") ErrContextCanceled = errors.New("context canceled") )
Functions ¶
Types ¶
type BaseResult ¶
type BaseResult struct {
// Code is to determine if the action succeeded.
Code StatusCode
// Message may contain DA layer specific information (like DA block height/hash, detailed error message, etc)
Message string
// Height is the height of the block on Data Availability Layer for given result.
Height uint64
// SubmittedCount is the number of successfully submitted blocks.
SubmittedCount uint64
// BlobSize is the size of the blob submitted.
BlobSize uint64
// IDs is the list of IDs of the blobs submitted.
IDs [][]byte
// Timestamp is the timestamp of the posted data on Data Availability Layer.
Timestamp time.Time
}
BaseResult contains basic information returned by DA layer.
type Commitment ¶
type Commitment = []byte
Commitment should contain serialized cryptographic commitment to Blob value.
type GetIDsResult ¶
GetIDsResult holds the result of GetIDs call: IDs and timestamp of corresponding block.
type ID ¶
type ID = []byte
ID should contain serialized data required by the implementation to find blob in DA.
type Namespace ¶
type Namespace struct {
Version uint8
ID [NamespaceIDSize]byte
}
Namespace mirrors Celestia namespace layout (version + 28-byte ID).
func NamespaceFromBytes ¶
NamespaceFromBytes parses a namespace from its byte representation.
func NamespaceFromString ¶
NamespaceFromString deterministically builds a version-0 namespace from a string.
func NewNamespaceV0 ¶
NewNamespaceV0 builds a version-0 namespace from up to 10 bytes of data.
func ParseHexNamespace ¶
ParseHexNamespace parses a hex string (with or without 0x) into a namespace.
func (Namespace) IsValidForVersion0 ¶
IsValidForVersion0 validates version-0 namespace rules (first 18 bytes zero).
type Proof ¶
type Proof = []byte
Proof should contain serialized proof of inclusion (publication) of Blob in DA.
type ResultRetrieve ¶
type ResultRetrieve struct {
BaseResult
// Data is the block data retrieved from Data Availability Layer.
// If Code is not equal to StatusSuccess, it has to be nil.
Data [][]byte
}
ResultRetrieve contains batch of block data returned from DA layer client.
type ResultSubmit ¶
type ResultSubmit struct {
BaseResult
}
ResultSubmit contains information returned from DA layer after block headers/data submission.
type StatusCode ¶
type StatusCode uint64
StatusCode mirrors the blob RPC status codes shared with block/internal/da.
const ( StatusUnknown StatusCode = iota StatusSuccess StatusNotFound StatusNotIncludedInBlock StatusAlreadyInMempool StatusTooBig StatusContextDeadline StatusError StatusIncorrectAccountSequence StatusContextCanceled StatusHeightFromFuture )
Data Availability return codes.