mirror of
https://github.com/luxfi/chains.git
synced 2026-07-27 03:39:41 +00:00
strip 40 dead serialize:"true" tags (aivm/zkvm/graphvm/mpcvm)
These VMs marshal Config via JSON and wire via hand-rolled/ZAP — nothing reads the serialize tags (the reflection codec is gone). Pure dead metadata. Full suites green (byte-identical), confirming no reader existed. Co-authored-by: Hanzo Dev <dev@hanzo.ai>
This commit is contained in:
+19
-19
@@ -113,53 +113,53 @@ const (
|
||||
// Config contains AIVM configuration
|
||||
type Config struct {
|
||||
// Network settings
|
||||
MaxProvidersPerNode int `serialize:"true" json:"maxProvidersPerNode"`
|
||||
MaxTasksPerProvider int `serialize:"true" json:"maxTasksPerProvider"`
|
||||
MaxProvidersPerNode int `json:"maxProvidersPerNode"`
|
||||
MaxTasksPerProvider int `json:"maxTasksPerProvider"`
|
||||
|
||||
// HostChainID identifies which Lux L1/L2 this AIVM instance runs on.
|
||||
// "primary" = primary network (mainnet/testnet/devnet); anchor to
|
||||
// Q-Chain for cross-chain settlement. Any other value = white-label
|
||||
// L1/L2 (Hanzo, Zoo, Pars, Liquidity); anchor to the host chain's
|
||||
// own finality. AIVM is chain-agnostic — same code runs everywhere.
|
||||
HostChainID string `serialize:"true" json:"hostChainID"`
|
||||
HostChainID string `json:"hostChainID"`
|
||||
|
||||
// VerificationMode selects the result-verification strategy.
|
||||
// Default: ModeOptimistic (public-BFT-safe).
|
||||
VerificationMode VerificationMode `serialize:"true" json:"verificationMode"`
|
||||
VerificationMode VerificationMode `json:"verificationMode"`
|
||||
|
||||
// ChallengeWindowBlocks is the number of L1/L2 blocks during which
|
||||
// any party can submit a fraud proof against a posted result. Only
|
||||
// used by ModeOptimistic. Default 100 blocks (~5-10 minutes on
|
||||
// most Lux L1/L2 instances).
|
||||
ChallengeWindowBlocks uint64 `serialize:"true" json:"challengeWindowBlocks"`
|
||||
ChallengeWindowBlocks uint64 `json:"challengeWindowBlocks"`
|
||||
|
||||
// RedundancyFactor is M (signatures required) for
|
||||
// ModeMultiPartyRedundant. Total providers N is committed in the
|
||||
// task spec; M-of-N must produce the same result hash for
|
||||
// acceptance. Default 3-of-5.
|
||||
RedundancyFactor int `serialize:"true" json:"redundancyFactor"`
|
||||
RedundancyFactor int `json:"redundancyFactor"`
|
||||
|
||||
// MinProviderBond is the minimum stake (in host-chain native tokens,
|
||||
// wei-equivalent) a provider must lock to register. Forfeited on
|
||||
// successful fraud proof or majority-divergence. Default 1000 LUX.
|
||||
MinProviderBond uint64 `serialize:"true" json:"minProviderBond"`
|
||||
MinProviderBond uint64 `json:"minProviderBond"`
|
||||
|
||||
// Attestation settings — TEE is OPT-IN, NOT required by default.
|
||||
// On public chains keep RequireTEEAttestation=false; setting it true
|
||||
// restricts the provider set to TEE-equipped operators only, which
|
||||
// is a permissioned-subnet policy choice.
|
||||
RequireTEEAttestation bool `serialize:"true" json:"requireTEEAttestation"`
|
||||
MinTrustScore uint8 `serialize:"true" json:"minTrustScore"`
|
||||
AttestationTimeout string `serialize:"true" json:"attestationTimeout"`
|
||||
RequireTEEAttestation bool `json:"requireTEEAttestation"`
|
||||
MinTrustScore uint8 `json:"minTrustScore"`
|
||||
AttestationTimeout string `json:"attestationTimeout"`
|
||||
|
||||
// Task settings
|
||||
MaxTaskQueueSize int `serialize:"true" json:"maxTaskQueueSize"`
|
||||
TaskTimeout string `serialize:"true" json:"taskTimeout"`
|
||||
MaxTaskQueueSize int `json:"maxTaskQueueSize"`
|
||||
TaskTimeout string `json:"taskTimeout"`
|
||||
|
||||
// Reward settings
|
||||
BaseReward uint64 `serialize:"true" json:"baseReward"`
|
||||
EpochDuration string `serialize:"true" json:"epochDuration"`
|
||||
MerkleAnchorFreq int `serialize:"true" json:"merkleAnchorFreq"` // Blocks between Q-Chain anchors
|
||||
BaseReward uint64 `json:"baseReward"`
|
||||
EpochDuration string `json:"epochDuration"`
|
||||
MerkleAnchorFreq int `json:"merkleAnchorFreq"` // Blocks between Q-Chain anchors
|
||||
}
|
||||
|
||||
// DefaultConfig returns default AIVM configuration suitable for ANY
|
||||
@@ -226,11 +226,11 @@ type VM struct {
|
||||
// stateless handle bound to the deployment's chain ids.
|
||||
quorum *Engine
|
||||
qstate QuorumState
|
||||
qdb *versiondb.Database // engine-state staging layer over vm.db; committed at Block.Accept
|
||||
qdb *versiondb.Database // engine-state staging layer over vm.db; committed at Block.Accept
|
||||
qledger QuorumLedger
|
||||
qledgerSnap map[common.Address]*uint256.Int // last committed ledger balances (for abort rollback)
|
||||
ccv CCommitVerifier // proves a C intent is committed before it can create a task
|
||||
pendingIntents []CIntent // committed intents buffered for consensus-gated import
|
||||
qledgerSnap map[common.Address]*uint256.Int // last committed ledger balances (for abort rollback)
|
||||
ccv CCommitVerifier // proves a C intent is committed before it can create a task
|
||||
pendingIntents []CIntent // committed intents buffered for consensus-gated import
|
||||
|
||||
// Attestation verifier (local nvtrust - no cloud dependency)
|
||||
verifier *attestation.Verifier
|
||||
|
||||
+10
-10
@@ -44,22 +44,22 @@ var (
|
||||
// GConfig contains VM configuration
|
||||
type GConfig struct {
|
||||
// DGraph configuration
|
||||
DgraphEndpoint string `serialize:"true" json:"dgraphEndpoint"`
|
||||
SchemaVersion string `serialize:"true" json:"schemaVersion"`
|
||||
EnableFederation bool `serialize:"true" json:"enableFederation"`
|
||||
DgraphEndpoint string `json:"dgraphEndpoint"`
|
||||
SchemaVersion string `json:"schemaVersion"`
|
||||
EnableFederation bool `json:"enableFederation"`
|
||||
|
||||
// Query configuration
|
||||
MaxQueryDepth int `serialize:"true" json:"maxQueryDepth"`
|
||||
QueryTimeoutMs int `serialize:"true" json:"queryTimeoutMs"`
|
||||
MaxResultSize int `serialize:"true" json:"maxResultSize"`
|
||||
MaxQueryDepth int `json:"maxQueryDepth"`
|
||||
QueryTimeoutMs int `json:"queryTimeoutMs"`
|
||||
MaxResultSize int `json:"maxResultSize"`
|
||||
|
||||
// Index configuration
|
||||
AutoIndex bool `serialize:"true" json:"autoIndex"`
|
||||
IndexBatchSize int `serialize:"true" json:"indexBatchSize"`
|
||||
AutoIndex bool `json:"autoIndex"`
|
||||
IndexBatchSize int `json:"indexBatchSize"`
|
||||
|
||||
// Authentication configuration
|
||||
RequireAuth bool `serialize:"true" json:"requireAuth"`
|
||||
APIKeys []string `serialize:"true" json:"apiKeys"`
|
||||
RequireAuth bool `json:"requireAuth"`
|
||||
APIKeys []string `json:"apiKeys"`
|
||||
}
|
||||
|
||||
// VM implements the chain.ChainVM interface for the Graph Chain (G-Chain)
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ import (
|
||||
// over a zap object. Re-genesis authorized, so the on-disk/wire format is
|
||||
// these offsets (canonical: parse rejects trailing bytes).
|
||||
//
|
||||
// The legacy pcodecs LinearCodec keyed on `serialize:"true"` struct tags;
|
||||
// The legacy pcodecs LinearCodec keyed on struct tags;
|
||||
// every type here carries only `json:` tags, so the old codec marshaled ZERO
|
||||
// fields (a Block round-tripped to all-zero — a latent corruption bug). This
|
||||
// wire is the correct, field-preserving replacement.
|
||||
|
||||
+15
-15
@@ -4,8 +4,8 @@
|
||||
package zkvm
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
@@ -42,14 +42,14 @@ var (
|
||||
// ZConfig contains VM configuration
|
||||
type ZConfig struct {
|
||||
// Privacy configuration
|
||||
EnableConfidentialTransfers bool `serialize:"true" json:"enableConfidentialTransfers"`
|
||||
EnablePrivateAddresses bool `serialize:"true" json:"enablePrivateAddresses"`
|
||||
EnableConfidentialTransfers bool `json:"enableConfidentialTransfers"`
|
||||
EnablePrivateAddresses bool `json:"enablePrivateAddresses"`
|
||||
|
||||
// ZK proof configuration
|
||||
ProofSystem string `serialize:"true" json:"proofSystem"` // groth16, plonk, etc.
|
||||
CircuitType string `serialize:"true" json:"circuitType"` // transfer, mint, burn
|
||||
VerifyingKeyPath string `serialize:"true" json:"verifyingKeyPath"`
|
||||
TrustedSetupPath string `serialize:"true" json:"trustedSetupPath"`
|
||||
ProofSystem string `json:"proofSystem"` // groth16, plonk, etc.
|
||||
CircuitType string `json:"circuitType"` // transfer, mint, burn
|
||||
VerifyingKeyPath string `json:"verifyingKeyPath"`
|
||||
TrustedSetupPath string `json:"trustedSetupPath"`
|
||||
|
||||
// VerifyingKeys supplies real (non-dummy) verifying keys per circuit
|
||||
// type (keyed by the TransactionType string), in-memory at genesis.
|
||||
@@ -57,7 +57,7 @@ type ZConfig struct {
|
||||
// verification disabled, fail-closed). On a strict-PQ chain, supplying
|
||||
// a real bn254 verifying key here is REFUSED at construction
|
||||
// (errStrictPQRealVKForbidden) — shielded value uses STARK/FRI only.
|
||||
VerifyingKeys map[string][]byte `serialize:"true" json:"verifyingKeys"`
|
||||
VerifyingKeys map[string][]byte `json:"verifyingKeys"`
|
||||
|
||||
// StrictPQ HARD-DISABLES the classical (bn254 pairing-based) shielded
|
||||
// proof systems on this chain. When true, the shielded-tx ProofVerifier
|
||||
@@ -67,17 +67,17 @@ type ZConfig struct {
|
||||
// bn254 verifying key on a strict-PQ chain is an ERROR. This is the
|
||||
// Lux primary-network posture: a CRQC that breaks bn254 cannot forge a
|
||||
// shield/unshield proof to mint or steal shielded value.
|
||||
StrictPQ bool `serialize:"true" json:"strictPQ"`
|
||||
StrictPQ bool `json:"strictPQ"`
|
||||
|
||||
// FHE configuration
|
||||
EnableFHE bool `serialize:"true" json:"enableFHE"`
|
||||
FHEScheme string `serialize:"true" json:"fheScheme"` // BFV, CKKS, etc.
|
||||
SecurityLevel uint32 `serialize:"true" json:"securityLevel"` // 128, 192, 256
|
||||
EnableFHE bool `json:"enableFHE"`
|
||||
FHEScheme string `json:"fheScheme"` // BFV, CKKS, etc.
|
||||
SecurityLevel uint32 `json:"securityLevel"` // 128, 192, 256
|
||||
|
||||
// Performance
|
||||
MaxUTXOsPerBlock uint32 `serialize:"true" json:"maxUtxosPerBlock"`
|
||||
ProofVerificationTimeout time.Duration `serialize:"true" json:"proofVerificationTimeout"`
|
||||
ProofCacheSize uint32 `serialize:"true" json:"proofCacheSize"`
|
||||
MaxUTXOsPerBlock uint32 `json:"maxUtxosPerBlock"`
|
||||
ProofVerificationTimeout time.Duration `json:"proofVerificationTimeout"`
|
||||
ProofCacheSize uint32 `json:"proofCacheSize"`
|
||||
}
|
||||
|
||||
// VM implements the Zero-Knowledge UTXO Chain VM
|
||||
|
||||
Reference in New Issue
Block a user