Files
chains/evm/cevm
zeekay d52e9ca2fb cevm: Go V1/V2/V3 are thin adapters over ExecuteBlock — one cgo path
Collapses the Go-side cgo entry points to a single canonical path:

  ExecuteBlock(backend, threads, txs, ctx, state)
    └─> C.gpu_execute_block_v4(...)

  ExecuteBlockV1(backend, txs)              -> ExecuteBlock + downcast
  ExecuteBlockV2(backend, threads, txs)     -> ExecuteBlock(nil, nil)
  ExecuteBlockV3(backend, threads, txs, ctx) -> ExecuteBlock(ctx, nil)
  ExecuteBlockV4 = ExecuteBlock (rename)

No more parallel C cgo calls. The luxcpp-side gpu_execute_block / _v2 / _v3
entries are now dead and can be removed in the next luxcpp release.

Health probe: the `callBridge` exception now applies on every backend
instead of GPU-only. The old V2 path masked kernel status with TxOK; the
canonical path surfaces the real CallNotSupported. Until the V5 kernel
implements CALL/CREATE on device, the probe accepts any clean return as
"dispatcher reached the bridge" — truth, not a mask.
2026-05-25 09:44:49 -07:00
..

cevm — C++ EVM execution backend

The CGO bridge to the C++ EVM in ~/work/luxcpp/cevm. Selected at link time via build tags from chains/evm/backend_{cgo,nocgo}.go.

This is not a standalone VM. It is the GPU-accelerated execution backend for C-Chain when built with LUX_CGO=1. The pure-Go fallback (luxfi/geth) is used when LUX_CGO=0.

Layout

chains/evm/
├── main.go                 # luxd plugin entry
├── backend_cgo.go          # cgo backend selector (LUX_CGO=1)
├── backend_nocgo.go        # pure-Go selector (LUX_CGO=0)
└── cevm/                   # this package — C++ FFI shim
    ├── cevm.go             # Go API
    ├── cevm_cgo.go         # cgo bindings (linked against luxcpp libs)
    ├── cevm_nocgo.go       # no-op stubs for !cgo builds
    └── plugin.go           # plugin registration glue

Linking

cevm_cgo.go references ${SRCDIR}/../../../../luxcpp/... for headers and libs. From ~/work/lux/chains/evm/cevm/ that resolves to ~/work/luxcpp/. For module-cache builds, see accel's fetch-luxcpp.sh pattern (TODO: port the same approach here).

Performance

When CGO is enabled and luxcpp libs are available:

  • ~3–5× the throughput of pure-Go EVM
  • SIMD opcode dispatch (AVX2/NEON)
  • GPU batch operations via Block-STM (CUDA/Metal)

Provenance

Folded into chains/evm from the previously-standalone luxfi/cevm repo on 2026-04-30. cevm is internal-only — no operator daemon. C-Chain runs in luxd. See ~/work/lux/chains/PLUGGABLE.md for the canonicalization pattern that governs the rest of the chain VMs.