mirror of
https://github.com/luxfi/dex.git
synced 2026-09-24 00:26:31 +00:00
The D-Chain DEX VM (pkg/dchain) is the native consensus matcher: it runs the lx.OrderBook matcher inside luxd consensus (Block.Verify over a versiondb overlay) and is the chain VM luxd loads from PluginDir at the dexvm vmID slot — exactly like the EVM plugin. There is no standalone venue and no ZAP relay in the trading path. cmd/dchain + runner carried a //go:build dchain && cgo gate from the old 'venue accelerator' framing, but they import ONLY pkg/dchain (pure-Go), log, and vm/rpc — zero native deps. The gate excluded the plugin from every CGO=0 build, which is exactly how the node Dockerfile builds chain VM plugins. Drop the tag so cmd/dchain is the canonical CGO=0 native plugin (same harness as chains/*/cmd/plugin). The optional GPU AMM accelerator in pkg/lx stays gated by its own cuda/metal tags and is not linked by this consensus plugin. Proof: CGO_ENABLED=0 go build/vet ./cmd/dchain clean; native VM suite (TestLocalnetVenueE2E, TestFourPath, conservation, ownership) passes.