config

package
v1.8.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTxCacheMaxTxBytes = 65536
	// DefaultMempoolGossipTTL re-gossips a resident tx at most ~once per window;
	// far above CometBFT's 500ms ReapInterval so steady state suppresses re-reap.
	DefaultMempoolGossipTTL = 15 * time.Second
	// DefaultMempoolTxsPerBlock is one block's tx budget (~2900 = cronos mainnet
	// empirical block size). Governs both the gossip-reap cap (one tick ≈ one
	// block interval) and the recheck-batch cap (one commit ≈ one block of senders).
	DefaultMempoolTxsPerBlock = 2900
	// DefaultTxCacheSize is the tx encode/decode cache capacity when tx-cache-size
	// is unset (0): two full blocks so the cache survives one proposal + one gossip
	// reap cycle without eviction pressure.
	DefaultTxCacheSize = 2 * DefaultMempoolTxsPerBlock
	// DefaultMempoolTTLNumBlocks evicts mempool.type=app txs older than this many
	// blocks by arrival height, draining proposal-skipped txs that never commit.
	DefaultMempoolTTLNumBlocks = 120
)

Defaults live here (not app/) because app/ imports this package and both DefaultCronosConfig() and app's New() need them.

View Source
const (
	NodeTypeDefault   = ""
	NodeTypeValidator = "validator"
	NodeTypeRPC       = "rpc"
	NodeTypeArchive   = "archive"
)
View Source
const (
	// Bech32Prefix defines the Bech32 prefix used for Cronos Accounts
	Bech32Prefix = "crc"

	// Bech32PrefixAccAddr defines the Bech32 prefix of an account's address
	Bech32PrefixAccAddr = Bech32Prefix
	// Bech32PrefixAccPub defines the Bech32 prefix of an account's public key
	Bech32PrefixAccPub = Bech32Prefix + sdk.PrefixPublic
	// Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address
	Bech32PrefixValAddr = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator
	// Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key
	Bech32PrefixValPub = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator + sdk.PrefixPublic
	// Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address
	Bech32PrefixConsAddr = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus
	// Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key
	Bech32PrefixConsPub = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus + sdk.PrefixPublic
)
View Source
const DefaultCronosConfigTemplate = `` /* 2056-byte string literal not displayed */

DefaultCronosConfigTemplate defines the configuration template for cronos configuration

View Source
const DefaultRocksDBConfigTemplate = `` /* 836-byte string literal not displayed */

DefaultRocksDBConfigTemplate defines the configuration template for rocksdb configuration

Variables

This section is empty.

Functions

func SetBech32Prefixes

func SetBech32Prefixes(config *sdk.Config)

SetBech32Prefixes sets the global prefixes to be used when serializing addresses and public keys to Bech32 strings.

Types

type CronosConfig added in v1.7.0

type CronosConfig struct {
	// Set to true to disable tx replacement.
	DisableTxReplacement bool `mapstructure:"disable-tx-replacement"`
	// Set to true to disable optimistic execution.
	DisableOptimisticExecution bool `mapstructure:"disable-optimistic-execution"`
	// Capacity of the sharded LRU tx encode/decode cache.
	// 0 = derive from MempoolTxsPerBlock at startup (2×, or -1 when unlimited). -1 = disable.
	TxCacheSize int `mapstructure:"tx-cache-size"`
	// Per-entry raw payload byte cap. Txs larger than this are decoded but
	// not cached, bounding heap impact. Should not exceed mempool.max_tx_bytes.
	TxCacheMaxTxBytes int `mapstructure:"tx-cache-max-tx-bytes"`
	// MempoolGossipTTL is the re-gossip suppression window for mempool.type=app:
	// a tx reaped for gossip is not re-broadcast until this elapses. Bounds the
	// AppReactor's per-tick re-broadcast of the whole pool. <=0 uses the default.
	MempoolGossipTTL time.Duration `mapstructure:"mempool-gossip-ttl"`
	// MempoolTxsPerBlock is the shared budget used as both the gossip-reap cap
	// (txs per 500ms tick ≈ one block) and the recheck-batch cap (candidates per
	// Commit cycle ≈ one block of senders). <=0 uses the default.
	MempoolTxsPerBlock int `mapstructure:"mempool-txs-per-block"`
	// MempoolTTLNumBlocks evicts mempool.type=app txs older than this many blocks
	// (by arrival height), draining proposal-skipped txs whose sender never commits.
	// 0 disables.
	MempoolTTLNumBlocks int `mapstructure:"mempool-ttl-num-blocks"`
}

func DefaultCronosConfig added in v1.7.0

func DefaultCronosConfig() CronosConfig

type RocksDBConfig

type RocksDBConfig struct {
	// Defines the tuning profile for RocksDB based on the node's primary workload.
	// Valid values: "", "validator", "rpc", "archive"
	NodeType string `mapstructure:"node_type"`
}

func DefaultRocksDBConfig

func DefaultRocksDBConfig() RocksDBConfig

func (*RocksDBConfig) Validate

func (c *RocksDBConfig) Validate() error

Jump to

Keyboard shortcuts

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