4 Commits
Author SHA1 Message Date
zeekayandHanzo Dev 2f9a315893 One EVM per process; other EVMs are plugins the host loads
The C++ and Rust EVMs are separate luxd plugins. The host spawns every VM with
VM_TRANSPORT=zap (node/vms/rpcchainvm/factory.go) and the cevm binary is
exercised that way cross-process today. Choosing an EVM is choosing which plugin
binary runs -- not a switch inside the Go EVM.

This tree carried a second mechanism for the same choice: an in-process cgo
bridge that linked C++ into the Go binary behind -tags cevm/revm, with a
per-transaction executor registry, an evm_setBackend RPC to flip between
backends at runtime, a resident-store config knob, and a startup log naming the
chosen backend. Its executor returned nil, nil; its tagged build did not compile
(cevm_resident_store.go referenced symbols cevmbridge never defined); and no
build produced a binary that used it. 3,961 lines, gone.

What stays is what the Go EVM actually has: the BlockExecutor seam and
Block-STM behind it (blockstm.go), and the GPU accelerator seam with its
darwin/cgo bridge into luxfi/gpu (gpu_bridge.go). The state processor consults
both and falls through to sequential execution when neither is registered.

Note for the record: nothing in the shipped binary registers a BlockExecutor,
so blocks run sequentially on the Go interpreter. The removed startup log said
"Block-STM across all cores"; it was not describing this binary. Wiring
Block-STM into the production path changes consensus execution and is a
separate decision, made deliberately, with a parity gate.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-09 12:53:54 -07:00
zeekay 74364a6e95 fix: cevm is fastest interpreter, revm for parallel Block-STM 2026-04-07 00:43:15 -07:00
zeekay 3f686f9d65 feat: modular EVM backend switching — gevm, revm, cevm
Three swappable EVM backends via build tags:
  gevm (default) — Go EVM from luxfi/geth (always available)
  revm (-tags revm) — Rust EVM via FFI (2x faster, native Block-STM)
  cevm (-tags cevm) — C++ EVM via CGo (3x faster, GPU kernels)

Architecture:
  parallel.TransactionExecutor interface — per-tx backend dispatch
  parallel.EVMBackend enum — gevm | revm | cevm | auto
  parallel.RegisterTransactionExecutor() — init()-time registration
  parallel.SetBackend(AutoEVM) — runtime selection (cevm > revm > gevm)
  parallel.AvailableBackends() — query what's linked

Block-level: parallel.BlockExecutor (unchanged, already wired)
GPU: parallel.GPUAccelerator (unchanged, Metal ecrecover working)

Backend stubs in backend_revm.go and backend_cevm.go — build-tagged,
register on init(). FFI/CGo bridges TBD in luxfi/revm and luxfi/cevm.

StateDB is the bridge — all backends read/write through the same Go
StateDB interface, ensuring consensus compatibility regardless of
which interpreter runs the bytecode.
2026-04-07 00:19:15 -07:00
zeekay 41e3cd7961 feat: parallel execution plugin interface (build-tag based) 2026-04-05 15:00:29 -07:00