Wave 2A of the codec rip (#101). Eliminates github.com/luxfi/codec imports from the api/, warp/, warp/message/, and warp/payload/ subtrees of proto/p. * api/{height,staking}.go now use github.com/luxfi/node/utils/json instead of github.com/luxfi/codec/jsonrpc — same byte format, no transitive codec dependency. * warp/codec.go, warp/payload/codec.go, warp/message/codec.go each define a local Codec / Registry interface (structurally identical to codec.Manager / codec.Registry) and a RegisterTypes(r) function. The package-level Codec singleton is gone — every Parse*, New*, *.Initialize, TeleportMessage.{ToWarpMessage,DecryptPayload}, TeleportTransferPayload. Bytes and ParseTransferPayload now take a Codec parameter and the caller threads it through. * proto/internal/pcodectest is the canonical test wiring (mirrors proto/internal/xcodectest from Wave 1A). It exposes NewPayloadCodec, NewMessageCodec, and NewWarpCodec — each constructs a linearcodec- backed codec.Manager with the appropriate types pre-registered. * In-package warp tests converted to `package warp_test` to avoid the cycle pcodectest → warp → warp/*_test.go → pcodectest. warp's prod `test_helpers.go` was renamed to `_test.go` (it was already test-only in spirit) and unexported helpers stay unexported in `warp_test`. The dead `test_signer_test.go` (//go:build test, unused) was removed. * No backwards-compat shim. No deprecated alias. proto/p/api/warp/* is now byte-compatible with the legacy wire format but constructs its codec dependency externally. Cascade breaks (Wave 2D territory, not fixed here): sdk/wallet/chain/p/wallet/backend_visitor.go — warp.ParseMessage, payload.ParseAddressedCall now require Codec sdk/validatormanager/root.go — payload.* calls need Codec vm/rpc/{,dag/,chain/}warp_adapter.go — warp.* calls need Codec Grep zero confirmation under the subtrees migrated: proto/p/api/ — no codec import proto/p/warp/, proto/p/warp/message/, proto/p/warp/payload/ — no codec import (signertest subpackage also clean)
luxfi/proto
Canonical schema definitions for the Lux platform. Module path is
github.com/luxfi/proto — the directory now matches (was protocol/).
Layout: ZAP + gRPC side-by-side, 1:1
Same package paths under both zap/ and pb/ (or in files suffixed
_zap.go and _pb.go for thin packages). The Go build picks one
or the other based on the build tag:
| Default (no tag) | -tags grpc |
|---|---|
zap/<pkg>/*_zap.go (//go:build !grpc) |
pb/<pkg>/*_pb.go (//go:build grpc) |
| ZAP-native types + codecs | protobuf-generated types + codecs |
Zero google.golang.org/grpc in dep graph |
Includes google.golang.org/grpc |
ZAP is the canonical wire. The protobuf path exists only for external integrations that mandate OTLP-over-gRPC. Internal Lux services use ZAP exclusively.
Consolidation policy
New schemas land here. This directory is the single source of
truth for any cross-package wire definition. The scattered per-repo
proto/ subdirs (see below) are legacy — they should migrate into
this module when the natural rewrite happens.
Existing scattered locations (do not add to them):
| Path | Status |
|---|---|
~/work/lux/p2p/proto/{zap,pb,p2p}/ |
legacy — to migrate |
~/work/lux/node/proto/zap/ |
legacy — to migrate |
~/work/lux/vm/proto/pb/ |
legacy — to migrate |
~/work/lux/api/schema/proto/ |
legacy — to migrate |
Migration cost is one import-path bump per consumer. Not blocking — fold in as those packages are touched for unrelated reasons.
Hanzo mirror
~/work/hanzo/proto follows the same pattern for the Hanzo platform.
See hanzoai/proto README.