Lux Skills Reference
Lux Upgrade - Network Upgrade Configuration
Documentation for Lux Upgrade - Network Upgrade Configuration
Overview
Lux Upgrade is a standalone Go package that defines all network upgrade schedules (fork activation times) for Lux mainnet, testnet, and default/local networks. It is imported by luxd and other node packages to determine which protocol rules are active at any given timestamp.
Quick Reference
| Item | Value |
|---|---|
| Repo | github.com/luxfi/upgrade |
| Module | github.com/luxfi/upgrade |
| Default branch | main |
| Language | Go 1.26.1 |
| Dependencies | github.com/luxfi/ids, github.com/luxfi/crypto |
| Test framework | testify |
Architecture
upgrade/
├── upgrade.go # Config struct, Mainnet/Testnet/Default configs, activation checks
├── upgrade_test.go # Validates all default configs, tests invalid ordering
└── upgradetest/
├── fork.go # Fork enum (NoUpgrades..Granite), String() method
├── config.go # Test helpers: GetConfig, GetConfigWithUpgradeTime, SetTimesTo
└── upgradetest.go # TestConfig, GetConfigForVersion helpersFork History
All named network upgrades in chronological order:
| Fork | Mainnet Activation | Testnet Activation |
|---|---|---|
| ApricotPhase1 | 2021-03-31 | 2021-03-26 |
| ApricotPhase2 | 2021-05-10 | 2021-05-05 |
| ApricotPhase3 | 2021-08-24 | 2021-08-16 |
| ApricotPhase4 | 2021-09-22 | 2021-09-16 |
| ApricotPhase5 | 2021-12-02 | 2021-11-24 |
| ApricotPhasePre6 | 2022-09-05 | 2022-09-06 |
| ApricotPhase6 | 2022-09-06 | 2022-09-06 |
| ApricotPhasePost6 | 2022-09-07 | 2022-09-07 |
| Banff | 2022-10-18 | 2022-10-03 |
| Cortina | 2023-04-25 | 2023-04-06 |
| Durango | 2025-03-06 | 2025-02-13 |
| Etna | 2025-04-08 | 2025-03-13 |
| Fortuna | 2025-12-16 | 2025-11-25 |
| Granite | Unscheduled | Unscheduled |
Network IDs
MainnetID uint32 = 1
TestnetID uint32 = 5Config Struct
type Config struct {
ApricotPhase1Time time.Time
ApricotPhase2Time time.Time
ApricotPhase3Time time.Time
ApricotPhase4Time time.Time
ApricotPhase4MinPChainHeight uint64
ApricotPhase5Time time.Time
ApricotPhasePre6Time time.Time
ApricotPhase6Time time.Time
ApricotPhasePost6Time time.Time
BanffTime time.Time
CortinaTime time.Time
CortinaXChainStopVertexID ids.ID
DurangoTime time.Time
EtnaTime time.Time
FortunaTime time.Time
GraniteTime time.Time
GraniteEpochDuration time.Duration
}Usage
// Get config by network ID
cfg := upgrade.GetConfig(upgrade.MainnetID)
// Check if a fork is active at a given time
if cfg.IsFortunaActivated(time.Now()) {
// Fortuna rules apply
}
// Validate upgrade ordering
if err := cfg.Validate(); err != nil {
// ErrInvalidUpgradeTimes: upgrades are not in chronological order
}Test Helpers (upgradetest package)
// Get config with all forks up to Etna activated, rest unscheduled
cfg := upgradetest.GetConfig(upgradetest.Etna)
// Get config with custom activation time
cfg := upgradetest.GetConfigWithUpgradeTime(upgradetest.Durango, time.Now().Add(time.Hour))
// Set fork times on existing config
upgradetest.SetTimesTo(&cfg, upgradetest.Banff, upgrade.InitiallyActiveTime)
// Fork enum
upgradetest.Latest // == Granite
upgradetest.Fortuna.String() // "Fortuna"Commands
go build ./...
go test -v ./...Related Skills
lux/lux-node.md-- Imports this package for fork schedulinglux/lux-consensus.md-- Consensus rules change at fork boundarieslux/lux-evm.md-- EVM rules activated per fork