mirror of
https://github.com/luxfi/chains.git
synced 2026-07-27 03:39:41 +00:00
VM consolidation (one module, one place only):
- Removed per-VM go.mod/go.sum/VERSION from {aivm,bridgevm,dexvm,evm,
graphvm,identityvm,keyvm,oraclevm,quantumvm,relayvm,thresholdvm,zkvm}
- All VMs now compile under github.com/luxfi/chains root module
- aivm/, dexvm/, identityvm/, keyvm/, oraclevm/ factory.go + vm.go updated
for AccelHost wiring
cevm Go-side (evm/cevm/):
- cevm.go, cevm_cgo.go, cevm_nocgo.go: ExecuteBlockV4(backend, threads,
txs, ctx, state) with StateAccount snapshot
- cevm_secp256k1.go: BatchRecoverSenders Metal LDFLAGS
- cevm_secp256k1_metal_anchor_darwin.{c,go}: anchor to keep linker from
dropping libsecp256k1_metal.a
- cevm_secp256k1_nocgo.go: stub for non-cgo builds
- plugin.go, fetch-luxcpp.sh, luxcpp-SHA256SUMS, LUXCPP_VERSION:
pinned luxcpp consumption
- evm/cevm/parallel/parallel.go: BlockExecutor adapter calls
cevm.ExecuteBlockV4 with state snapshot built from txs+statedb
Quantum/ZK witness:
- quantumvm/quasar_witness.go, zkvm/zwitness.go
go.mod: removed dead `replace github.com/ethereum/go-ethereum => luxfi/geth`
directive (caused dual-path conflict after math semver bump; no remaining
ethereum/go-ethereum imports in source). go mod tidy clean.
Tests: TestBatchRecoverSenders PASS through Metal anchor (cevm package).
31 lines
835 B
Go
31 lines
835 B
Go
// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package aivm
|
|
|
|
import (
|
|
"github.com/luxfi/accel"
|
|
"github.com/luxfi/ids"
|
|
"github.com/luxfi/log"
|
|
"github.com/luxfi/node/vms"
|
|
)
|
|
|
|
var _ vms.Factory = (*Factory)(nil)
|
|
|
|
// VMID is the unique identifier for AIVM (A-Chain)
|
|
var VMID = ids.ID{'a', 'i', 'v', 'm'}
|
|
|
|
// Factory implements vms.Factory interface for creating AIVM instances
|
|
type Factory struct{}
|
|
|
|
// New creates a new AIVM instance.
|
|
// Allocates a per-VM GPU session at PriorityNormal for future batch
|
|
// attestation verification and tensor proof checks.
|
|
func (f *Factory) New(log.Logger) (interface{}, error) {
|
|
sess, err := accel.NewVMSession("aivm", accel.WithPriority(accel.PriorityNormal))
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &VM{accel: sess}, nil
|
|
}
|