Commit Graph
2425 Commits
Author SHA1 Message Date
Hanzo AI 052eabc032 gitignore stray dev-tool binaries 2026-05-21 15:01:49 -07:00
Hanzo AI 1888428bd4 drop hardcoded /Users/z paths — use $HOME-relative 2026-05-21 15:01:35 -07:00
Hanzo AI 2495b77d00 fix(network): track luxfi/genesis AllocationJSON/StakerJSON rename + ETHAddr field
luxfi/genesis renamed UnparsedAllocation → AllocationJSON,
UnparsedStaker → StakerJSON, with field ETHAddr (was EVMAddr in an
earlier rev). Update network/config.go to match.
2026-05-21 13:53:55 -07:00
Hanzo AI fe701a0ccd kill protobuf from default build: k8s engine behind -tags k8s, expand CI guard
engines/k8s/engine.go: //go:build k8s. k8s.io/client-go transitively
pulls google.golang.org/protobuf via k8s.io/kube-openapi → gnostic-models.
Opt-in build: go build -tags k8s ./... to enable Kubernetes deploy
support. Default builds skip the file entirely.

scripts/check-no-grpc.sh: extend the CI gate to fail on any of:
  - google.golang.org/grpc
  - grpc-ecosystem/grpc-gateway
  - google.golang.org/protobuf
  - go.opentelemetry.io/proto/otlp/*
  - k8s.io/client-go

Each has a documented -tags escape hatch. The default-tag dep graph
must be clean of all five.

Results:
  bash scripts/check-no-grpc.sh   → ok
  binary size:                    37.9 MB → 26.7 MB (-11.2 MB)
  strings grep protobuf|grpc      → 0 hits

Per the project rule: ZAP internal, ZIP edge. ZAP is now the only
wire protocol the default netrunner binary contains.
2026-05-20 22:09:30 -07:00
Hanzo AI c0d55e7195 rpcpb: gate rpc.pb.go behind -tags grpc, hand-rolled types.go is default
Per the project rule: ZAP internal, no google.golang.org/protobuf on the
wire OR in the netrunner rpcpb package by default.

rpcpb/rpc.pb.go: //go:build grpc — protoc-gen-go output stays available
behind the legacy tag for external integrations that still want the
proto Go types.

rpcpb/types.go: //go:build !grpc — hand-written plain Go structs for
every Request/Response/spec/info type. Same names, same field types,
same json: tags so JSON wire compat with rpc.pb.go is preserved. Plus
the proto-style GetX() helpers callers expect.

Default-build dep graph for rpcpb is now SINGLE-FILE: rpcpb/types.go,
zero google.golang.org/protobuf, zero google.golang.org/grpc.

scripts/check-no-grpc.sh: CI gate. Walks the default-tag dep graph
and fails non-zero if google.golang.org/grpc or grpc-ecosystem/grpc-gateway
reappears. Wire this into CI to make the rule stick.
2026-05-20 21:27:51 -07:00
Hanzo AI 301a8e2601 rip gRPC, USE ZAP: netrunner control-plane now luxfi/zap-native (FORWARDS ONLY)
Per the project rule 'ZAP internal, ZIP edge': netrunner's 26-method
ControlService + PingService move off google.golang.org/grpc and
grpc-gateway onto a luxfi/zap envelope. Default builds now have ZERO
google.golang.org/grpc transitive deps.

New package: netrunner/zaprpc/
  - protocol.go: MsgType (uint8 range, encoded in ZAP flags upper byte).
    One stable wire ID per method. Append-only.
  - dispatch.go: typed Bind[Req, Resp](d, msg, handler) — register a
    'func(ctx, *Req) (*Resp, error)' handler. JSON encode/decode +
    envelope framing happen here, handlers stay business-logic-only.
  - server.go: thin wrapper around zap.Node hosting a Dispatcher.
  - client.go: typed Call[Req, Resp](ctx, c, msg, req) — same DX as the
    old gRPC client but transport is ZAP. Includes connect-retry around
    the boot race.

server/bind.go: one-shot registration of all 26 RPC methods onto a
Dispatcher. The canonical map of 'what this server exposes'.

server/server.go: gRPC server + grpc-gateway HTTP bridge are gone.
Run() now starts the ZAP server and waits for rootCtx.Done. The
'soldier-on' isClientCanceled helper goes with the gRPC stream code.

client/client.go: full rewrite. Same Client interface (28 methods),
implementation is now one-line zaprpc.Call per method. StreamStatus
becomes a client-driven Status() poll on the requested interval —
ZAP has no native server-streaming, but the observable contract
(channel of ClusterInfo) is unchanged.

Deleted:
  - rpcpb/rpc_grpc.pb.go (gRPC service stubs)
  - rpcpb/rpc.pb.gw.go (grpc-gateway HTTP bridge)

The rpcpb message types (rpc.pb.go) stay — they're plain Go structs
with json: tags, used as the JSON payload format inside ZAP envelopes.
A future cleanup pass can replace them with hand-written structs to
drop google.golang.org/protobuf from the dep tree too.

go.mod cleanup: drop github.com/grpc-ecosystem/grpc-gateway/v2,
google.golang.org/grpc, google.golang.org/genproto/googleapis/api.
Pin luxfi/proto v1.0.0 (was luxfi/protocol v0.0.4 — stale rename
artifact). Add luxfi/zap v0.2.0.

Tests: zaprpc/zaprpc_test.go round-trips request/response and proves
the error path propagates through the envelope.

No backwards compat — forwards perfection per the project rule.
2026-05-20 19:15:40 -07:00
Hanzo AI 359e75ced5 rip: AI-generated soldier-on + adopt EVMAddr/UTXOAddr (genesis package rename)
network/config.go:
- 'beacon node P2P port not ready, continuing anyway' was a soldier-on
  pattern: if the beacon's staking port isn't up before the next node
  tries to dial it, bootstrap will silently fail. Fail loudly instead.
- Switch UnparsedAllocation field names ETHAddr→EVMAddr, LUXAddr→UTXOAddr
  to track the genesis package rename.
2026-05-20 17:12:03 -07:00
Hanzo AI 31175c1220 netrunner: refresh go.mod + gitignore .bak files
go.mod dep refresh, network.go updates, *.bak in gitignore.
2026-05-20 16:23:29 -07:00
Hanzo AI 727c5ed682 Merge rename/protocol-to-proto into main (resolved go.mod: keep sdk v1.16.60) 2026-05-18 21:29:48 -07:00
Hanzo AI c22813f2fe deps: pin luxfi/proto v1.0.0 (rename cascade complete) 2026-05-18 21:27:49 -07:00
Hanzo AI b673b28c31 rename: github.com/luxfi/protocol → github.com/luxfi/proto (imports + go.mod replace) 2026-05-18 21:19:09 -07:00
Hanzo DevandGitHub db76e3e82a chore: bump Go toolchain to 1.26.3 (#43)
Pin Go version to 1.26.3 across go.mod, CI workflows, and Dockerfiles
for canonical alignment with the rest of the luxfi/* stack.
2026-05-16 16:44:41 -07:00
a9509b5c6c build(deps): bump google.golang.org/grpc from 1.80.0 to 1.81.1 (#38)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.80.0 to 1.81.1.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.80.0...v1.81.1)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-version: 1.79.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Hanzo Dev <dev@hanzo.ai>
2026-05-16 16:21:27 -07:00
Hanzo DevandGitHub 5cd2aa79bd Merge pull request #42 from luxfi/licensing/canonical-pointer
docs: add LICENSING.md pointer to canonical Lux IP strategy
2026-05-15 16:43:08 -07:00
Hanzo Dev faf61cc5c8 docs: add LICENSING.md pointing at canonical Lux IP strategy
Single LICENSING.md file referencing the canonical three-tier IP and
licensing strategy at github.com/luxfi/.github/blob/main/profile/README.md.

LICENSE file is unchanged; this only adds a navigational pointer.
2026-05-15 16:43:02 -07:00
Hanzo DevandGitHub 811118da30 env: drop LUX_ prefix from env vars (noise) (#41)
Renames LUX_-prefixed env vars to canonical, non-noisy forms across
genesis_config, blockchain, network, examples, tests, genkeys, server:

- LUX_MNEMONIC      -> MNEMONIC
- LUX_PRIVATE_KEY   -> PRIVATE_KEY
- LUX_KEYS_DIR      -> KEYS_DIR
- LUX_BINARY_PATH   -> BINARY_PATH
- LUX_NETWORK_TYPE  -> NETWORK_TYPE  (doc only)
- LUX_GPU_EVM       -> GPU_EVM       (doc only)
- LUX_GPU_WORKER_PID-> GPU_WORKER_PID

Also fixes an obvious infinite-recursion bug in
local/genesis_config.go::getMnemonic() that the previous LUX_MNEMONIC
fallback line had become — the helper now reads MNEMONIC then
LIGHT_MNEMONIC and returns. Without this fix, callers reaching the
fallback would have hung the process.

BREAKING: external callers (CI, dev scripts, operators) must update
env var names. Per CLAUDE.md no-backwards-compatibility rule, the old
forms are removed.
2026-05-15 16:26:33 -07:00
Hanzo AI edd60a6326 deps: luxfi/crypto v1.19.0 2026-05-13 12:00:35 -07:00
Hanzo AI f56b122aaf deps: track sdk APIBlockchain ChainID → NetID rename + bump sdk v1.16.57
luxfi/sdk v1.16.57 renamed APIBlockchain.ChainID → APIBlockchain.NetID
to match the platformvm wire format. Update server/network.go's two
call sites to use blockchain.NetID instead of blockchain.ChainID;
the local chainInfo struct field is left as `chainID ids.ID` so
downstream code that reads it isn't affected.

Bumps luxfi/sdk to v1.16.57 + transitive Z-Wing PQ stack tracked in
v1.18.1.
2026-05-06 18:42:17 -07:00
Hanzo AI 351584448a deps: bump constants v1.5.2 + genesis v1.9.2; LocalID/CustomID split
luxfi/constants and luxfi/genesis just split LocalID and CustomID
into distinct constants:

  LocalID  = 1337   canonical local single/multi-node dev
  CustomID = 0      sentinel for user-defined non-well-known networks

This repo now uses LocalID everywhere it actually meant the local
dev network, and constants.LocalID for the same in places that
imported through luxfi/constants. Plus configs.LocalnetID →
configs.LocalID and configs.LocalnetChainID → configs.LocalChainID
to track the renamed constants.

Net effect on netrunner:

* NewLocalConfig          uses configs.LocalID (was configs.CustomID/1337)
* NewCanonicalCustomConfig uses configs.LocalID
* NewLocalConfigFromMnemonic uses configs.LocalID
* network/config.go default switch now lists LocalID alongside Mainnet/Testnet
* server/network.go default networkID set to LocalID for the local server

The Custom* constants remain available for genuine user-defined
networks; on those, addresses use the "custom" HRP from
luxfi/constants and look like P-custom1..., X-custom1...

zapwire (Z-Wing PQ control RPC) and network tests still green; the
heavy local/ integration tests that actually spawn luxd are out of
scope for this change.
2026-05-06 18:14:35 -07:00
Hanzo AI 0bb42a39c8 zapwire: enforce Z-Wing PQ for all netrunner control RPC
Replace plain TCP zap.Dial / zap.Listen with zwing.DialZAP /
zwing.ListenZAP. zapwire.Dial and zapwire.NewServer now require a
*zwing.Config carrying a LocalIdentity — there is no cleartext mode.
Every netrunner control connection is X-Wing-encapsulated,
ChaCha20-Poly1305-encrypted, and identity-pinned via Ed25519 +
ML-DSA-65 hybrid signatures.

Wire format and opcode set are unchanged; only the dial/listen
seams are upgraded. The 14 e2e tests are updated to mint ephemeral
identities per test (newTestRig) and pin the server side, which
also proves the handshake actually authenticates.

Pairs with luxfi/zwing v0.2.1 (DialZAP / ListenZAP) and luxfi/api
v1.0.10 (zap.NewListener).
2026-05-06 12:53:13 -07:00
Hanzo AI 02c01780dc feat(zapwire): WaitForHealthy over ZAP 2026-05-06 12:16:01 -07:00
Hanzo AI 52bdea0735 feat(zapwire): SendOutboundMessage over ZAP 2026-05-06 12:15:18 -07:00
Hanzo AI eac03f108e feat(zapwire): AttachPeer over ZAP 2026-05-06 12:14:31 -07:00
Hanzo AI 8c949d17fd feat(zapwire): ResumeNode over ZAP 2026-05-06 12:13:45 -07:00
Hanzo AI e84d3f598f feat(zapwire): PauseNode over ZAP 2026-05-06 12:13:01 -07:00
Hanzo AI 5991bab97b feat(zapwire): RestartNode over ZAP 2026-05-06 12:12:14 -07:00
Hanzo AI 310bcfb650 feat(zapwire): RemoveNode over ZAP 2026-05-06 12:11:24 -07:00
Hanzo AI 73d13edbab feat(zapwire): AddNode over ZAP 2026-05-06 12:10:41 -07:00
Hanzo AI cc0ec87089 feat(zapwire): Stop over ZAP 2026-05-06 12:09:22 -07:00
Hanzo AI 66a1a46075 feat(zapwire): native ZAP control RPC foundation — Ping/RPCVersion/Health/URIs/Status
100% native ZAP, no protobuf, no gRPC, no codegen. Hand-written Go
types in zapwire/types/ encode/decode against luxfi/api/zap.Buffer
and zap.Reader directly. Server dispatches via a single zap.Handler
that switches on opcode (and sub-opcode for fan-out via OpStart).

Opcodes 60..63 reserved for netrunner control. Sub-opcodes (under
OpStart) provide RPC fan-out without consuming the limited opcode
range. Default port: 9999.

Migration plan:
  Phase 1 (this commit): Ping, RPCVersion, Health, URIs, Status — 5
    of 26 control RPCs landed with full e2e test coverage
  Phase 2: lifecycle (Start, Stop, AddNode, RemoveNode, RestartNode,
    PauseNode, ResumeNode, AttachPeer, SendOutboundMessage)
  Phase 3: chain ops (CreateBlockchains, CreateChains, etc.)
  Phase 4: snapshots (Save/Load/Remove/GetSnapshotNames + Hot)
  Phase 5: streaming (StreamStatus over persistent ZAP conn)
  Phase 6: swap netrunner/client/client.go + cli callers, delete rpcpb

Tests: go test ./zapwire/... — 5 RPCs e2e, all green.
2026-05-06 10:37:19 -07:00
Hanzo AI a016d13e9d canonical: drop SubnetEVMTimestamp alias — single evmTimestamp field 2026-05-05 21:30:42 -07:00
Hanzo AI 56c3852b25 docs: scrub upstream 'Subnet-EVM' / 'subnet-evm' brand → Lux EVM 2026-05-05 20:26:30 -07:00
Hanzo AI d4daab154a netrunner/docs: annotate snow-sample-size as legacy alias 2026-05-05 19:14:48 -07:00
Hanzo AI 5a1ac1bac2 deps: zapdb v1.8.0, database v1.18.3 (drops zapdb v1.0.0 poisoned + v4 transitive) 2026-05-05 17:29:42 -07:00
Hanzo AI 92a33607f7 deps: update go.mod/go.sum 2026-04-19 17:04:56 -07:00
Hanzo AI 35f6be2b69 deps: luxfi/zapdb v4 → v1.0.0 (module path reset) 2026-04-11 00:05:19 -07:00
Hanzo AI f111e35834 ci: enable dual-arch (amd64+arm64) — AWS Graviton runners live 2026-04-09 23:17:44 -07:00
Hanzo AI ad41682a1d ci: amd64-only until ARM runners online 2026-04-09 22:43:02 -07:00
Hanzo AI 2d90806b3d ci: fix workflow job refs, use default shared runners 2026-04-09 22:37:04 -07:00
Hanzo AI 8f5c5a88cc ci: add universe dispatch on semver tag push 2026-04-09 22:30:35 -07:00
Hanzo AI 69860c26e7 ci: migrate to shared docker-build workflow (native multi-arch, semver) 2026-04-09 21:58:21 -07:00
Hanzo AI af90017cd2 fix: chaos tests compile — resolve geth/crypto import + type mismatches
- Replace github.com/luxfi/geth/crypto (nonexistent) with
  github.com/luxfi/crypto for HexToECDSA, GenerateKey, S256, Sign, FromECDSA
- Use common.PubkeyToAddress and common.Keccak256 (geth/common wrappers)
  to avoid Address type mismatch between crypto/common and geth/common
- Fix log.NewWrappedCore (nonexistent) to log.New in consensus/dex tests
- Fix big.NewInt(1e19) overflow — 1e19 exceeds int64 max
- Fix toCallMsg returning interface{} instead of ethereum.CallMsg
- Add missing ethereum import in dex_chaos_test.go

Verified: go vet -tags chaos ./tests/ && go vet -tags gpu_chaos ./tests/
2026-04-07 09:03:09 -07:00
Hanzo AI af13dfac52 test: GPU EVM Block-STM chaos tests (8 parallel execution scenarios)
Fix compilation of gpu_evm_chaos_test.go by using proper ethereum.CallMsg
type from luxfi/geth root package for eth_call operations. All 8 tests
compile and list correctly with -tags gpu_chaos.

Tests: WriteConflict, ReadWriteSerializability, ECRecoverBatch,
Keccak256Batch, CrashMidBlock, MemoryPressure, StateRootConsistency,
PrecompileBatchVerify.
2026-04-07 01:26:03 -07:00
Hanzo AI a9aeb74c67 test: Jepsen-style chaos tests — bridge, DEX, Quasar consensus, GPU EVM
32 fault injection scenarios:

Bridge (8): nonce linearizability, MPC partition, batch atomicity,
  auto-pause under partition, clock skew rotation, double-spend nonce,
  exit guarantee during chaos, backing ratio hysteresis

DEX (8): swap atomicity, k=xy invariant under partition, TWAP resistance,
  concurrent swaps, StableSwap convergence, batch LP mint during reorg,
  fee split consistency, cross-pool arbitrage convergence

Quasar Consensus (8): partition recovery, byzantine fault detection,
  finality under load, validator rotation, clock skew, network jitter,
  double vote slashing, chain reorg recovery

GPU EVM Block-STM (8): write conflict resolution, read-write serializability,
  ecrecover batch correctness, keccak256 batch consistency, crash fallback
  to CPU, memory pressure degradation, state root determinism, precompile
  batch verify (FROST + CGGMP21 + BLS)
2026-04-07 01:24:52 -07:00
Hanzo AI 6cde3ea75c test: Jepsen-style chaos tests for Teleport bridge (8 fault injection scenarios)
Adds bridge_chaos_test.go with comprehensive fault injection tests for
the Teleporter bridge contract's safety invariants:

1. NonceLinearizability - concurrent nonce submission, exactly-once
2. PartitionedMPCSigner - oracle revocation/rejoin during partition
3. CrashDuringBatchMint - kill node mid-batch, verify no corruption
4. AutoPauseUnderPartition - insufficient backing triggers sticky pause
5. SignerRotationClockSkew - timestamp monotonicity enforcement
6. DoubleSpendNonce - concurrent same-nonce, exactly one succeeds
7. ExitGuaranteeDuringChaos - withdraw counter continuity across state
8. BackingRatioHysteresis - oscillating backing, sticky auto-pause

Tests deploy a TestTeleporter (mirrors production Teleporter.sol safety
invariants) to anvil and inject faults via process kill, concurrent
goroutines, and state manipulation. Gated behind -tags chaos.
2026-04-07 01:23:34 -07:00
Hanzo AI eb55f7d5c8 chore: symlink AGENTS.md + CLAUDE.md → LLM.md 2026-04-06 15:12:56 -07:00
Hanzo AI 6b066f9dd4 dep: bump github.com/luxfi/genesis v1.7.1 2026-04-04 11:34:33 -07:00
Hanzo AI 78a1faa5c7 dep: bump utxo v0.2.4→v0.2.5 (BCLookup in ParseAddress) 2026-04-01 17:14:21 -07:00
Hanzo AI 36f2919975 fix: LUX_MNEMONIC → MNEMONIC (generic env var) 2026-04-01 15:18:26 -07:00
Hanzo AI dab6ea2adf docs: replace subnet terminology with chain/L2 2026-03-29 12:15:56 -07:00