vm

package
v1.13.5-lux.2 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2025 License: BSD-3-Clause Imports: 28 Imported by: 0

Documentation

Overview

Copyright (C) 2022, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Index

Constants

View Source
const (
	LowGasLimit    = uint64(12_000_000)
	MediumGasLimit = uint64(15_000_000)
	HighGasLimit   = uint64(20_000_000)

	LowTargetGas    = uint64(1_500_000)
	MediumTargetGas = uint64(2_000_000)
	HighTargetGas   = uint64(5_000_000)

	NoDynamicFeesGasLimitToTargetGasFactor = uint64(10)
)

Gas limits

View Source
const (
	NativeMint        = "Native Minting"
	ContractAllowList = "Contract Deployment Allow List"
	TxAllowList       = "Transaction Allow List"
	FeeManager        = "Manage Fee Settings"
	RewardManager     = "RewardManagerConfig"
)

Variables

View Source
var (
	Difficulty = big.NewInt(0)

	// This is the current c-chain gas config
	StarterFeeConfig = fees.DefaultFeeConfig

	PrefundedEwoqAddress = common.HexToAddress("0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC")
	PrefundedEwoqPrivate = "56289e99c94b6912bfc12adc093c9b51124f0dc54ac7a766b2bc5ccf558d8027"
)
View Source
var ErrNoLuxVersion = errors.New("unable to find a compatible node version")
View Source
var OneLux = big.NewInt(1_000_000_000) // 1 LUX = 1e9 nLUX

Units

Functions

func ConfigureInitialRewardConfig

func ConfigureInitialRewardConfig(app *application.Lux) (*rewardmanager.InitialRewardConfig, error)

func CopyCustomVM

func CopyCustomVM(app *application.Lux, subnetName string, vmPath string) error

func CreateCustomSubnetConfig

func CreateCustomSubnetConfig(app *application.Lux, subnetName string, genesisPath, vmPath string) ([]byte, *models.Sidecar, error)

func CreateEVMGenesis

func CreateEVMGenesis(chainID *big.Int, allocations core.GenesisAlloc, timestamps map[string]uint64) map[string]interface{}

CreateEVMGenesis creates a new EVM genesis configuration

func CreateEvmConfig

func CreateEvmConfig(app *application.Lux, subnetName string, genesisPath string, evmVersion string) ([]byte, *models.Sidecar, error)

func GetLatestLuxByProtocolVersion

func GetLatestLuxByProtocolVersion(app *application.Lux, rpcVersion int, url string) (string, error)

func GetRPCProtocolVersion

func GetRPCProtocolVersion(app *application.Lux, vmType models.VMType, vmVersion string) (int, error)

func GetVMBinaryProtocolVersion

func GetVMBinaryProtocolVersion(vmBinaryPath string) (int, error)

GetVMBinaryProtocolVersion returns the protocol version for the VM binary

func PrecompileToUpgradeString

func PrecompileToUpgradeString(p Precompile) string

Types

type AllowList

type AllowList struct {
	AdminAddresses   []common.Address
	ManagerAddresses []common.Address
	EnabledAddresses []common.Address
}

AllowList represents an allow list configuration

func GenerateAllowList

func GenerateAllowList(
	app *application.Lux,
	config AllowList,
	action string,
	vmVersion string,
) (AllowList, bool, error)

GenerateAllowList prompts the user to configure an allow list

type Precompile

type Precompile string

Jump to

Keyboard shortcuts

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