Files
precompile/modules
zeekay 9cfae862cf dex(0x9999): always-on settlement precompile, runtime params, zero per-net config
0x9999 — the native C<->D atomic DEX settlement money path — is now ALWAYS-ON:
present + active on every chain that loads the EVM plugin, from genesis, with NO
dexSettleConfig genesis/upgrade entry. This is the production-launch design; the
per-net config-gate is killed. Forward-perfect, one activation way.

Activation: modules.Module gains an AlwaysOn flag (+ modules.AlwaysOnModules()).
SettleModule sets AlwaysOn=true. The Configurator is retained only to satisfy the
interface; for an always-on module the host never invokes Configure (no activating
config). SettleConfig collapses to a parameter-free {Upgrade} marker that always
Verifies — 0x9999 takes no per-net parameters.

Params resolved at RUNTIME, not config (Configure has no consensus context, so it
cannot resolve them):
  - protocolFeeController: built-in DefaultDAOTreasury (set in init). One canonical
    DAO governance authority across every network; not a compromised dev key.
  - networkID / cChainID: already sourced at runtime via contract.AtomicState.
  - dChainID (THE crux): contract.AtomicState gains DChainID(). The 4 native-client
    sites that read loadDChainTarget(stateDB) now read atomicState.DChainID(), which
    the host resolves from the chain topology (consensus-context "D"/dexvm alias).
    ids.Empty (no dexvm on this network) closes the seam — fail-secure, no mint.

Money-path logic is byte-for-byte unchanged: DeriveIntentID/DerivePositionCommitID,
lock/stage/credit, conservation, exactly-once, rail discriminator, FIX-2 one-batch
flush, nonReentrant/custody guards all untouched. The ONLY change is HOW the
precompile activates and obtains its params (runtime, not config). The Empty-dChain
revert is preserved (strengthened: SubmitSwapIntent/SubmitPositionCommit now revert
on Empty instead of falling back to the C-Chain's own id).

Dead config machinery removed (one way, no dead code): SetSettle{ChainIdentity,
DChainTarget}, loadDChainTarget, loadSettleChainIdentity, cfg{Net,CChain,DChain}IDKey
slots, the STM read-set entries for them, and the now-unused kvAdapter Configure bridge.

Tests: full dex suite 335/335 PASS, 0 fail, 0 skip (CGO_ENABLED=0; the test binary's
only CGO dep is luxfi/accel, unrelated to the pure-Go money path). Harness feeds the
D peer via the runtime AtomicState capability, mirroring production exactly — proof
that the money path is intact with zero config.

go.sum: reconcile e2e threshold v1.9.4 to the origin-canonical hash (upstream re-tag).
2026-06-21 09:03:37 -07:00
..