mirror of
https://github.com/luxfi/precompile.git
synced 2026-09-24 00:26:21 +00:00
Corona is the Ring-LWE threshold signature scheme (lattice flavor:
Ring-LWE, vs Pulsar's Module-LWE / ML-DSA). The pre-rename library
name was Corona. Sweep eliminates every Corona reference across
the precompile tree and gives the Ring-LWE threshold its own slot
in the LP-4200 PQCrypto block:
0x012201 = ML-KEM (Module-LWE KEM, FIPS 203)
0x012202 = ML-DSA (Module-LWE single-sig, FIPS 204)
0x012203 = SLH-DSA (hash-based signature, FIPS 205)
0x012204 = Pulsar (Module-LWE threshold, FIPS 204 byte-equal)
0x012205 = P3Q (strict-PQ STARK)
0x012206 = Corona (Ring-LWE threshold)
Pulsar previously squatted 0x012204 alone; Corona/Corona also
claimed 0x012204 — direct slot collision. Fixed by moving Corona
to its own slot 0x012206 since they're distinct primitives
(different lattice flavors).
- Directory: corona/ → corona/
- Package: coronathreshold → coronathreshold
- Type: coronaThresholdPrecompile → coronaThresholdPrecompile
- Var: CoronaThresholdPrecompile → CoronaThresholdPrecompile
- Address: 0x012204 → 0x012206
- Library: luxfi/corona/sign → luxfi/corona/sign
luxfi/corona/threshold → luxfi/corona/threshold
- Interface: ICoronaThreshold.sol → ICoronaThreshold.sol
- Registry: CoronaCChain → CoronaCChain, CORONA → CORONA
- Quasar: Corona* identifiers in quasar/contract.go renamed
- Bridge: docstring sweep
All affected packages build clean. All 5/6 PQ precompile tests pass
(one flaky on first run, green on retry). Bridge has a pre-existing
unrelated build break (ErrChainNameTooLong undefined).
33 lines
1.2 KiB
Go
33 lines
1.2 KiB
Go
// SPDX-License-Identifier: Apache-2.0
|
|
// Copyright (C) 2025, Lux Industries, Inc. All rights reserved.
|
|
|
|
package bridge
|
|
|
|
import "github.com/luxfi/geth/common"
|
|
|
|
// ChainID is the canonical numeric chain identifier (EIP-155 for EVM chains;
|
|
// virtual ids >= 900_000 for non-EVM bookkeeping).
|
|
type ChainID uint32
|
|
|
|
// Chain is one row in the supported-chain registry. Pure data, no behavior.
|
|
type Chain struct {
|
|
ID ChainID // canonical numeric id
|
|
Name string // short canonical name (e.g. "lux", "zoo-test")
|
|
EVM bool // native EVM (eth_chainId) vs virtual / bookkeeping
|
|
GatewayAt common.Address // optional bridge gateway address on that chain
|
|
}
|
|
|
|
// Registry resolves chains by id and enumerates the supported set.
|
|
//
|
|
// Implementations:
|
|
// - staticRegistry: compile-time immutable list, used in tests and as the
|
|
// production seed.
|
|
// - stateRegistry: reads rows from the bridge contract's EVM storage so
|
|
// operators can governance-tx new chains in or out at runtime.
|
|
type Registry interface {
|
|
// Get returns the chain row for id and ok=true if registered.
|
|
Get(id ChainID) (Chain, bool)
|
|
// All returns every registered chain, in registry order.
|
|
All() []Chain
|
|
}
|