appconsts

package
v3.0.1-arabica Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 8 Imported by: 9

Documentation

Index

Constants

View Source
const (
	// DefaultShareVersion is the defacto share version. Use this if you are
	// unsure of which version to use.
	DefaultShareVersion = share.ShareVersionZero

	// MinSquareSize is the smallest original square width.
	MinSquareSize = 1

	// MinShareCount is the minimum number of shares allowed in the original
	// 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.

View Source
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

View Source
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`.

View Source
const (
	ArabicaChainID = "arabica-11"
)
View Source
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
)
View Source
const (
	LatestVersion = v3.Version
)

Variables

View Source
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 is a list of supported share versions.
	SupportedShareVersions = share.SupportedShareVersions
)
View Source
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.

View Source
var (
	DefaultSubtreeRootThreshold = SubtreeRootThreshold(LatestVersion)
	DefaultSquareSizeUpperBound = SquareSizeUpperBound(LatestVersion)
	DefaultTxSizeCostPerByte    = TxSizeCostPerByte(LatestVersion)
	DefaultGasPerBlobByte       = GasPerBlobByte(LatestVersion)
)

Functions

func GasPerBlobByte

func GasPerBlobByte(_ uint64) uint32

func GetTimeoutCommit

func GetTimeoutCommit(v uint64) time.Duration

func GetTimeoutPropose

func GetTimeoutPropose(v uint64) time.Duration

func HashLength

func HashLength() int

HashLength returns the length of a hash in bytes.

func MaxTxSize

func MaxTxSize(_ uint64) int

func SquareSizeUpperBound

func SquareSizeUpperBound(_ uint64) int

SquareSizeUpperBound imposes an upper bound on the max effective square size.

func SubtreeRootThreshold

func SubtreeRootThreshold(_ uint64) int

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 TxSizeCostPerByte(_ uint64) uint64

func UpgradeHeightDelay

func UpgradeHeightDelay(chainID string, v uint64) int64

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL