Files
node/chains
zeekayandHanzo Dev 304717c199 health: name the CHAIN that is unbootstrapped, not the net (v1.36.29)
/v1/health's `bootstrapped` check publishes chains.Nets.Bootstrapping()
verbatim as its message. Nets.chains is keyed by NET id, and the aggregate
appended the map key rather than asking the net which of its chains had not
converged. So every stuck primary-network chain surfaced as one ID,
11111111111111111111111111111111LpoYY — constants.PrimaryNetworkID, i.e.
ids.Empty — a "chain" the chain manager has never heard of. An operator who
went looking for it got "there is no chain with alias/ID", and N stuck chains
collapsed into a single indistinguishable entry that named none of them.

Measured on lux-devnet luxd-0 (v1.36.23), POST health.health:
  "bootstrapped":{"message":["11111111111111111111111111111111LpoYY"],
   "error":"chains not bootstrapped","contiguousFailures":3213}

The net owns the bootstrapping set, so the net is what can name those chains:
nets.Net grows Bootstrapping() []ids.ID and chains.Nets aggregates those
instead of its own keys. One place holds the set; one place reads it.

The existing TestNetsBootstrapping asserted the defect (require.Contains
bootstrapping, netID) — that assertion is why it survived review. It now
demands the chain ID and refuses the net ID.

This also cuts the first tag containing dada5a31, the GET /v1/health encoder
fix: apihealth.APIReply carries a time.Duration per check, jsonv2 has no
default representation for it, so every GET degraded to
{"healthy":…,"error":"health reply encode failed"} while the status code still
looked right. Reproduced here directly —
  json: cannot marshal from Go time.Duration within "/checks/network/duration"
That fix landed on main on 2026-07-25 but no tag ever carried it: v1.36.28
points at 52de3948, seven commits behind. The fleet runs v1.36.2/23/24, all of
which predate it.

Tests (GOWORK=off CGO_ENABLED=0):
  chains  ok  — TestNetsBootstrappingReportsChainsNotNets fails against the
                old aggregate with exactly ids.Empty in the list
  nets    ok  — TestNetBootstrappingNamesTheChains
  health  ok  — the three handler tests fail against the jsonv2 encoder
                (checks decode empty) and pass against encoding/json

Co-authored-by: Hanzo Dev <dev@hanzo.ai>
2026-07-26 17:36:07 -07:00
..