Skip to content

Commit c660f88

Browse files
committed
Document deliberate divergence of seeded node_type vs peer_type
1 parent bd70a0e commit c660f88

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

cmd/node/metrics/metrics.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,16 @@ func InitMetrics(
4444
initZeroString := "0"
4545

4646
appStatusHandler.SetStringValue(core.MetricPublicKeyBlockSign, pubkeyStr)
47+
// KLC-2388: node_type stays "validator" during the bootstrap window even
48+
// though peer_type below is seeded to "observer". The two intentionally
49+
// diverge until the peerTypeProvider cache populates: node_type is the
50+
// PR's protected value (the original bug was validators flipping to
51+
// observer on cache miss), so we cannot seed it observer without
52+
// re-introducing exactly that symptom; peer_type is left pessimistic
53+
// because it's a peer-list classification that we genuinely don't know
54+
// yet. Once the gate opens the sender writes the real values from the
55+
// fork detector / nodes coordinator.
4756
appStatusHandler.SetStringValue(core.MetricNodeType, string(nodeType))
48-
// KLC-2388: seed klv_peer_type alongside klv_node_type so consumers see a
49-
// real value during the bootstrap window before the peerTypeProvider cache
50-
// is populated. The heartbeat sender's IsCachePopulated gate keeps this
51-
// startup value in place until the first epoch-start event refreshes the
52-
// cache, at which point the real peer-list classification takes over.
5357
appStatusHandler.SetStringValue(core.MetricPeerType, string(core.ObserverList))
5458
appStatusHandler.SetUInt64Value(core.MetricSlotTime, slotInterval/millisecondsInSecond)
5559
appStatusHandler.SetStringValue(core.MetricAppVersion, version)

0 commit comments

Comments
 (0)