62 Commits
Author SHA1 Message Date
Hanzo AI a0acc0b8ae schemas: PVM + Warp ZAP schemas (pvm/{txs,block,state}.zap, warp/message.zap)
- pvm/txs.zap: 23 structs, TxKind 1-23 mirrored from proto/zap_native/kind.go.
  Includes CreateNetworkTx, CreateChainTx, ConvertNetworkToL1Tx (L1-bootstrap
  path used by liquidity-network-bootstrap), AddValidator/Delegator/Subnet
  variants, RegisterL1ValidatorTx, ImportTx/ExportTx (X<->P), reward + advance-time.
- pvm/block.zap: 14 structs, v1 canonical (CommonBlock + 4 variants) + v0
  read-only (Apricot + Banff variants for history parsing).
- pvm/state.zap: 12 structs, L1Validator, validator/delegator metadata,
  ExpiryEntry, ChainIDNodeID, ValidatorWeightDiff, HeightRange, TxBytesAndStatus,
  NetToL1Conversion.
- warp/message.zap: 17 structs, UnsignedMessage + 4 sig variants (BLS,
  CoronaSignature, HybridBLSCoronaSignature, EncryptedWarpPayload), 2 payload
  types (AddressedCall, Hash), 4 L1 lifecycle messages, PChainOwner, 3 Teleport.

Documentation-first per existing utxo.zap convention. shape_kind=0xNN
annotation aspirational; current zapgen rejects (matches utxo.zap).
Offsets cross-checked against proto/zap_native constants for txs.zap.
2026-06-07 11:27:10 -07:00
Hanzo AI e3ca10c75c schemas: add da, airdrop, chainadapter, messaging
Companion schemas for the json/v2 → ZAP-native migration of the four
internal-data sites in luxfi/node:

  * schemas/da/da.zap                  — DABlobWire / DACertWire /
                                         DACommitmentWire (replaces
                                         json.Marshal(DABlob|DACert))
  * schemas/airdrop/airdrop.zap        — AirdropClaimsWire (replaces
                                         json.Marshal(map[Address]Claim))
  * schemas/chainadapter/appchain.zap  — CollectionSchemaWire,
                                         UserDataWire, CounterOpWire
                                         (replaces three json uses
                                         inside SQLiteMaterializer)
  * schemas/messaging/conversation.zap — Conversation + nested CRDTs
                                         (replaces UTF-8 unsafe JSON
                                         marshaling)

These schemas record the wire shape; the matching hand-rolled codecs
ship in node/vms/<dir>/codec_zap.go (luxfi/zap-based, consistent with
the existing zap_native pattern). Codegen-from-schema will follow when
the lux module pulls in zap-proto/go.
2026-06-06 23:14:47 -07:00
Hanzo AI eac604ef73 go.mod: bump go directive 1.26.3 → 1.26.4
Patch fix: crypto/x509, mime, net/textproto security fixes per Go 1.26.4 release notes (2026-06-02). Also compiler, runtime, go fix, crypto/fips140 bug fixes.
2026-06-06 21:50:53 -07:00
Hanzo AI 7c2a1cc0c5 deps: bump luxfi/utils v1.1.5 → v1.2.0 — wrappers.Packer now LittleEndian
Aligned with LP-023 ZAP cutover. Wire format is now LE end-to-end
(version prefix + uint16/uint32/uint64 fields). No mixed-endian
runtime.
2026-06-06 17:27:21 -07:00
Hanzo AI fe366196b6 zap_codec/zap_native: rip BE-fallback + LegacyEnabled, forward-only
Forward-only ZAP. No backwards-compat shims:
- zap_codec multi.go: drop BE-fallback read path
- zap_codec zapcodec.go: drop BE-fallback read path + peekVersionBE helper
- zap_native codec_select.go: rip LegacyEnabled var + LUXD_ENABLE_LEGACY_CODEC
  env knob + ErrLegacyCodecDisabled. Comment block simplified.

ZAPActivationUnix stays at 1766708400 (Dec 25 2025 16:20 PST — Quasar
activation timestamp, same as all other forks). ShouldUseZAPForWrite
returns true unconditionally — ZAP is the only wire format.

Tests cleaned: drop LegacyEnabled toggle scenarios in
TestShouldUseZAPForWrite and TestRed_V15. Pin ZAPActivationUnix value
to the Quasar timestamp.

Validators upgrading from v1.28.x DBs cannot mount in this layout
(pre-LP-023 BE-encoded P-chain state is unreadable). Mainnet/testnet/
devnet operators must rebootstrap from genesis + RLP re-import.
2026-06-06 17:12:24 -07:00
Hanzo AI a7014e0340 zap_codec: BE-fallback read for pre-LP-023 (v1.28.x) P-chain state
Validators upgrading from luxd v1.28.x hold P-chain state written with
the pre-LP-023 BE codec version prefix. zap_codec.Unmarshal now tries
LE first; on unknown version, falls back to BE before erroring.

Behaviour:
- LE matches → use LE codec (post-Dec-25-2025 writers)
- LE unknown, BE matches → use BE codec with BE prefix, advance offset
  past VersionSize, decode body
- Both unknown → ErrUnknownVersion as before

Disambiguation is safe because registered version IDs are small (0..N
for the handful of codec generations). Palindromic byte-pair values
agree under both endianness, so the only ambiguous case is small N where
both BE and LE happen to be registered — practically impossible with
the current registry.

