mirror of
https://github.com/zooai/chains.git
synced 2026-10-30 14:50:32 +00:00
Bump evm v0.8.47->v1.99.21 and transitive luxfi core (consensus v1.25.17, node v1.30.9, vm v1.2.3, threshold v1.9.9, crypto v1.19.20, geth v1.17.5, precompile v0.5.38, fhe v1.8.2). Drops github.com/luxfi/corona entirely; the Ring-LWE threshold primitive is now github.com/luxfi/corona v0.7.6. precompile pinned v0.5.38 (evm v1.99.21 requirement; keeps corona + inference + modelregistry). api pinned v1.0.12 to match vm v1.2.3 rpc (v1.0.14 renamed InitializeRequest.LuxAssetID->UTXOAssetID). main.go: drop retired precompile/quasar (pre-LP-4200 quasar stubs retired for LP-4200 0x012200 PQ block) and deleted precompile/ecies (private keys in calldata are exposed on-chain; use hpke + x25519).
95 lines
5.0 KiB
Go
95 lines
5.0 KiB
Go
// Lux EVM plugin — C-Chain EVM with all precompiles enabled.
|
|
//
|
|
// Every precompile is explicitly imported. No umbrella packages.
|
|
// Genesis determines which are active at which block/timestamp.
|
|
package main
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/luxfi/evm/plugin/evm"
|
|
"github.com/luxfi/log"
|
|
"github.com/luxfi/sys/ulimit"
|
|
"github.com/luxfi/version"
|
|
"github.com/luxfi/vm/rpc"
|
|
|
|
// ── Curves ───────────────────────────────────────────
|
|
_ "github.com/luxfi/precompile/ed25519" // 0x3211 Ed25519 verify
|
|
_ "github.com/luxfi/precompile/secp256r1" // 0x0100 P-256 verify (EIP-7212)
|
|
_ "github.com/luxfi/precompile/sr25519" // 0x0A00 Substrate SR25519 verify
|
|
|
|
// ── Post-Quantum (FIPS 203/204/205) ──────────────────
|
|
_ "github.com/luxfi/precompile/mldsa" // 0x0200..06 ML-DSA verify (Dilithium)
|
|
_ "github.com/luxfi/precompile/mlkem" // 0x0200..07 ML-KEM encap/decap (Kyber)
|
|
_ "github.com/luxfi/precompile/slhdsa" // 0x0600..01 SLH-DSA verify (SPHINCS+)
|
|
_ "github.com/luxfi/precompile/corona" // 0x0200..0B Corona lattice threshold
|
|
|
|
// ── Hashing ──────────────────────────────────────────
|
|
_ "github.com/luxfi/precompile/blake3" // 0x0500..04 Blake3 hash
|
|
|
|
// ── Threshold Signatures ─────────────────────────────
|
|
_ "github.com/luxfi/precompile/cggmp21" // 0x0800..03 CGGMP21 ECDSA threshold
|
|
_ "github.com/luxfi/precompile/frost" // 0x0800..02 FROST EdDSA threshold
|
|
|
|
// ── AI ────────────────────────────────────────────────
|
|
_ "github.com/luxfi/precompile/ai" // 0x0300 AI mining / inference
|
|
|
|
// ── Bridge ───────────────────────────────────────────
|
|
_ "github.com/luxfi/precompile/bridge" // 0x0440-0443 Gateway + Router + Verifier + Liquidity
|
|
|
|
// ── FHE ──────────────────────────────────────────────
|
|
_ "github.com/luxfi/precompile/fhe" // 0x0700 Fully homomorphic encryption
|
|
|
|
// ── ZK Proofs ────────────────────────────────────────
|
|
_ "github.com/luxfi/precompile/zk" // 0x0900 Groth16 + PLONK + fflonk + Halo2
|
|
|
|
// ── Encryption / Privacy ─────────────────────────────
|
|
// NOTE: ecies/aes/chacha20 precompiles were deleted upstream (precompile
|
|
// >= v0.5.38): they require private/symmetric keys in calldata, which are
|
|
// irrecoverably exposed on-chain. Use hpke (public-key seal) + x25519
|
|
// (ephemeral DH) instead.
|
|
_ "github.com/luxfi/precompile/hpke" // 0x9200 Hybrid Public Key Encryption
|
|
_ "github.com/luxfi/precompile/ring" // 0x9202 Ring signatures
|
|
|
|
// ── DEX (LX Suite 0x9010-0x9080) ─────────────────────
|
|
_ "github.com/luxfi/precompile/dex" // Pool + Oracle + Router + Hooks + Flash + Book + Vault + Price + Lend + Repayer + Liquidator + Transmuter
|
|
|
|
// ── Graph ────────────────────────────────────────────
|
|
_ "github.com/luxfi/precompile/graph" // 0x0500 On-chain GraphQL
|
|
|
|
// ── Blob ─────────────────────────────────────────────
|
|
_ "github.com/luxfi/precompile/kzg4844" // 0xB002 EIP-4844 KZG commitments
|
|
|
|
// ── Attestation ──────────────────────────────────────
|
|
_ "github.com/luxfi/precompile/attestation" // Remote attestation (TEE)
|
|
|
|
// ── Registry ─────────────────────────────────────────
|
|
_ "github.com/luxfi/precompile/registry" // Precompile registry + BLS12-381 curves
|
|
|
|
// ── REMOVED (umbrellas — use explicit imports above) ──
|
|
// _ "github.com/luxfi/precompile/pqcrypto" — use mldsa + mlkem + slhdsa
|
|
// _ "github.com/luxfi/precompile/quantum" — use mldsa + mlkem + slhdsa + corona
|
|
// _ "github.com/luxfi/precompile/threshold" — use cggmp21 + frost + corona
|
|
)
|
|
|
|
func main() {
|
|
versionStr := fmt.Sprintf("Lux-EVM/1.0.0 [node=%s, rpcchainvm=%d]", version.Current, version.RPCChainVMProtocol)
|
|
|
|
if len(os.Args) > 1 && os.Args[1] == "version" {
|
|
fmt.Println(versionStr)
|
|
os.Exit(0)
|
|
}
|
|
|
|
if err := ulimit.Set(ulimit.DefaultFDLimit, log.Root()); err != nil {
|
|
fmt.Fprintf(os.Stderr, "failed to set fd limit: %s\n", err)
|
|
os.Exit(1)
|
|
}
|
|
|
|
if err := rpc.Serve(context.Background(), log.Root(), &evm.VM{}); err != nil {
|
|
fmt.Fprintf(os.Stderr, "rpc.Serve error: %s\n", err)
|
|
os.Exit(1)
|
|
}
|
|
}
|