Documentation ¶
Index ¶
- Constants
- Variables
- func GasPerBlobByte(_ uint64) uint32
- func GetTimeoutCommit(v uint64) time.Duration
- func GetTimeoutPropose(v uint64) time.Duration
- func HashLength() int
- func MaxTxSize(_ uint64) int
- func SquareSizeUpperBound(_ uint64) int
- func SubtreeRootThreshold(_ uint64) int
- func TxSizeCostPerByte(_ uint64) uint64
- func UpgradeHeightDelay(chainID string, v uint64) int64
Constants ¶
const ( // unsure of which version to use. DefaultShareVersion = share.ShareVersionZero // MinSquareSize is the smallest original square width. MinSquareSize = 1 // data square. MinShareCount = MinSquareSize * MinSquareSize // 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 cannot 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 * share.ContinuationSparseShareContentSize // 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.002 // utia // 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 // DefaultNetworkMinGasPrice is used by x/minfee to prevent transactions from being // included in a block if they specify a gas price lower than this. // Only applies to app version >= 2 DefaultNetworkMinGasPrice = 0.000001 // utia )
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 ( // MaxPFBMessages is the maximum number of SDK messages, aside from PFBs, that a block can contain. MaxPFBMessages = 200 // MaxNonPFBMessages is the maximum number of PFB messages a block can contain. MaxNonPFBMessages = 600 )
The following consts are not consensus breaking and will be applied straight after this binary is started. These numbers softly constrain the processing time of blocks to 0.25sec. The benchmarks used to find these limits can be found in `app/benchmarks`.
const (
ArabicaChainID = "arabica-11"
)
const ( // 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 (
LatestVersion = v3.Version
)
Variables ¶
var ( // DataCommitmentBlocksLimit is the maximum 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 = share.SupportedShareVersions )
var ( OverrideSquareSizeUpperBoundStr string OverrideUpgradeHeightDelayStr string )
Set of values that can be overridden at compile time to modify the behavior of the app. WARNING: This should only be modified for testing purposes. All nodes in a network must have the same values for these constants. Look at the Makefile to see how these are set.
var ( DefaultSubtreeRootThreshold = SubtreeRootThreshold(LatestVersion) DefaultSquareSizeUpperBound = SquareSizeUpperBound(LatestVersion) DefaultTxSizeCostPerByte = TxSizeCostPerByte(LatestVersion) DefaultGasPerBlobByte = GasPerBlobByte(LatestVersion) )
var DefaultUpperBoundMaxBytes = DefaultSquareSizeUpperBound * DefaultSquareSizeUpperBound * share.ContinuationSparseShareContentSize
Functions ¶
func GasPerBlobByte ¶
func GetTimeoutCommit ¶
func GetTimeoutPropose ¶
func SquareSizeUpperBound ¶
SquareSizeUpperBound imposes an upper bound on the max effective square size.
func SubtreeRootThreshold ¶
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.
func TxSizeCostPerByte ¶
func UpgradeHeightDelay ¶
UpgradeHeightDelay returns the delay in blocks after a quorum has been reached that the chain should upgrade to the new version.
Types ¶
This section is empty.