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 )
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 ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.