Documentation ¶
Index ¶
Constants ¶
const ( TimeoutPropose = time.Second * 10 TimeoutCommit = time.Second * 11 // GoalBlockTime is the target time interval between blocks. Since the block // interval isn't enforced at consensus, the real block interval isn't // guaranteed to exactly match GoalBlockTime. GoalBlockTime is currently targeted // through static timeouts (i.e. TimeoutPropose, TimeoutCommit). GoalBlockTime = time.Second * 15 )
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 // BondDenom defines the native staking denomination BondDenom = "utia" )
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.
const ( // DefaultGovMaxSquareSize is the default value for the governance modifiable // max square size. DefaultGovMaxSquareSize = 64 // DefaultMaxBytes is the default value for the governance modifiable // maximum number of bytes allowed in a valid block. DefaultMaxBytes = DefaultGovMaxSquareSize * DefaultGovMaxSquareSize * ContinuationSparseShareContentSize // DefaultGasPerBlobByte is the default gas cost deducted per byte of blob // included in a PayForBlobs txn DefaultGasPerBlobByte = 8 // DefaultMinGasPrice is the default min gas price that gets set in the app.toml file. // The min gas price acts as a filter. Transactions below that limit will not pass // a nodes `CheckTx` and thus not be proposed by that node. DefaultMinGasPrice = 0.1 // DefaultUnbondingTime is the default time a validator must wait // to unbond in a proof of stake system. Any validator within this // time can be subject to slashing under conditions of misbehavior. DefaultUnbondingTime = 3 * 7 * 24 * time.Hour )
The following defaults correspond to initial parameters of the network that can be changed, not via app versions but other means such as on-chain governance, or the nodes local config
const (
LatestVersion = v1.Version
)
Variables ¶
var ( // DataCommitmentBlocksLimit is the maximnum number of blocks that a data commitment can span DataCommitmentBlocksLimit = consts.DataCommitmentBlocksLimit // NewBaseHashFunc is the base hash function used by NMT. 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. DefaultCodec = rsmt2d.NewLeoRSCodec SupportedShareVersions = []uint8{ShareVersionZero} )
var ( DefaultSubtreeRootThreshold = SubtreeRootThreshold(LatestVersion) DefaultSquareSizeUpperBound = SquareSizeUpperBound(LatestVersion) )
Functions ¶
func HashLength ¶ added in v1.0.0
func HashLength() int
HashLength returns the length of a hash in bytes.
func SquareSizeUpperBound ¶ added in v1.0.0
SquareSizeUpperBound is the maximum original square width possible for a version of the state machine. The maximum is decided through governance. See `DefaultGovMaxSquareSize`.
func SubtreeRootThreshold ¶ added in v1.0.0
SubtreeRootThreshold works as a target upper bound for the number of subtree roots in the share commitment. If a blob contains more shares than this number, then the height of the subtree roots will increase by one so that the number of subtree roots in the share commitment decreases by a factor of two. This step is repeated until the number of subtree roots is less than the SubtreeRootThreshold.
The rationale for this value is described in more detail in ADR-013.
Types ¶
This section is empty.