mirror of
https://github.com/luxfi/chains.git
synced 2026-09-24 00:26:00 +00:00
F-Chain existed as a reserved vmID and a spec. luxfi/constants declares FHEVMID and node/node/vms.go lists fhevm in OptionalVMs, so luxd scanned --plugin-dir for a binary nothing produced. This builds it. F is the chain of record for encrypted values it never holds. It stores a ciphertext's 32-byte handle, the digest of the off-chain body, its owner, the capability permits granted over it, and the threshold decryptions asked for and answered — and no ciphertext body, no FHE key, no share. invariant_test.go proves that by walking the type graph and scanning the package source for the runtime's secret-bearing entry points. Six operations, each fee-settled through consensus on the shared chains/fee primitive and priced by scheme and ring dimension, because a TFHE boolean and a CKKS n=2^15 vector cost the committee amounts that differ by an order of magnitude. Two of them are threshold decisions: a decryption completes when Threshold distinct members attest the same result handle, and an epoch installs when Threshold members of the sitting committee attest the same successor. Votes are tallied per value and a member votes once, so one member naming a false result delays nothing and pays for the attempt; the deciding transaction carries the proposal, so nothing pending is ever stored. It WRAPS mpcvm/fhe rather than restating it — the records embed that package's types and the public parameters come from its threshold configuration — but owns its persistence, because that package's Registry stamps time.Now(). That is right for the off-chain daemon it was written for and wrong for a state root: two validators replaying one block would write different bytes. Every timestamp F writes comes from the accepting block. Shape follows keyvm: versiondb with a single commit and a rollback that reloads caches, fail-closed verification, a nonce replay guard, and a per-payer cumulative fee check within a block. Two things go further. GetBlockIDAtHeight answers from a real index written in the block's own commit rather than refusing. And a transaction names the state entry it writes, so admission refuses a second claim on it and consensus refuses a peer's block carrying both — without that, one payer's nonces n and n+1 can each pass every check and only collide in Accept, and a rejected block requeues, so the pair rebuilds indefinitely. The Makefile names its targets instead of globbing the directory: the glob swept in dexvm, fee, ownership, internal and cmd, and stopped at the first with no plugin entrypoint, so `make` built nothing at all.
24 lines
719 B
Makefile
24 lines
719 B
Makefile
# The VMs that ship a luxd plugin binary, named rather than globbed: this
|
|
# directory also holds packages that are libraries (dexvm, fee, ownership,
|
|
# internal) and a tool (cmd), and a glob swept those in and stopped the build at
|
|
# the first one with no plugin entrypoint.
|
|
VMS := aivm bridgevm evm fhevm graphvm identityvm keyvm mpcvm oraclevm quantumvm relayvm schain zkvm
|
|
|
|
.PHONY: all test clean $(VMS)
|
|
|
|
all: $(VMS)
|
|
|
|
# evm has main.go at root; all other VMs ship their plugin under cmd/plugin.
|
|
$(VMS):
|
|
@if [ -f $@/main.go ]; then \
|
|
go build -trimpath -ldflags="-s -w" -o build/$@ ./$@; \
|
|
else \
|
|
go build -trimpath -ldflags="-s -w" -o build/$@ ./$@/cmd/plugin; \
|
|
fi
|
|
|
|
test:
|
|
go test ./...
|
|
|
|
clean:
|
|
rm -rf build/
|