Files
Darkhorse7starsandGitHub 8cdccf6d74 network,node: complete strict-PQ activation (schemeGate + pre-dedup handshake + classical-compat) (#137)
main carries the strict-PQ peer-identity fix (NewLocalIdentityFromStakingKey +
adoptVerifiedPQIdentity) but is missing three further layers that are each
required for strict-PQ consensus and chain creation to actually work. All three
are proven on a live devnet running the equivalent fix (node v1.10.18-strictpq):
a full ML-DSA validator mesh forms and the EVM/DEX/FHE chains are created on the
sovereign L1.

1. schemeGate nil-gate (network/network.go)
   Under strict-PQ the TLS layer is transport-only: peer leaf certs are
   ephemeral ECDSA, which schemeFromCert classifies as classical, so the
   SchemeGate refuses every peer at the upgrade. Pass a nil gate to the TLS
   upgraders when PQHandshakeConfig is active; identity is enforced by the PQ
   handshake instead. Non-PQ paths keep the real gate.

2. pre-dedup PQ handshake (network/network.go + network/peer/peer.go)
   The PQ handshake ran inside peer.Start, under peersLock, with init/responder
   roles fixed by dial direction. On simultaneous mutual dials every node acts
   as a lone initiator (keeps its outbound, drops the peer's inbound at the
   connecting-dedup) and deadlocks -> 0 peers. Run the handshake per-conn in
   network.upgrade, before the dedup and without the lock, so each TCP conn
   completes independently and the dedup keys on the resulting stable ML-DSA
   NodeID. RunPQHandshakeConn shares main's binding via a new
   verifyPQIdentityBinding helper, so the pre-dedup and in-Start paths enforce
   byte-identical identity semantics.

3. classical-compat allow-list (node/node.go)
   The ClassicalCompatRegistry was nil, so strict-PQ refused every classical
   secp256k1 P-chain credential and the bootstrap control key could not issue
   CreateNetwork/CreateChainTx. Seed it (strict-PQ only) from the genesis
   P-chain allocation owners plus ids.ShortEmpty (the mempool's current
   originator). This unblocks creating the EVM/DEX/FHE chains.

Builds clean with CGO_ENABLED=0; network/peer, network, vms/txs/auth and
platformvm genesis/mempool tests pass. main's identity fix is unchanged.

Supersedes #136 (which carried these layers on a branch that had diverged 331
commits behind main). Follow-up, tracked separately: config.pemBytesOrFile
short-circuits on a blank *-content flag and silently degrades a strict-PQ
validator to an ECDSA NodeID.
2026-06-07 11:02:49 -07:00
..