Documentation ¶
Index ¶
Constants ¶
View Source
const ( // NamespaceSize is the namespace size in bytes. NamespaceSize = 8 // byte contains the share version and a start idicator. ShareInfoBytes = 1 ShareVersion = uint8(0) // the first unit (transaction, ISR, evidence) in a compact share. CompactShareReservedBytes = 1 // (i.e. transactions, ISRs, evidence) share. CompactShareContentSize = ShareSize - NamespaceSize - ShareInfoBytes - CompactShareReservedBytes // message) share. SparseShareContentSize = ShareSize - NamespaceSize - ShareInfoBytes // MaxSquareSize is the maximum number of // rows/columns of the original data shares in square layout. // Corresponds to AVAILABLE_DATA_ORIGINAL_SQUARE_MAX in the spec. // 128*128*256 = 4 Megabytes // TODO(ismail): settle on a proper max square // if the square size is larger than this, the block producer will panic MaxSquareSize = 128 // if there are more shares than this, the block producer will panic. MaxShareCount = MaxSquareSize * MaxSquareSize // MinSquareSize depicts the smallest original square width. A square size smaller than this will // cause block producer to panic MinSquareSize = 1 MinShareCount = MinSquareSize * MinSquareSize MaxShareVersion = 127 )ShareSize = 256
These constants were originally sourced from: https://github.com/celestiaorg/celestia-specs/blob/master/src/specs/consensus.md#constants
Variables ¶
View Source
var ( // TxNamespaceID is the namespace reserved for transaction data TxNamespaceID = consts.TxNamespaceID // EvidenceNamespaceID is the namespace reserved for evidence EvidenceNamespaceID = namespace.ID{0, 0, 0, 0, 0, 0, 0, 3} // MaxReservedNamespace is the lexicographically largest namespace that is // reserved for protocol use. It is derived from NAMESPACE_ID_MAX_RESERVED // https://github.com/celestiaorg/celestia-specs/blob/master/src/specs/consensus.md#constants MaxReservedNamespace = namespace.ID{0, 0, 0, 0, 0, 0, 0, 255} // TailPaddingNamespaceID is the namespace ID for tail padding. All data // with this namespace will be ignored TailPaddingNamespaceID = namespace.ID{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE} ParitySharesNamespaceID = namespace.ID{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF} // NewBaseHashFunc change accordingly if another hash.Hash should be used as a base hasher in the NMT: NewBaseHashFunc = consts.NewBaseHashFunc // DefaultCodec is the default codec creator used for data erasure // TODO(ismail): for better efficiency and a larger number shares // we should switch to the rsmt2d.LeopardFF16 codec: DefaultCodec = rsmt2d.NewRSGF8Codec // DataCommitmentBlocksLimit is the limit to the number of blocks we can generate a data commitment for. DataCommitmentBlocksLimit = consts.DataCommitmentBlocksLimit // of a NameSpacedPaddedShare. A NameSpacedPaddedShare follows a message so // that the next message starts at an index that conforms to non-interactive // defaults. NameSpacedPaddedShareBytes = bytes.Repeat([]byte{0}, SparseShareContentSize) )
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.