mirror of
https://github.com/luxfi/chains.git
synced 2026-07-27 03:39:41 +00:00
Under LP-0130's canonical roster, chains/thresholdvm/ hosts the M-Chain VM (MPC threshold signing). The package name "thresholdvm" was the last piece of T-Chain nomenclature still shipping in code — legacy from the pre-LP-134 shared-substrate design. Renamed to mpcvm/ so the package name matches the M-Chain letter and LP-7100 spec. - chains/thresholdvm/ → chains/mpcvm/ (dir + inner files + package decl) - Sed-replace thresholdvm → mpcvm across .go / .md / .yml / .json / .sh - Fee/settlement primitive references now say mpcvm - LLM.md canonical chain roster (LP-0130) already points at mpcvm/ F-Chain runtime pieces (fhe/, protocol/tfhe_keygen/, runtime/f_chain_adapter.go) stay under mpcvm/ for now — they consume the same shared threshold primitives. A follow-up extract to chains/fhevm/ can happen once F-Chain runtime graduates. Co-authored-by: Hanzo Dev <dev@hanzo.ai>
36 lines
1.6 KiB
Go
36 lines
1.6 KiB
Go
// Copyright (C) 2019-2026, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package mpcvm
|
|
|
|
import "testing"
|
|
|
|
// TestServiceSurfaces_Decomposition documents and locks the LP-134 / LP-7050
|
|
// service decomposition: the single *VM satisfies all three orthogonal
|
|
// surfaces today (compatibility bridge), and — critically — the layering is
|
|
// real, not cosmetic: MPCService and FHEService each EMBED ThresholdService,
|
|
// so any type that is an MPCService or FHEService is necessarily also a
|
|
// ThresholdService (it consumes the substrate). The var-block assertions in
|
|
// service.go already enforce *VM satisfies each at compile time; this test
|
|
// makes the embedding relationship explicit so a future physical split
|
|
// (mpcvm implements MPCService, fhevm implements FHEService) cannot silently
|
|
// drop the substrate dependency.
|
|
func TestServiceSurfaces_Decomposition(t *testing.T) {
|
|
var vm *VM // nil is fine: we only exercise the static type system
|
|
|
|
// MPCService is a superset of ThresholdService (M consumes the substrate).
|
|
var mpc MPCService = vm
|
|
var _ ThresholdService = mpc
|
|
|
|
// FHEService is a superset of ThresholdService (F consumes the substrate).
|
|
var fhe FHEService = vm
|
|
var _ ThresholdService = fhe
|
|
|
|
// ThresholdService alone must NOT expose the MPC/FHE-specific surface —
|
|
// this is verified structurally by the interfaces not sharing those
|
|
// methods; the assignment above going only one direction (MPC->Threshold,
|
|
// never Threshold->MPC) is the compile-time proof of orthogonality.
|
|
var ths ThresholdService = vm
|
|
_ = ths
|
|
}
|