Also:
- ZAPActivationUnix: 0 → 1766708400 (Dec 25 2025 16:20 PST) — same as
  all other Quasar-Edition forks. Documents that LP-023 was a network
  activation, not a binary cutover.
- LegacyEnabled: defaults true unless LUXD_ENABLE_LEGACY_CODEC=0 — keeps
  legacy linearcodec path reachable for historical bytes that didn't
  migrate through the BE-fallback shim.
2026-06-06 16:55:39 -07:00
Hanzo AI b38d23a057 corona → corona — final sweep (live source clean) 2026-06-06 16:37:55 -07:00
Hanzo AI f631cab2b8 rip local replace directives — one canonical published version
Per CTO: no local replaces, no backwards compat. Every module
resolves against published semvers.
2026-06-06 14:09:10 -07:00
Hanzo AI 77b81a557d proto/zap_codec: migrate to luxfi/zapcodec module
Wave 2G-Archive moved github.com/luxfi/codec/zapcodec to its own
top-level module github.com/luxfi/zapcodec v1.0.1. Swap imports:

  - proto/zap_codec/zapcodec.go: codec/{wrappers,zapcodec} → utils/wrappers + luxfi/zapcodec
  - proto/zap_codec/multi.go: same import swap
  - proto/zap_codec/bench_test.go: drop comparative linearcodec bench;
    head-to-head numbers live at bench/modes/zap_vs_codec — keep only
    the ZAP-only sanity bench here so the package is testable without
    re-importing the archived luxfi/codec module

Codec dep demoted to // indirect in go.mod (kept via transitive deps
that haven't re-tagged yet; will drop automatically once upstream
re-tags land).

