mirror of
https://github.com/luxfi/chains.git
synced 2026-09-24 00:26:00 +00:00
graphvm: G-Chain is read-only (graphql.go explicitly rejects `mutation`
operations). Wires NoUserTxPolicy{} so any attempted user-tx is refused
at the boundary. Field + Initialize gate added; fee.Validate ensures
the policy choice is sound at boot.
oraclevm + relayvm: these chains are thin re-export shims of the
canonical impls in luxfi/oracle/vm and luxfi/relay/vm (which already
have feegate.go). Added in-file pointers documenting where the gate
lives, so future readers don't add a duplicate stub here.
Closes the FeePolicy migration: every VM in luxfi/chains/ either has
its own feegate.go (8 VMs), points to the canonical impl (oraclevm +
relayvm), or is exempt via native gas (evm). The matrix at
node/CLAUDE.md FeePolicy section is now complete.
25 lines
909 B
Go
25 lines
909 B
Go
// Copyright (C) 2019-2026, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package graphvm
|
|
|
|
import "github.com/luxfi/node/vms/types/fee"
|
|
|
|
// newFeePolicy returns the canonical G-Chain FeePolicy.
|
|
//
|
|
// G-Chain is read-only — the GraphQL executor explicitly rejects
|
|
// `mutation` operations (see graphql.go: "mutations not allowed:
|
|
// G-chain is read-only"). There is no user-submitted-tx mempool, so
|
|
// the only sound policy is NoUserTxPolicy{}: any path that ever tried
|
|
// to admit a user-tx is a bug.
|
|
//
|
|
// Per node/CLAUDE.md FeePolicy section: service-only chains use
|
|
// NoUserTxPolicy. Read-only chains are a subset of service-only.
|
|
func newFeePolicy() fee.Policy {
|
|
return fee.NoUserTxPolicy{}
|
|
}
|
|
|
|
// FeePolicy exposes the chain's declared fee policy for diagnostics and
|
|
// the boot-time Validate gate.
|
|
func (vm *VM) FeePolicy() fee.Policy { return vm.feePolicy }
|