Files
dex/pkg
zeekay 53e0c44402 feat(dchain): ZAP socket is the canonical in-luxd CLOB ingestion (transport-decision)
The in-luxd native D-Chain plugin served HTTP only (the dev left the ZAP
socket to standalone cmd/dvenue: handler.go said 'the in-luxd plugin does
NOT use this path'). Owner transport decision: the ZAP socket is the
CANONICAL native ingestion in-luxd (the HFT path — binary wire, streaming,
co-located on the pod), HTTP stays as the compat surface (web/exchange-api/
debug). Both fold over the ONE clobMethods core; transport is orthogonal to
consensus, so it is safe to serve both — an order from either transport hits
the identical submitTx -> mempool.Add -> Verify-match path, and validators
replay from accepted block BYTES, never the wire.

zapingest.go: the VM owns its transports. Initialize parses init.Config for
an optional zapIngestAddr and, when set, opens rpc.Listen co-located in the
plugin process bound to clobMethods (reusing RegisterCLOB, the existing
socket seam) — served concurrently, closed on Shutdown. Enabled by DATA (the
chain config the operator/genesis sets), NOT a build tag or forked entry
point: one binary, one core, the transport set is a per-environment knob.
Empty addr => HTTP-compat-only (in-process tests + cmd/dvenue, which runs its
own socket, are unaffected). Malformed config fails fast at Initialize.

TDD (all !cgo):
 - TestZAPIngestCrossingOrdersMatchInBlock: an order over the VM's OWN
   config-started socket (no manual RegisterCLOB) -> consensus -> committed
   fill.
 - TestZAPIngestSharesOneCoreWithHTTP: maker rests over ZAP, taker crosses
   over HTTP against the SAME book -> proves one core, two transports.
 - TestParseConfig / TestNoZAPIngestWhenUnset / TestZAPIngestStopsOnShutdown:
   config contract (forwards-only), no-op path, clean idempotent teardown.

Additive: RegisterCLOB unchanged; CreateHandlers/ingest.go unchanged; the
runner (cmd/dchain) unchanged — the socket is a VM concern driven by config.
2026-06-23 15:24:27 -07:00
..