models

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2025 License: BSD-3-Clause Imports: 6 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.

Copyright (C) 2024, 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.

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 (
	SubnetEvm   = "Subnet-EVM"
	BlobVM      = "Blob VM"
	TimestampVM = "Timestamp VM"
	CustomVM    = "Custom"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseMigration

type BaseMigration struct {
	FromBase        string `json:"fromBase"`
	ToBase          string `json:"toBase"`
	ProposalID      string `json:"proposalId"`
	ExecutedAt      int64  `json:"executedAt"`
	HotSwap         bool   `json:"hotSwap"`
	CheckpointBlock uint64 `json:"checkpointBlock"`
}

BaseMigration represents a base chain migration

type BridgeRoute

type BridgeRoute struct {
	From          string `json:"from"`
	To            string `json:"to"`
	Via           string `json:"via"`           // bridge provider
	EstimatedTime int    `json:"estimatedTime"` // seconds
	EstimatedCost string `json:"estimatedCost"` // in native token
}

BridgeRoute represents a cross-chain route

type Config added in v1.7.9

type Config struct {
	MetricsEnabled bool
}

type ElasticSubnet

type ElasticSubnet struct {
	SubnetID    ids.ID
	AssetID     ids.ID
	PChainTXID  ids.ID
	TokenName   string
	TokenSymbol string
	Validators  map[string]PermissionlessValidators
	Txs         map[string]ids.ID
}

type ElasticSubnetConfig

type ElasticSubnetConfig struct {
	SubnetID                 ids.ID
	AssetID                  ids.ID
	InitialSupply            uint64
	MaxSupply                uint64
	MinConsumptionRate       uint64
	MaxConsumptionRate       uint64
	MinValidatorStake        uint64
	MaxValidatorStake        uint64
	MinStakeDuration         time.Duration
	MaxStakeDuration         time.Duration
	MinDelegationFee         uint32
	MinDelegatorStake        uint64
	MaxValidatorWeightFactor byte
	UptimeRequirement        uint32
}

type Exportable

type Exportable struct {
	Sidecar Sidecar
	Genesis []byte
}

type GovernanceProposal

type GovernanceProposal struct {
	ID          string `json:"id"`
	Type        string `json:"type"` // base-migration, upgrade, parameter
	Title       string `json:"title"`
	Description string `json:"description"`
	L2Name      string `json:"l2Name"`

	// For base migrations
	CurrentBase string `json:"currentBase,omitempty"`
	TargetBase  string `json:"targetBase,omitempty"`
	HotSwap     bool   `json:"hotSwap,omitempty"`

	// Voting
	CreatedAt  int64 `json:"createdAt"`
	VotingEnds int64 `json:"votingEnds"`
	Executed   bool  `json:"executed"`
	ExecutedAt int64 `json:"executedAt"`
}

GovernanceProposal for base migrations and upgrades

type L2Config

type L2Config struct {
	Name              string `json:"name"`
	BaseChain         string `json:"baseChain"`        // ethereum, lux, lux-l1, op-mainnet
	RollupType        string `json:"rollupType"`       // optimistic, zk, hybrid
	DataAvailability  string `json:"dataAvailability"` // base, celestia, eigenda
	IBCEnabled        bool   `json:"ibcEnabled"`
	PreconfirmEnabled bool   `json:"preconfirmEnabled"`
	BasedRollup       bool   `json:"basedRollup"` // true for L1-sequenced

	// Contracts
	InboxContract  string `json:"inboxContract"`
	RollupContract string `json:"rollupContract"`
	BridgeContract string `json:"bridgeContract"`

	// Chain configuration
	ChainID     uint64 `json:"chainId"`
	L1BlockTime int    `json:"l1BlockTime"` // milliseconds

	// Token info
	TokenInfo TokenInfo `json:"tokenInfo"`

	// Fee configuration
	CongestionFeeShare int `json:"congestionFeeShare"` // percentage to rollup

	// Bridge configuration
	EnabledBridges []string `json:"enabledBridges"` // axelar, layerzero, wormhole, etc
	IBCChannels    []string `json:"ibcChannels"`    // IBC channel IDs

	// Deployment info
	DeployedAt    int64 `json:"deployedAt"`
	LastMigration int64 `json:"lastMigration"`
}

L2Config represents a based rollup configuration

type L3Config

type L3Config struct {
	Name   string `json:"name"`
	L2Base string `json:"l2Base"` // which L2 is the base
	// Inherits most properties from L2Config
	L2Config
}

L3Config for nested rollups

type LuxCompatiblity

type LuxCompatiblity map[string][]string

type MigrationTx

type MigrationTx struct {
	SubnetID            ids.ID `json:"subnetId"`
	BlockchainID        ids.ID `json:"blockchainId"`
	ValidatorManagement string `json:"validatorManagement"`
	RentalPlan          string `json:"rentalPlan"`
	Timestamp           int64  `json:"timestamp"`
}

MigrationTx represents a subnet to L1 migration transaction

type Network

type Network int64
const (
	Undefined Network = iota
	Mainnet
	Fuji
	Local
)

func NetworkFromNetworkID

func NetworkFromNetworkID(networkID uint32) Network

func NetworkFromString

func NetworkFromString(s string) Network

func (Network) NetworkID

func (s Network) NetworkID() (uint32, error)

func (Network) String

func (s Network) String() string

type NetworkData

type NetworkData struct {
	SubnetID     ids.ID
	BlockchainID ids.ID
	RPCVersion   int
}

type PermissionlessValidators

type PermissionlessValidators struct {
	TxID ids.ID
}

type PreconfirmConfig

type PreconfirmConfig struct {
	Enabled          bool   `json:"enabled"`
	Provider         string `json:"provider"`         // eigenlayer, builders, bonded
	ConfirmationTime int    `json:"confirmationTime"` // target ms
	CommitteeSize    int    `json:"committeeSize"`
	BondAmount       string `json:"bondAmount"` // in LUX
}

PreconfirmConfig represents pre-confirmation settings

type Sidecar

type Sidecar struct {
	Name            string
	VM              VMType
	VMVersion       string
	RPCVersion      int
	Subnet          string
	SubnetID        ids.ID
	BlockchainID    ids.ID
	TokenName       string
	ChainID         string
	Version         string
	Networks        map[string]NetworkData
	ElasticSubnet   map[string]ElasticSubnet
	ImportedFromAPM bool
	ImportedVMID    string

	// L1/L2 Architecture (2025)
	Sovereign     bool   `json:"sovereign"`     // true for L1, false for L2/subnet
	BaseChain     string `json:"baseChain"`     // For L2s: ethereum, lux-l1, lux, op-mainnet
	BasedRollup   bool   `json:"basedRollup"`   // true for L1-sequenced rollups
	SequencerType string `json:"sequencerType"` // based, centralized, distributed

	// Based Rollup Configuration
	InboxContract     string `json:"inboxContract"`     // Contract on base chain
	L1BlockTime       int    `json:"l1BlockTime"`       // Base chain block time in ms
	PreconfirmEnabled bool   `json:"preconfirmEnabled"` // Fast confirmations

	// Token & Economics
	TokenInfo  TokenInfo `json:"tokenInfo"`
	RentalPlan string    `json:"rentalPlan"` // For L1s: monthly, annual, perpetual

	// Validator Management
	ValidatorManagement string `json:"validatorManagement"` // proof-of-authority, proof-of-stake

	// Migration info
	MigratedAt int64 `json:"migratedAt"` // When subnet became L1

	// Chain layer (1=L1, 2=L2, 3=L3)
	ChainLayer int `json:"chainLayer"` // Default 2 for backward compat
}

func (Sidecar) GetVMID

func (sc Sidecar) GetVMID() (string, error)

type TokenInfo

type TokenInfo struct {
	Name     string `json:"name"`
	Symbol   string `json:"symbol"`
	Decimals uint8  `json:"decimals"`
	Supply   string `json:"supply"`
}

type VMCompatibility

type VMCompatibility struct {
	RPCChainVMProtocolVersion map[string]int `json:"rpcChainVMProtocolVersion"`
}

type VMType

type VMType string

func VMTypeFromString

func VMTypeFromString(s string) VMType

func (VMType) RepoName

func (v VMType) RepoName() string

Jump to

Keyboard shortcuts

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