mirror of
https://github.com/luxfi/chains.git
synced 2026-09-24 00:26:00 +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 <[email protected]>
36 lines
1.2 KiB
Go
36 lines
1.2 KiB
Go
// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package mpcvm
|
|
|
|
import (
|
|
"github.com/luxfi/node/vms/types/fee"
|
|
)
|
|
|
|
// newFeePolicy returns the canonical M-Chain FeePolicy. M-Chain is a
|
|
// committee-driven service VM — keygen / signing requests come from
|
|
// validators via consensus, not a user mempool — so it declares the
|
|
// NoUserTxPolicy sentinel. See vms/types/fee/policy.go.
|
|
//
|
|
// Any tx that reaches the fee gate on a NoUserTx chain is a wiring
|
|
// bug; ValidateFee returns ErrChainAcceptsNoUserTxs.
|
|
func newFeePolicy() fee.Policy {
|
|
return fee.NoUserTxPolicy{}
|
|
}
|
|
|
|
// gateUserTx refuses every caller — M-Chain accepts no user txs.
|
|
// Any service entry that exposes itself as user-callable MUST route
|
|
// through this gate so the refusal is explicit, not implicit.
|
|
func (vm *VM) gateUserTx() error {
|
|
if vm.feePolicy == nil {
|
|
return fee.ErrChainAcceptsNoUserTxs
|
|
}
|
|
// NoUserTxPolicy.ValidateFee ignores the args and always returns
|
|
// ErrChainAcceptsNoUserTxs.
|
|
return vm.feePolicy.ValidateFee(0, fee.NoUserTxPolicy{}.FeeAssetID())
|
|
}
|
|
|
|
// FeePolicy exposes the chain's declared fee policy for diagnostics
|
|
// and the boot-time Validate gate.
|
|
func (vm *VM) FeePolicy() fee.Policy { return vm.feePolicy }
|