github.com/badrootd/celestia-core@v0.0.0-20240305091328-aa4207a4b25d/pkg/consts/consts.go (about)

     1  package consts
     2  
     3  import (
     4  	"crypto/sha256"
     5  )
     6  
     7  const (
     8  	// TxInclusionProofQueryPath is the path used to query the application for a
     9  	// tx inclusion proof via the ABCI Query method. The desired transaction
    10  	// index must be formatted into the path.
    11  	TxInclusionProofQueryPath = "custom/txInclusionProof/%d"
    12  
    13  	// ShareInclusionProofQueryPath is the path used to query the application for the
    14  	// shares to data root inclusion proofs via the ABCI query method.
    15  	ShareInclusionProofQueryPath = "custom/shareInclusionProof/%d/%d"
    16  
    17  	// ProtoBlobTxTypeID is included in each encoded BlobTx to help prevent
    18  	// decoding binaries that are not actually BlobTxs.
    19  	ProtoBlobTxTypeID = "BLOB"
    20  
    21  	// ProtoIndexWrapperTypeID is included in each encoded IndexWrapper to help prevent
    22  	// decoding binaries that are not actually IndexWrappers.
    23  	ProtoIndexWrapperTypeID = "INDX"
    24  
    25  	// NamespaveVersionSize is the size of a namespace version in bytes.
    26  	NamespaceVersionSize = 1
    27  
    28  	// NamespaceIDSize is the size of a namespace ID in bytes.
    29  	NamespaceIDSize = 28
    30  
    31  	// NamespaceSize is the size of a namespace in bytes.
    32  	NamespaceSize = NamespaceIDSize + NamespaceVersionSize
    33  )
    34  
    35  var (
    36  	// TxNamespaceID is the namespace ID reserved for transaction data. It does
    37  	// not contain a leading version byte.
    38  	TxNamespaceID = []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}
    39  
    40  	// NewBaseHashFunc change accordingly if another hash.Hash should be used as a base hasher in the NMT:
    41  	NewBaseHashFunc = sha256.New
    42  
    43  	// DataCommitmentBlocksLimit is the limit to the number of blocks we can generate a data commitment for.
    44  	DataCommitmentBlocksLimit = 1000
    45  )