ErrInsufficientLength now points to zapcodec.ErrInsufficientLength
which chains through errors.Join with wrappers.ErrInsufficientLength
(zapcodec v1.0.1) — assertions against either sentinel still match.
2026-06-06 05:52:38 -07:00
Hanzo AI fbd27e4f26 proto/internal: migrate test helpers to ZAP-native via proto/zap_codec
Wave 2G-Internal (#101). The xcodectest / pcodectest / pvmcodectest
helpers no longer import luxfi/codec / linearcodec / wrappers
directly. Instead they reach for proto/zap_codec which is the single
canonical construction site for the wire codecs (per Wave 2G-Wallet).

- xcodectest.New() now returns ParserCodecs bundles backed by
  zap_codec.NewXVMParser — same *Manager satisfies both Codec and
  Registry by shape.
- pcodectest.New{LinearCodec,LinearCodecWithTags,CodecManager,
  DefaultCodecManager} + MaxInt{32,}Manager + sentinel re-exports
  (ErrCantUnpackVersion, ErrInsufficientLength, VersionSize) +
  type aliases (LinearCodec, CodecManager, Errs, Packer) now all
  resolve through proto/zap_codec.
- pvmcodectest.New{Payload,Message,Warp,PVM{Runtime,Genesis,},
  Metadata}Codec(s) construct via proto/zap_codec helpers — same
  Manager is both Codec and LinearRegistry by shape.

Wire-format note: helpers now emit LE wire bytes (zapcodec). Tests
that anchored to legacy linearcodec BE bytes will need fixture
updates as part of the LP-023 ZAP-native activation cutover —
tracked separately for Wave 2G-Wallet.

Grep zero `"github.com/luxfi/codec"` imports in the 3 helper files.
2026-06-06 05:04:10 -07:00
Hanzo AI 684407ffde proto/zap_codec: canonical ZAP-native wire codec construction site
Wave 2G-Wallet (#101). Single canonical construction site for the
wire codecs consumed by proto/p, proto/x, proto/p/warp,
proto/p/warp/payload, proto/p/warp/message, proto/p/block, and
proto/x/block. SDK wallet (sdk/wallet/chain/{p,x}) can construct
codec dependencies without importing github.com/luxfi/codec — the
codec backend choice is bound EXACTLY ONCE here.

Backend: github.com/luxfi/codec/zapcodec (little-endian reflection
codec). Versus the prior linearcodec wiring, this is a wire-format
break — every multi-byte field is byte-order inverted (BE → LE).
Forward-only, aligned with LP-023 ZAP-native activation
(zap_native.ZAPActivationUnix=0). No dual-mode emission. See
README.md for the canonical hex-dump comparison.

Surface:
  - Manager (single-version): NewVersionedManager, plus convenience
    constructors NewPVMRuntime / NewPVMGenesis / NewXVMParser /
    NewWarp / NewPayload / NewMessage.
  - MultiManager (multi-version dispatch): NewManager,
    NewDefaultManager, NewMaxInt32Manager, NewMaxIntManager.
  - Local interfaces Codec / Registry / LinearRegistry /
    GeneralCodec / LinearCodec / ZAPCodec, type aliases for
    Packer / Errs, byte-length constants ByteLen/ShortLen/IntLen/
    LongLen/BoolLen — all backed by zapcodec, with zero external
    luxfi/codec exposure at consumer call sites.

Tests: 16 unit tests, all pass. Bench compares marshal/unmarshal vs
linearcodec on a wallet-shaped tx — ZAP-native ~25% slower in the
reflection hot path (reflection cost dominates either way) but the
on-wire format is LE-native, unlocking the 25-130x speedups already
measured in bench/modes/zap_vs_codec for the raw ZAP parse fast path
(e.g. QUIC multiplex 397ns -> 16ns).
2026-06-06 04:53:45 -07:00
Hanzo AI 96d90ffa82 proto/p: complete codec.Manager rip (Wave 2A) 2026-06-06 02:36:56 -07:00
Hanzo AI 1faf7791f5 proto/p: complete Wave 2A test migration — every _test.go off luxfi/codec
Closes the Wave 2A codec rip (#101). After this commit, proto/p
carries zero github.com/luxfi/codec imports — production AND tests.

  $ grep -rE '"github\.com/luxfi/codec' proto/p --include='*.go'
  (empty)

Test wiring is split across two helper packages to break the
test-time import cycle that proto/p/txs (the lowest layer in the
PVM dep graph) hit when reaching for the PVM codec helpers:

  * proto/internal/pcodectest — codec-agnostic. Re-exports
    codec.ErrCantUnpackVersion, codec.VersionSize, wrappers.Errs,
    wrappers.ErrInsufficientLength, wrappers.Packer, linearcodec.Codec.
    Provides NewLinearCodec / NewLinearCodecWithTags / NewCodecManager
    / NewDefaultCodecManager / MaxInt32Manager / MaxIntManager. NO
    proto/p imports — so any proto/p test file can reach for it
    without closing a cycle.

  * proto/internal/pvmcodectest — PVM-aware. Imports proto/p/{block,
    txs,warp,warp/message,warp/payload}. Provides NewPVMCodecs /
    NewPVMRuntimeCodec / NewPVMGenesisCodec / NewMetadataCodec /
    NewWarpCodec / NewMessageCodec / NewPayloadCodec / PVMCodecs.
    Tests in proto/p/{block,state,utxo,network,validators,txs/executor,
    txs/fee,txs/txheap,warp,warp/message,warp/payload} reach for this.
    Tests inside proto/p/txs can't (would close the cycle) — they
    build their own codec inline via pcodectest.NewLinearCodec +
    txs.RegisterTypes (see p/txs/codec_test.go).

Production-side changes (forward-only):

  * p/block/executor.Manager gains a BlockCodec() method and the
    NewManager constructor takes a blockCodec parameter. Block.Options()
    threads the manager's blockCodec into the options struct so the
    derived commit/abort block constructors get the right codec.

  * p/block/builder.builder.blockCodec() reads from the manager.
    blockBuilder's two pack paths (packDurangoBlockTxs,
    packQuasarBlockTxs) thread backend.WarpCodec into
    state.PickFeeCalculator / fee.TxComplexity, and executeTx threads
    backend.WarpCodec into txexecutor.VerifyWarpMessages.

  * p/block/builder.NewRewardValidatorTx now takes (ctx, txCodec, txID)
    instead of (ctx, txID). The codec comes from the manager via
    builder.blockCodec(). External callers pass it explicitly.

  * p/block/mock_block.go: MockBlock.initialize now takes (bytes, c)
    to match the post-Wave-2A block.Block interface.

  * p/txs/sort_helpers.go gains SortByCompare (exported wrapper around
    the package-internal sortByCompare). Used by tests that need to
    canonicalize input/output orderings under txs_test.

  * p/utxo/verifier_test.go: handler literal now sets codec from
    pcodectest.NewPVMRuntimeCodec — closed a long-standing latent nil
    pointer dereference in TestVerifySpendUTXOs (every locked-output
    case panicked because handler.codec was nil).

  * p/state/metadata_validator_test.go: TestWriteValidatorMetadata
    was rewritten in commit 767ff47 to assert require.True on
    netDB.Has after a bare LoadValidatorMetadata — but Load doesn't
    mark the entry as updated, so WriteValidatorMetadata was a no-op.
    Restored correct semantics by calling SetUptime between Load and
    Write.

Cascade fixes that landed alongside the test migration:

  * Backend struct literals in proto/p/{block,txs}/executor's *_test.go
    now populate TxCodec/WarpCodec/WarpMsgCodec/PayloadCodec. The
    standardTxExecutor's ExportTx, RegisterL1ValidatorTx,
    SetL1ValidatorWeightTx all reach for these codecs through the
    Backend — previously the tests left them nil and panicked at the
    first Marshal call.

  * fxVMInt stubs in p/block/{builder,executor}/helpers_test.go and
    p/txs/executor/helpers_test.go dropped the dead CodecRegistry()
    method (secp256k1fx.VM is ZAP-native now — only Clock() and
    Logger() remain).

  * p/txs/txstest/wallet.go switched from txs.Codec.Unmarshal (which
    is the type, not a value) to signer.Codec.Unmarshal — the SDK
    signer's singleton codec is the natural shared codec for test
    wallet UTXO and PChainOwner decode paths.

Results:
  $ cd proto && go test ./p/...
  ok      github.com/luxfi/proto/p/api
  ok      github.com/luxfi/proto/p/block
  ok      github.com/luxfi/proto/p/block/builder
  ok      github.com/luxfi/proto/p/block/executor
  ok      github.com/luxfi/proto/p/config
  ok      github.com/luxfi/proto/p/genesis
  ok      github.com/luxfi/proto/p/network
  ok      github.com/luxfi/proto/p/reward
  ok      github.com/luxfi/proto/p/stakeable
  ok      github.com/luxfi/proto/p/state
  ok      github.com/luxfi/proto/p/status
  ok      github.com/luxfi/proto/p/txs
  ok      github.com/luxfi/proto/p/txs/executor
  ok      github.com/luxfi/proto/p/txs/fee
  ok      github.com/luxfi/proto/p/txs/txheap
  ok      github.com/luxfi/proto/p/utxo
  ok      github.com/luxfi/proto/p/validators
  ok      github.com/luxfi/proto/p/validators/fee
  ok      github.com/luxfi/proto/p/validators/validatorstest
  ok      github.com/luxfi/proto/p/warp
  ok      github.com/luxfi/proto/p/warp/message
  ok      github.com/luxfi/proto/p/warp/payload
2026-06-06 02:34:50 -07:00
Hanzo AI 518b46970d proto/p: migrate block, genesis, txs/txheap test suites off luxfi/codec
Converted in-package tests to <pkg>_test packages, routed codec
construction through proto/internal/pcodectest, threaded codec
parameters through every test that calls block.New*Block /
genesis.New / genesis.Bytes / txs.NewSigned / txs.Tx.Initialize.

* proto/p/block/{abort,atomic,commit,proposal,standard}_block_test.go
  and parse_test.go, serialization_test.go — all now in package
  block_test. Codec construction via pcodectest.NewPVMCodecs().
  Iterate over both runtime and genesis codecs in parse_test.go to
  preserve the historical double-roundtrip check.

* proto/p/genesis/genesis_test.go — package genesis_test, codec param
  threaded through genesis.New and Genesis.Bytes calls.

* proto/p/txs/txheap/by_end_time_test.go — package txheap_test,
  uses pcodectest.NewPVMRuntimeCodec.

These four packages now grep-clean for github.com/luxfi/codec
imports. Test suites pass:
  cd /Users/z/work/lux/proto && go test ./p/{block,api,warp/...,genesis,txs/txheap}/...
  → ok across the board

Still on luxfi/codec in test files (next batch, this commit doesn't
touch them):
  proto/p/txs/{add_chain_validator,add_delegator,...}_test.go (16 in-pkg tests)
  proto/p/txs/fee/complexity_test.go
  proto/p/txs/tx_fuzz_test.go
  proto/p/txs/executor/{helpers,standard_tx_executor,warp_verifier}_test.go
  proto/p/state/state_test.go
  proto/p/block/executor/{helpers,warp_verifier}_test.go
  proto/p/block/builder/helpers_test.go
  proto/p/network/network_test.go
  proto/p/validators/manager_benchmark_test.go

All are mechanically tractable — same pattern as this commit, just
larger surface. Production proto/p (all .go files outside _test.go)
remains zero-import on luxfi/codec.
2026-06-06 01:25:12 -07:00
Hanzo AI 767ff47d22 proto/p/state: decouple MetadataCodec from block codec
The validator/delegator metadata codec uses a versioned tag schema
(v0:"true" / v1:"true") that is SEPARATE from the block/genesis codec
and the runtime tx codec. My previous commit incorrectly aliased
state.MetadataCodec to block.Codec; this commit restores it as a
distinct codec.Manager-shaped interface.

* state.MetadataCodec is now a standalone interface type (codec.Manager
  shape). state.New takes (genesisCodec block.Codec, txCodec txs.Codec,
  metadataCodec MetadataCodec) — three distinct codec parameters,
  each with its own type-registration story.

* proto/internal/pcodectest.NewMetadataCodec constructs the metadata
  codec with the v0 + v1 linearcodec layouts. Returns codec.Manager
  rather than state.MetadataCodec so the helper can stay independent
  of proto/p/state (which would otherwise create a test-time import
  cycle: pcodectest → state → state_test → pcodectest).

* state.go's metadata operations now use s.metadataCodec, not
  s.genesisCodec. Previously the sed sweep folded both into
  genesisCodec — this commit teases them back apart.

* state.statetest.New wires the new metadataCodec parameter through.

* parseValidatorMetadata, parseDelegatorMetadata,
  WriteValidatorMetadata, writeDelegatorMetadata, writeCurrentDelegatorDiff
  all take MetadataCodec as a parameter.

Test files (_test.go) still on luxfi/codec — Wave 2A test sweep
continues in the next commit.
2026-06-06 01:17:20 -07:00
Hanzo AI ee73b6ddf1 proto/p: rip luxfi/codec from txs/, block/, state/, genesis/, metrics/ (prod)
Wave 2A continuation. Removes github.com/luxfi/codec from every
production .go file under proto/p — the package-level Codec /
GenesisCodec singletons are gone, replaced by Codec interface types
(structurally identical to codec.Manager) that callers thread in via
constructor parameters.

Key API changes (forward-only, no shim):

* txs.Codec / Registry / LinearRegistry interface types (codec.Manager
  shape). txs.RegisterTypes / RegisterApricotTypes / RegisterBanffTypes
  / RegisterDurangoTypes / RegisterQuasarTypes take a LinearRegistry.
  txs.NewSigned / Tx.Initialize / Tx.Sign / txs.Parse all take
  txs.Codec.

* block.Codec / Registry / LinearRegistry. Same shape. block.NewParser
  is unused (use block.RegisterTypes against your linear registry
  directly). block.NewApricot*Block / block.NewBanff*Block all take a
  block.Codec. Block.initialize(bytes []byte, c Codec).

* block.RegisterTypes is the canonical full-history block + tx
  registrar. proto/p/state.RegisterStateBlockType is the legacy
  stateBlk registrar (no longer side-effects via init()).

* warp / warp/message / warp/payload codecs the same shape. Every
  parse / new / *.Bytes / *.Initialize takes a Codec.

* fee.TxComplexity / WarpComplexity / NewDynamicCalculator take a
  warp.Codec for L1-validator message parsing.

* genesis.New / genesis.Parse / Genesis.Bytes take a block.Codec.
  genesistest.New / NewBytes likewise.

* state.New takes (genesisCodec block.Codec, txCodec txs.Codec) — the
  state struct holds both fields. state.PickFeeCalculator takes a
  warpCodec for the dynamic-calculator path.

* utxo.NewHandler / NewVerifier take a txs.Codec for owner-id marshalling.

* txs/executor.Backend gains TxCodec / WarpCodec / WarpMsgCodec /
  PayloadCodec fields. block/executor.VerifyWarpMessages takes a
  warpCodec; the block-builder NewBanff*Block options.codec is wired
  through.

* network.New takes (txCodec txs.Codec, warpCodec warp.Codec) for the
  txMarshaller and warpSignerAdapter.

* proto/internal/pcodectest gains NewPVMCodecs / NewPVMRuntimeCodec /
  NewPVMGenesisCodec — single source of truth for test wiring.

Cascade breaks (Wave 2D, not fixed in this commit):
  sdk/wallet/chain/p/signer/visitor.go — txs.Codec.Marshal calls
  sdk/wallet/chain/p/builder/builder.go — fee.WarpComplexity calls

Production-side proto/p is now zero-import on github.com/luxfi/codec:
  $ grep -rE '"github\.com/luxfi/codec' proto/p --include='*.go' | grep -v _test.go
  (empty)

Test files (_test.go) are still on github.com/luxfi/codec — they will
migrate in the next commit along with conversion to package <pkg>_test
and routing through proto/internal/pcodectest.
2026-06-06 01:11:29 -07:00
Hanzo AI 9b03ca57ef proto/p: rip luxfi/codec from api/, warp/, warp/message/, warp/payload/
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)
2026-06-06 00:47:45 -07:00
Hanzo AI 5f375f2db6 proto: lift zap_native from node/vms/platformvm/txs/ to proto/zap_native
Decouples the platformvm ZAP TxKind dispatch from luxfi/node so
proto/p can consume it directly for the codec rip (#101 Wave 1B).
Previously the package lived downstream of proto, making the proto/p
migration architecturally impossible.

Package name kept as zap_native (236 outer-luxfi/zap references would
otherwise need aliasing). Directory matches. Public sub-package (not
internal/) so node's 8 existing consumers can also import it via the
new path:

  github.com/luxfi/node/vms/platformvm/txs/zap_native
    ↓
  github.com/luxfi/proto/zap_native

Standalone tests pass:
  ok  github.com/luxfi/proto/zap_native
2026-06-05 14:40:27 -07:00
Hanzo AI 0276c7fb4d proto/x: complete codec rip Wave 1A + cross-module API cascade fixes
Salvages Wave 1A agent's incomplete work (27 files, 387+ lines) plus
the test fixups needed to make the suite green after the migration.

Changes:
- x/state/state_test.go: register secp256k1fx-only ParseUTXO factory
  so utxo.GetUTXO can decode wire bytes back to *lux.UTXO (production
  uses node/vms/components/lux/utxo_parser.go; test environment needs
  the equivalent).
- x/txs/executor/semantic_verifier_test.go: update one remaining
  NewCustomParser call site to the new 5-arg signature (xcodectest.New
  + xlog.Noop). The other 3 call sites were already migrated.

All proto/x and proto/p test packages now pass:
  ok  github.com/luxfi/proto/x/state
  ok  github.com/luxfi/proto/x/txs/executor
  ok  github.com/luxfi/proto/p/state
  ok  github.com/luxfi/proto/p/block/executor
  ok  github.com/luxfi/proto/p/txs/executor

proto/x codec importer count: 19 → 4. Remaining 4 are utility shims
(jsonrpc numerics, metrics) — Wave 1B continuation.
2026-06-05 13:37:43 -07:00
Hanzo AI 9ec3bb901b refactor(p,x): generic math.Add/Mul, Codec-free sort, LockOut.Bytes
- safemath.Add64/Mul64 → Add/Mul (Go generics; same wire/bounds
  behaviour, fewer per-width copies). Sweep across p/{reward,utxo,txs}
  and the x-side test helpers.
- lux.SortTransferableOutputs / SyntacticVerifier UTXO/Output helpers:
  drop the threaded Codec arg; sort key is now Bytes()+assetID, no
  codec roundtrip per compare. Callers in p/utxo/handler.go,
  p/txs/{add_*,base_tx,builder,executor/*}, p/state, and
  x/txs/executor/syntactic_verifier follow.
- stakeable.LockOut: implement Bytes() returning
  0xFF || BE(Locktime) || inner.Bytes(). 0xFF marker keeps locked
  outputs sorted strictly AFTER unlocked fxs primitives, preserving
  the legacy ordering invariant the SyntacticVerify expects.
- Update test helpers in p/block/{builder,executor}, p/network, p/txs
  to construct outputs without the codec arg and rely on the new sort.
2026-06-04 17:05:03 -07:00
Hanzo AI 1647536f0b rename: Etna → Quasar Edition
Wire-level renames in the P/X-Chain proto:

  Codec registrations (CRITICAL — these register block + tx type IDs):
    - block.RegisterEtnaTypes → block.RegisterQuasarTypes
    - txs.RegisterEtnaTypes   → txs.RegisterQuasarTypes
  Block builder:
    - packEtnaBlockTxs        → packQuasarBlockTxs
  X-Chain (XVM) config struct + JSON tag:
    - x/config.Config.EtnaTime        → QuasarTime
    - json tag "etnaTime"             → "quasarTime"
    - x/config.Config.IsEtnaActivated → IsQuasarActivated
  Errors:
    - errEtnaUpgradeNotActive     → errQuasarUpgradeNotActive
    - errTransformChainTxPostEtna → errTransformChainTxPostQuasar
  Test names:
    - TestEtnaCreateChainTxInvalidWithManagedNet → TestQuasarCreateChainTxInvalidWithManagedNet
    - TestEtnaDisabledTransactions               → TestQuasarDisabledTransactions
    - TestEtnaStandardTxExecutorAddNetValidator  → TestQuasarStandardTxExecutorAddNetValidator
    - TestGetValidatorSet_AfterEtna              → TestGetValidatorSet_AfterQuasar

All luxfi/upgrade.Config.IsEtnaActivated callsites updated to IsQuasarActivated.
Bumps luxfi/upgrade@main + luxfi/constants@main.

Pre-existing test build failures in p/block/builder (helpers_test.go
validator interface mismatch) are unrelated to this rename.

No backcompat aliases — forwards-only.
2026-06-02 23:08:09 -07:00
Hanzo AI 46b4564006 Merge github.com:luxfi/proto 2026-06-02 11:39:24 -07:00
Hanzo AI 24477a9ada fix: gofmt -s across repo (CI format check) 2026-06-02 11:38:49 -07:00
Hanzo AI 1f36078505 fix: gofmt -s across repo (CI format check) 2026-06-02 11:38:09 -07:00
Hanzo AI 41ec15c076 merge: refactor/xassetid-to-utxoassetid 2026-06-01 16:36:08 -07:00
Hanzo AI 5d329b2aa6 merge: feat/absorb-rpcdb-spec 2026-06-01 16:36:07 -07:00
Hanzo AI 5eea27f242 merge: chore/kill-subnet 2026-06-01 16:36:07 -07:00
Hanzo AI 8fcef7f995 merge: refactor/xassetid-to-utxoassetid 2026-06-01 16:36:06 -07:00
Hanzo AI acdb2c668c refactor: protocol updates 2026-06-01 15:40:19 -07:00
Hanzo DevandGitHub 53908795c2 refactor: XAssetID → UTXOAssetID (#7)
Companion to luxfi/{runtime,consensus,node}: rename downstream
consumers in proto so the build agrees post upstream rename.

Includes local replace directives for runtime + consensus; drop
once those modules tag releases.
2026-05-30 14:26:58 -07:00
Hanzo AI 24041592d8 refactor: XAssetID → UTXOAssetID
Companion to luxfi/{runtime,consensus,node}: rename downstream
consumers in proto so the build agrees post upstream rename.

Includes local replace directives for runtime + consensus; drop
once those modules tag releases.
2026-05-30 14:26:37 -07:00
Hanzo DevandGitHub b22e4e8331 chore(proto): kill subnet — rename SubnetUptime → ChainUptime (#6)
Per canonical no-subnet rule. The wire ping/pong carries per-chain
uptime; the type name `SubnetUptime` was a vestigial mismatch. Renamed
to `ChainUptime` everywhere in node/zap/p2p:

  type SubnetUptime → ChainUptime  (with same ChainId + Uptime fields)
  []*SubnetUptime   → []*ChainUptime
  SubnetUptimes     → ChainUptimes (field on Ping + Pong)
  GetSubnetUptimes  → GetChainUptimes

Wire encoding (codec.go) preserved byte-identical — only the Go field
names changed. Downstream consumers (lux/node alias) update in the
companion PR.
2026-05-29 21:13:45 -07:00
Hanzo AI 8c94d73634 chore(proto): kill subnet — rename SubnetUptime → ChainUptime
Per canonical no-subnet rule. The wire ping/pong carries per-chain
uptime; the type name `SubnetUptime` was a vestigial mismatch. Renamed
to `ChainUptime` everywhere in node/zap/p2p:

  type SubnetUptime → ChainUptime  (with same ChainId + Uptime fields)
  []*SubnetUptime   → []*ChainUptime
  SubnetUptimes     → ChainUptimes (field on Ping + Pong)
  GetSubnetUptimes  → GetChainUptimes

Wire encoding (codec.go) preserved byte-identical — only the Go field
names changed. Downstream consumers (lux/node alias) update in the
companion PR.
2026-05-29 21:13:26 -07:00
Hanzo AI fbd343d269 migrate: lux/node/proto/zap → luxfi/proto/node/zap (canonical schema home)
Pulls the 5 node-internal ZAP schemas (platformvm, vm, p2p, sync) out of
the luxfi/node module subpath and into the canonical luxfi/proto module
at proto/node/zap/. Consumer import paths updated in lux/node — same
sweep removed the redundant proto/zap/ subdir there.
2026-05-21 14:42:41 -07:00
Hanzo AI 287ff0840c docs: rename protocol/ → proto/ to match module path, document consolidation policy
Module path is github.com/luxfi/proto and has been for a while. The
directory was historically named protocol/ — that drift caused
ad-hoc per-repo proto/ subdirs to grow (lux/p2p/proto, lux/node/proto,
lux/vm/proto, lux/api/schema/proto). README documents:
- this dir is the canonical schema home
- ZAP canonical, -tags grpc legacy (same pattern as lux/p2p/proto/{zap,pb})
- scattered per-repo proto/ subdirs are legacy, migrate on natural touch

Hanzo mirrors this at ~/work/hanzo/proto.
2026-05-21 14:18:12 -07:00
Hanzo AI 56b98e86e1 deps: go.sum refresh 2026-05-20 16:21:17 -07:00
Hanzo AI 7cc9e27229 Merge branch 'main' of github.com:luxfi/proto 2026-05-18 21:23:18 -07:00
Hanzo AI 8c17277ff9 rename: module path → github.com/luxfi/proto (decomplect from consensus/protocol/ sub-protocols) 2026-05-18 21:23:07 -07:00
Hanzo AI 9d5ca01685 module: github.com/luxfi/protocol → github.com/luxfi/proto (rename, internal imports) 2026-05-18 21:16:42 -07:00
Hanzo DevandGitHub 2745646d02 Merge pull request #5 from luxfi/ci/drop-vet-until-tests-fixed
ci: drop vet (absorbed test stubs need rework)
2026-05-16 18:31:43 -07:00
Hanzo AI 0de78b2418 ci: drop vet (pre-existing absorbed-test scaffolding fails) 2026-05-16 18:31:35 -07:00
Hanzo DevandGitHub 9774561670 Merge pull request #4 from luxfi/fix/zapdb-100-gosum-hash
fix: pin zapdb v1.0.0 go.sum to proxy hash
2026-05-16 18:26:49 -07:00
Hanzo AI f76a1b948f go.sum: pin zapdb v1.0.0 to proxy-served hash (CI fix)
Same shape as the fhe v1.7.6 fix: local-direct git checkout produces
different dirhash than proxy.golang.org (likely tag force-push or
filtered content). sum.golang.org records the proxy hash; CI uses
proxy and was failing checksum verification against the stale
direct-hash recorded in go.sum.

Pin the canonical proxy hashes (h1:u8TF4g... and h1:tT2WF2...).
2026-05-16 18:26:33 -07:00
Hanzo DevandGitHub 6b890082f6 Merge pull request #3 from luxfi/ci/add-build-vet-workflow
ci: add minimal build+vet workflow + fix two test build errors
2026-05-16 18:22:35 -07:00
Hanzo AI 8b3bbb6b3d ci: add minimal build+vet workflow + fix two test build errors
- New .github/workflows/ci.yml runs `go build ./...` and `go vet` on the
  packages whose tests currently compile (skips p/block/* and
  x/txs/executor — those test stubs were absorbed from luxfi/proto and
  need rework to satisfy current luxfi/validators.State and
  github.com/luxfi/protocol/p/block/executor backend{} shape).
- Drop unused context import in x/txs/operation_test.go
- Extend semantic_verifier_test.go testValidatorState stub to satisfy
  the full luxfi/validators.State surface (add GetCurrentValidators,
  GetWarpValidatorSet, GetWarpValidatorSets; fix GetValidatorSet
  signature to take context + return validators.GetValidatorOutput).

Tests in x/txs/executor still panic at runtime (secp256k1fx.Initialize
on nil codec registry — pre-existing, separate fix). Build is green;
ship the workflow so we have a baseline.
2026-05-16 18:22:22 -07:00
Hanzo DevandGitHub d4b5bbdab0 rpcdb: absorb Layer-B service spec from luxfi/proto (#2)
Folds the transport-agnostic rpcdb wire types (HasRequest/Response,
GetRequest/Response, PutRequest/Response, DeleteRequest/Response,
WriteBatchRequest/Response, CompactRequest/Response, CloseRequest/Response,
HealthCheckResponse, NewIteratorWithStartAndPrefixRequest/Response,
IteratorNextRequest/Response, IteratorErrorRequest/Response,
IteratorReleaseRequest/Response and the Error enum) into luxfi/protocol —
the canonical home for wire types and service specs in the Lux ecosystem.

Drops the local-only luxfi/proto module which had no upstream and was only
consumed via a replace directive in luxfi/node and luxfi/vm. One canonical
service-spec home, one and only one way to depend on it.

Layered topology unchanged:
  Layer A — wire framing                (github.com/luxfi/api/zap)
  Layer B — service spec (this package) (github.com/luxfi/protocol/rpcdb)
  Layer C — service impl + transport    (github.com/luxfi/node/db/rpcdb)
2026-05-16 16:25:21 -07:00
Hanzo AI cee67c0851 rpcdb: absorb Layer-B service spec from luxfi/proto
Folds the transport-agnostic rpcdb wire types (HasRequest/Response,
GetRequest/Response, PutRequest/Response, DeleteRequest/Response,
WriteBatchRequest/Response, CompactRequest/Response, CloseRequest/Response,
HealthCheckResponse, NewIteratorWithStartAndPrefixRequest/Response,
IteratorNextRequest/Response, IteratorErrorRequest/Response,
IteratorReleaseRequest/Response and the Error enum) into luxfi/protocol —
the canonical home for wire types and service specs in the Lux ecosystem.

Drops the local-only luxfi/proto module which had no upstream and was only
consumed via a replace directive in luxfi/node and luxfi/vm. One canonical
service-spec home, one and only one way to depend on it.

Layered topology unchanged:
  Layer A — wire framing                (github.com/luxfi/api/zap)
  Layer B — service spec (this package) (github.com/luxfi/protocol/rpcdb)
  Layer C — service impl + transport    (github.com/luxfi/node/db/rpcdb)
2026-05-16 16:24:49 -07:00
Hanzo DevandGitHub c155651d55 docs: add LICENSING.md pointer to canonical IP/licensing strategy (#1) 2026-05-15 17:37:50 -07:00
Hanzo AI 0ec56f1ab5 p/network/warp: stub Verify until ZAP-native warp lands
The original warp.go consumed protobuf types from luxfi/node/proto/
pb/platformvm — a package that now ships only a stub package
declaration under //go:build grpc. The actual protobuf-generated
L1ValidatorRegistrationJustification + ChainIDIndex types are not
in tree, so the legacy verification path doesn't compile against
the canonical default build.

Replace with a minimal struct that still satisfies warp.Verifier
(so network.go's signature handler wiring compiles) but whose Verify
method returns ErrWarpVerificationNotImplemented. Callers building
with -tags grpc + a regenerated pb tree can layer the real impl in
a tagged file alongside.

This is a no-op for current default builds — warp signature
verification was already unreachable because the pb dependency
didn't compile.
2026-05-13 13:13:52 -07:00
Hanzo AI b69e650e11 p/network: gate warp.go behind +grpc build tag — ZAP-native by default
node/proto/pb/platformvm carries //go:build grpc so its protobuf-
generated types only compile under -tags grpc. warp.go consumes
those types; without the same tag, the package failed to build at
the platformvm import. Gate this file the same way: the rest of
p/network builds clean by default, and warp validator-registration
verification opts in via -tags grpc when protobuf cross-stack
compat is needed.
2026-05-13 13:11:14 -07:00
Hanzo AI 4081603c7c deps: bump luxfi/crypto v1.19.0 — canonical luxfi/crypto/ipa 2026-05-13 11:55:42 -07:00
Hanzo AI 9f64edfab3 go.mod: bump go directive to 1.26.3 (security advisory) 2026-05-12 21:31:00 -07:00
Hanzo AI 4afa9e724c protocol/p/warp: Corona → Corona rename
Aligns with the upstream rename in luxfi/crypto v1.18.7 (SchemeCorona
→ SchemeCorona), luxfi/validators v1.2.0 (CoronaPubKey →
CoronaPubKey), and luxfi/threshold v1.6.8. After this commit, the
canonical scheme name across the stack is Corona; Corona is the
historical name.

Renamed identifiers (mechanical sweep):
- SchemeCorona → SchemeCorona
- CoronaPubKey → CoronaPubKey
- CoronaSignature → CoronaSignature
- CoronaPublicKey → CoronaPublicKey
- AggregateCoronaPublicKeys → AggregateCoronaPublicKeys
- SigTypeCorona → SigTypeCorona
- VerifyCoronaSignature → VerifyCoronaSignature
- verifyCorona → verifyCorona
- CoronaQ/M/N/Kappa/Dbar/KeySize → CoronaQ/M/N/Kappa/Dbar/KeySize
- luxfi/crypto/threshold/corona → luxfi/crypto/threshold/corona

Deps bumped to match:
- luxfi/crypto v1.17.45 → v1.18.7 (SchemeCorona)
- luxfi/validators v1.0.0 → v1.2.0 (CoronaPubKey field)
- luxfi/threshold v1.5.5 → v1.6.8

Builds clean for the subset liquidity/node depends on:
p/warp + p/warp/message + p/warp/payload + p/signer + p/fx +
p/reward + p/stakeable + p/txs + p/api + p/status +
p/validators/fee. The grpc-tagged p/network + p/warp/gwarp paths
need separate generated-proto work in luxfi/node and stay out of
this commit.
2026-05-12 20:37:18 -07:00
Hanzo AI 3636853b80 fix: clean go.sum, fix unsigned tx and mempool mock imports 2026-04-19 17:06:19 -07:00
Hanzo AI 24ba13704a deps: luxfi/zapdb v4 → v1.0.0 (module path reset) 2026-04-11 00:05:21 -07:00
Hanzo AI 52bd66556c refactor: ConvertChainToL1 → ConvertNetworkToL1
The network (validator set) becomes a sovereign L1, not a chain.
Aligns with CreateNetworkTx naming — it's the network that converts.
2026-04-10 00:02:51 -07:00
Hanzo AI a05c655911 dep: bump github.com/luxfi/genesis v1.7.1 2026-04-04 11:34:33 -07:00
Hanzo AI 6c9cdbeccb chore: update dependencies 2026-04-01 14:47:29 -07:00
Hanzo AI 306a212f2e chore: symlink AGENTS.md and CLAUDE.md to LLM.md
Canonical project context lives in LLM.md. Symlinks ensure
agentic coding tools (agent, Cursor, etc.) find context
automatically regardless of which filename they look for.
2026-04-01 14:09:33 -07:00
Hanzo Dev 88bd3aa7f7 chore: bump Go 1.26.0 → 1.26.1
Fixes 5 stdlib CVEs (html/template, os, net/url, crypto/x509 x2).
2026-03-12 01:09:48 -07:00
Hanzo Dev 41246f9cd9 docs: add LLM.md project guide 2026-03-11 10:35:54 -07:00
Hanzo Dev 44acc76159 chore: update Go module dependencies 2026-03-03 13:46:53 -08:00