graph 58.0 -> 99.1, graphvm 0 -> 100, ai 90.0 -> 96.2, inference 87.3 -> 98.0,
modelregistry 70.2 -> 98.9, aivmbridge 93.1 -> 99.8, anchor 98.1 -> 99.1,
fhe 33.0 -> 80.1.
graph charged one flat fee for any amount of work. The sharpest form was not
response size but TargetChains: decoded from caller JSON with no cap, one
GraphQL query per entry, so seven bytes of calldata bought an unbounded
fan-out. Response size is only known after the work, so the fee now reserves
the worst case up front and refunds down -- there is no deduction that can come
up short, and a failed run consumes the reservation rather than everything
supplied, so malformed input is not a cheap probe.
ai halted the chain from eight bytes. Two handlers bounded their length
prefixes in uint32, so near 2^32 the sum wrapped, the check passed and the
slice panicked. Reproduced at both 96 and 8 bytes. The correct int-based parser
already existed in the same package; the handlers just did not call it, and the
existing test only probed 0xFFFF, which never wraps.
fhe never enforced readOnly. It was threaded through Run and all 42 handlers
and read by none, so every op but decrypt and sealOutput wrote ciphertext,
metadata and ownership to the trie under STATICCALL. Decided once at dispatch;
an unknown selector counts as a writer.
fhe also allocated before it checked: five bytes of calldata asked for 34 GB
behind a flat 50,000 gas fee. div and rem were registered and priced at 655M
gas with no case in the switch, so both fell through and returned the zero
handle with a nil error -- success for a guaranteed no-op, with the real
implementations written and never wired. select decoded its control as a bare
Ciphertext when every ebool the precompile stores is a BitCiphertext, so it
could not have worked for any input; it surfaced only once failures stopped
being reported as success.
graph decodeArgs accepted truncated calldata as a shorter argument list, so
trimming bytes changed which variables a query expanded with. graphvm chose
resolvers by map iteration order, which is consensus-visible.
Deleted a dead second gas table that disagreed with the real one, an address
constant appearing only at its own declaration, and ten other symbols with no
reader.
The 0x0500..0010 GraphQL precompile (a registered StatefulPrecompiledContract)
ran the consensus Run path through four nondeterminism/halt hazards:
1. NIL-CLIENT PANIC (chain halt). The default instance holds a nil client until
VM init wires one; Query called a method on the nil interface with no guard,
panicking the unrecovered dispatch path and halting every validator that
processed the tx. -> nil now returns typed ErrClientNotInitialized.
2. time.Now()/wall-clock (startTime, cache TTL, stats timing) — diverges on
per-validator clock skew. -> removed entirely.
3. Process-global in-memory cache (map keyed by query, wall-clock TTL). A warm
vs cold validator returned stale-vs-fresh data and a different GasUsed — both
consensus-visible. -> removed; every query executes against local DB state.
4. Process-global stats counters mutated per call and returned on-chain via
getStats — cross-tx mutable state. -> removed; getStats returns deterministic
zero. And executeMultiChainQuery used goroutines whose scheduler-random order
decided the result set and 'first error' -> now sequential in TargetChains
order (deterministic results + first-error).
The precompile is now a stateless pure function of (input, local G-Chain DB):
no mutex, no cache, no stats, no goroutines, no wall-clock.
Regression: TestGraphQL_NilClientReturnsTypedErrorNotPanic (no panic, typed
error via both Query and the Run dispatch path), TestGraphQL_DeterministicAcrossRuns
(identical Data+GasUsed, no cache discount), TestGraphQL_MultiChainSequentialDeterministic
(chains visited in request order, byte-identical output x50),
TestGraphQL_MultiChainFirstErrorDeterministic (first error in request order).
Remove separate go.mod files from ai/, dex/, and graph/ subdirectories.
These are now regular packages under the main precompile module instead
of separate Go modules.
Changes:
- Remove ai/go.mod, ai/go.sum
- Remove dex/go.mod, dex/go.sum
- Remove graph/go.mod, graph/go.sum
- Fix ai_mining_test.go: rename VerifyNVTrust to VerifyTEE
- Fix graph/types.go: remove duplicate constant declarations
- Update ai/go.mod from go 1.24.0 to go 1.25.5
- Update graph/go.mod from go 1.22 to go 1.25.5
- Update graph geth dependency from v1.13.8-lux to v1.16.66
- Add local replace directive for geth in graph submodule
- Updated module names in dex/go.mod, ai/go.mod, graph/go.mod
- Removed stale precompiles indirect dependency
- Added replace directive for local geth
- Added exclude for old precompiles versions
- Update go.mod with proper dependencies for kzg4844
- Add graph precompiles for GraphQL and Oracle functionality
- Update corona contract with latest changes