Documentation ¶
Index ¶
Constants ¶
View Source
const ( // NamespaceVersionSize is the size of a namespace version in bytes. NamespaceVersionSize = 1 // NamespaceVersionMaxValue is the maximum value a namespace version can be. // This const must be updated if NamespaceVersionSize is changed. NamespaceVersionMaxValue = math.MaxUint8 // NamespaceIDSize is the size of a namespace ID in bytes. NamespaceIDSize = 28 // NamespaceSize is the size of a namespace (version + ID) in bytes. NamespaceSize = NamespaceVersionSize + NamespaceIDSize ShareSize = 512 // byte contains the share version and a sequence start idicator. ShareInfoBytes = 1 // SequenceLenBytes is the number of bytes reserved for the sequence length // that is present in the first share of a sequence. SequenceLenBytes = 4 ShareVersionZero = uint8(0) // unsure of which version to use. DefaultShareVersion = ShareVersionZero // the first unit (transaction, ISR) in a compact share. CompactShareReservedBytes = 4 // the first compact share of a sequence. FirstCompactShareContentSize = ShareSize - NamespaceSize - ShareInfoBytes - SequenceLenBytes - CompactShareReservedBytes // data in a continuation compact share of a sequence. ContinuationCompactShareContentSize = ShareSize - NamespaceSize - ShareInfoBytes - CompactShareReservedBytes // first sparse share of a sequence. FirstSparseShareContentSize = ShareSize - NamespaceSize - ShareInfoBytes - SequenceLenBytes // in a continuation sparse share of a sequence. ContinuationSparseShareContentSize = ShareSize - NamespaceSize - ShareInfoBytes // MinSquareSize is the smallest original square width. MinSquareSize = 1 // data square. MinShareCount = MinSquareSize * MinSquareSize MaxShareVersion = 127 // Celestia matrix size DefaultGovMaxSquareSize = 64 // Default maximum bytes per blob allowed DefaultMaxBytes = DefaultGovMaxSquareSize * DefaultGovMaxSquareSize * ContinuationSparseShareContentSize )
These constants were originally sourced from: https://github.com/celestiaorg/celestia-specs/blob/master/src/specs/consensus.md#constants
They can not change throughout the lifetime of a network.
Variables ¶
This section is empty.
Functions ¶
func SparseSharesNeeded ¶
SparseSharesNeeded returns the number of shares needed to store a sequence of length sequenceLen.
Types ¶
type CelestiaRPCClient ¶
type CelestiaRPCClient interface { SubmitPayForBlob( ctx context.Context, fee state.Int, gasLim uint64, blobs []*blob.Blob, ) (*state.TxResponse, error) GetAll(context.Context, uint64, []share.Namespace) ([]*blob.Blob, error) Submit(ctx context.Context, blobs []*blob.Blob, options *openrpc.SubmitOptions) (uint64, error) GetProof(ctx context.Context, height uint64, namespace share.Namespace, commitment blob.Commitment) (*blob.Proof, error) Get(ctx context.Context, height uint64, namespace share.Namespace, commitment blob.Commitment) (*blob.Blob, error) GetHeaders(ctx context.Context, height uint64) (*header.ExtendedHeader, error) Included(ctx context.Context, height uint64, namespace share.Namespace, proof *blob.Proof, commitment blob.Commitment) (bool, error) }
Click to show internal directories.
Click to hide internal directories.