modules

package
v1.99.32 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2026 License: GPL-3.0, LGPL-3.0, LGPL-3.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllGenesisPrecompiles added in v0.8.33

func AllGenesisPrecompiles() map[string]interface{}

AllGenesisPrecompiles returns a map of all registered precompile configs configured for genesis activation (timestamp = 0). This is used to populate the genesisPrecompiles field in ChainConfig for deterministic genesis hash.

func RegisterBridgedModule added in v0.8.38

func RegisterBridgedModule(stm Module) error

RegisterBridgedModule registers a module bridged from the external precompile registry. It skips the reserved address range check because external precompiles use their own address scheme (LP-aligned, burn addresses, etc.).

func RegisterModule

func RegisterModule(stm Module) error

RegisterModule registers a stateful precompile module

func ReservedAddress

func ReservedAddress(addr common.Address) bool

ReservedAddress returns true if [addr] is in a reserved range for custom precompiles

Types

type Module

type Module struct {
	// ConfigKey is the key used in json config files to specify this precompile config.
	ConfigKey string
	// Address returns the address where the stateful precompile is accessible.
	Address common.Address
	// Contract returns a thread-safe singleton that can be used as the StatefulPrecompiledContract when
	// this config is enabled.
	Contract contract.StatefulPrecompiledContract
	// Configurator is used to configure the stateful precompile when the config is enabled.
	contract.Configurator
	// AlwaysOn marks a precompile that is ACTIVE on every chain from genesis with NO
	// config entry (neither a genesis-inlined precompile nor a precompileUpgrades
	// timestamp). It is the one-way activation for system precompiles that take no
	// per-network parameters and resolve everything from the runtime (consensus
	// context / atomic state). The DEX settlement precompile (0x9999) is the canonical
	// case. An always-on module's Configurator is never invoked (no activating config);
	// the host gives it the EXTCODESIZE marker at genesis and dispatches Run on every
	// block. Bridged from github.com/luxfi/precompile/modules.Module.AlwaysOn.
	AlwaysOn bool
}

func AlwaysOnModules added in v1.99.32

func AlwaysOnModules() []Module

AlwaysOnModules returns the registered modules marked AlwaysOn — precompiles active on every chain from genesis with NO config entry. The host activates these unconditionally (EXTCODESIZE marker at genesis + Run dispatch on every block), independent of genesisPrecompiles / precompileUpgrades. Deterministic address order.

func GetPrecompileModule

func GetPrecompileModule(key string) (Module, bool)

func GetPrecompileModuleByAddress

func GetPrecompileModuleByAddress(address common.Address) (Module, bool)

func RegisteredModules

func RegisteredModules() []Module

Jump to

Keyboard shortcuts

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