mpcvm

package
v1.34.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2026 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package mpcvm re-exports the canonical Threshold (FHE / MPC) VM from github.com/luxfi/chains/mpcvm so existing callers that imported github.com/luxfi/node/vms/mpcvm pre-extraction keep working without source changes.

New code should import the canonical path:

"github.com/luxfi/chains/mpcvm"

This file is a thin alias wrapper kept for backward compatibility.

Index

Constants

View Source
const (
	GPUBackendNone   = mpcvm.GPUBackendNone
	GPUBackendCUDA   = mpcvm.GPUBackendCUDA
	GPUBackendHIP    = mpcvm.GPUBackendHIP
	GPUBackendMetal  = mpcvm.GPUBackendMetal
	GPUBackendVulkan = mpcvm.GPUBackendVulkan
	GPUBackendWebGPU = mpcvm.GPUBackendWebGPU
)

Backend constants re-exported. Matches the chains/mpcvm dlopen probe order: cuda → hip → metal → vulkan → webgpu.

Variables

View Source
var (
	ErrInvalidOperation = mpcvm.ErrInvalidOperation
	NewClient           = mpcvm.NewClient
)
View Source
var ErrGPUNotAvailable = mpcvm.ErrGPUNotAvailable

ErrGPUNotAvailable is the canonical "no plugin loaded" error. Callers `errors.Is(err, mpcvm.ErrGPUNotAvailable)` to distinguish a fallback-to-CPU condition from a hard launcher failure.

Functions

This section is empty.

Types

type Block

type Block = mpcvm.Block

type BlockError

type BlockError = mpcvm.BlockError

type Client

type Client = mpcvm.Client

type GPUBackend

type GPUBackend = mpcvm.GPUBackend

func GPUBackendInstance

func GPUBackendInstance() *GPUBackend

GPUBackendInstance returns the dlopen'd GPU plugin handle resolved at chains/mpcvm package init. nil means no plugin was loaded (CPU-only mode). The handle is shared across the whole process — both the node and chains paths see the same instance.

The name is GPUBackendInstance (not GPUBackend / Backend) because Go disallows a function named the same as a type alias in the same package, and `Backend` is already a domain term in the threshold state machine. Callers write:

if g := mpcvm.GPUBackendInstance(); g != nil && g.IsAvailable() {
    _, err := g.CeremonyApply(desc, ops, ceremonies)
    ...
}

This mirrors the cevm pattern `cevm.AvailableBackends()` / `cevm.LibraryABIVersion()` — discovery via package-scope function, not via a global variable.

func SelectGPUBackend

func SelectGPUBackend() (*GPUBackend, string)

SelectGPUBackend returns the resolved GPU plugin (or nil) and a single human-readable diagnostic string. luxd startup logs use this to surface "mpcvm-gpu backend=<name>" lines alongside the cevm backend selection, matching the cevm.go pattern at ~/work/lux/chains/evm/backend_cgo.go.

Calling this multiple times is cheap — the underlying probe runs once at package init via sync.Once in chains/mpcvm/backend.go.

type GPUBackendKind

type GPUBackendKind = mpcvm.GPUBackendKind

type GPUCeremony

type GPUCeremony = mpcvm.GPUCeremony

type GPUCeremonyOp

type GPUCeremonyOp = mpcvm.GPUCeremonyOp

type GPUContribution

type GPUContribution = mpcvm.GPUContribution

type GPUContributionOp

type GPUContributionOp = mpcvm.GPUContributionOp

type GPUKeyShare

type GPUKeyShare = mpcvm.GPUKeyShare

type GPUMPCVMRoundDescriptor

type GPUMPCVMRoundDescriptor = mpcvm.GPUMPCVMRoundDescriptor

type GPUMPCVMState

type GPUMPCVMState = mpcvm.GPUMPCVMState

type GPUMPCVMTransitionResult

type GPUMPCVMTransitionResult = mpcvm.GPUMPCVMTransitionResult

type Operation

type Operation = mpcvm.Operation

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL