config

package
v1.10.8 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: BSD-3-Clause Imports: 11 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultExecutionConfig = ExecutionConfig{
	BlockCacheSize:               64 * units.MiB,
	TxCacheSize:                  128 * units.MiB,
	TransformedSubnetTxCacheSize: 4 * units.MiB,
	RewardUTXOsCacheSize:         2048,
	ChainCacheSize:               2048,
	ChainDBCacheSize:             2048,
	BlockIDCacheSize:             8192,
	ChecksumsEnabled:             false,
}

Functions

This section is empty.

Types

type Config

type Config struct {
	// The node's chain manager
	Chains chains.Manager

	// Node's validator set maps subnetID -> validators of the subnet
	//
	// Invariant: The primary network's validator set should have been added to
	//            the manager before calling VM.Initialize.
	// Invariant: The primary network's validator set should be empty before
	//            calling VM.Initialize.
	Validators validators.Manager

	// Provides access to the uptime manager as a thread safe data structure
	UptimeLockedCalculator uptime.LockedCalculator

	// True if the node is being run with staking enabled
	SybilProtectionEnabled bool

	// If true, only the P-chain will be instantiated on the primary network.
	PartialSyncPrimaryNetwork bool

	// Set of subnets that this node is validating
	TrackedSubnets set.Set[ids.ID]

	// Fee that is burned by every non-state creating transaction
	TxFee uint64

	// Fee that must be burned by every state creating transaction before AP3
	CreateAssetTxFee uint64

	// Fee that must be burned by every subnet creating transaction after AP3
	CreateSubnetTxFee uint64

	// Fee that must be burned by every transform subnet transaction
	TransformSubnetTxFee uint64

	// Fee that must be burned by every blockchain creating transaction after AP3
	CreateBlockchainTxFee uint64

	// Transaction fee for adding a primary network validator
	AddPrimaryNetworkValidatorFee uint64

	// Transaction fee for adding a primary network delegator
	AddPrimaryNetworkDelegatorFee uint64

	// Transaction fee for adding a subnet validator
	AddSubnetValidatorFee uint64

	// Transaction fee for adding a subnet delegator
	AddSubnetDelegatorFee uint64

	// The minimum amount of tokens one must bond to be a validator
	MinValidatorStake uint64

	// The maximum amount of tokens that can be bonded on a validator
	MaxValidatorStake uint64

	// Minimum stake, in nAVAX, that can be delegated on the primary network
	MinDelegatorStake uint64

	// Minimum fee that can be charged for delegation
	MinDelegationFee uint32

	// UptimePercentage is the minimum uptime required to be rewarded for staking
	UptimePercentage float64

	// Minimum amount of time to allow a staker to stake
	MinStakeDuration time.Duration

	// Maximum amount of time to allow a staker to stake
	MaxStakeDuration time.Duration

	// Config for the minting function
	RewardConfig reward.Config

	// Time of the AP3 network upgrade
	ApricotPhase3Time time.Time

	// Time of the AP5 network upgrade
	ApricotPhase5Time time.Time

	// Time of the Banff network upgrade
	BanffTime time.Time

	// Time of the Cortina network upgrade
	CortinaTime time.Time

	// UseCurrentHeight forces [GetMinimumHeight] to return the current height
	// of the P-Chain instead of the oldest block in the [recentlyAccepted]
	// window.
	//
	// This config is particularly useful for triggering proposervm activation
	// on recently created subnets (without this, users need to wait for
	// [recentlyAcceptedWindowTTL] to pass for activation to occur).
	UseCurrentHeight bool
}

Struct collecting all foundational parameters of PlatformVM

func (*Config) CreateChain

func (c *Config) CreateChain(chainID ids.ID, tx *txs.CreateChainTx)

Create the blockchain described in [tx], but only if this node is a member of the subnet that validates the chain

func (*Config) GetCreateBlockchainTxFee

func (c *Config) GetCreateBlockchainTxFee(timestamp time.Time) uint64

func (*Config) GetCreateSubnetTxFee

func (c *Config) GetCreateSubnetTxFee(timestamp time.Time) uint64

func (*Config) IsApricotPhase3Activated

func (c *Config) IsApricotPhase3Activated(timestamp time.Time) bool

func (*Config) IsApricotPhase5Activated

func (c *Config) IsApricotPhase5Activated(timestamp time.Time) bool

func (*Config) IsBanffActivated added in v1.9.0

func (c *Config) IsBanffActivated(timestamp time.Time) bool

type ExecutionConfig added in v1.10.6

type ExecutionConfig struct {
	BlockCacheSize               int  `json:"block-cache-size"`
	TxCacheSize                  int  `json:"tx-cache-size"`
	TransformedSubnetTxCacheSize int  `json:"transformed-subnet-tx-cache-size"`
	RewardUTXOsCacheSize         int  `json:"reward-utxos-cache-size"`
	ChainCacheSize               int  `json:"chain-cache-size"`
	ChainDBCacheSize             int  `json:"chain-db-cache-size"`
	BlockIDCacheSize             int  `json:"block-id-cache-size"`
	ChecksumsEnabled             bool `json:"checksums-enabled"`
}

ExecutionConfig provides execution parameters of PlatformVM

func GetExecutionConfig added in v1.10.6

func GetExecutionConfig(b []byte) (*ExecutionConfig, error)

GetExecutionConfig returns an ExecutionConfig input is unmarshalled into an ExecutionConfig previously initialized with default values

Jump to

Keyboard shortcuts

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