Skip to content

Remove node-side tokenomics/governance metrics (appendix-observability) #1439

Closed

Description

@alpergundogdu

Decision (2026-07 ADR simplification audit). Filed under the Protocol simplifications milestone — sibling to #1396, #1394, #1419. Verdict: DROP. Node re-exporting authoritative on-chain state for off-node dashboards is a layering violation; the chain is the source of truth. Keep the operator-local slash-watcher family.

Drop the node-side tokenomics / governance Prometheus metrics

Status: proposal for discussion, not a decision.

Candidate: the appendix-observability § Tokenomics Metrics block — the FeeRouter, Served-Bytes-Voting, CapacityBond, and Slash-Escrow/SlashAppeal metric sub-tables. These are the gauges that have the node poll authoritative on-chain contract state and re-export it as Prometheus series.

Summary

The § Tokenomics Metrics tables spec a set of gauges/counters whose job is to read on-chain state — CapacityBond.bondOf, slashedAtEpoch, escrowedTotal, getActiveNodeCount, FeeRouter.bytesPerEpoch / bytesInWindow / totalBytesInWindow, FeeRouter settlement inflow, SlashAppeal record counts — and re-project it onto the node's /metrics endpoint. This is authoritative on-chain data that a block explorer, a governance UI, or a direct RPC call already serves. The proposal is to delete this subsection and NOT build these collectors. The node's /metrics stays what it is: a node-operational time-series surface. It should not double as a governance/tokenomics data bus.

Honest scoping note up front: these collectors are not implemented today. None of the metric names in the subsection (decdn_capacity_bond_amount_token, decdn_operator_bytes_in_window, decdn_fee_router_inflow_usdc_total, decdn_slash_escrow_total_token, decdn_slash_appeals, decdn_capacity_bond_active_operator_count, etc.) exist anywhere in crates/node. So this is primarily a spec removal that cancels future work, not a deletion of shipped code. That makes the "does this earn its place" question sharper, not softer — we would be committing to build a governance data path that the appendix itself says nothing yet consumes.

Motivation

  1. It re-projects authoritative data. Every gauge in the subsection is sourced "(RPC)" from a contract view or event log — CapacityBond.bondOf(operator), FeeRouter.bytesInWindow(operator, currentEpoch, windowEpochs), CapacityBond.escrowedTotal(), SlashAppeal records. The chain is the source of truth (ADR 016 is the canonical contract surface). Anyone who wants these values can read them from the contract directly, and get them for the whole network, not just for whichever node happens to be scraped. A per-node Prometheus mirror is a strictly weaker, staler copy of data the chain already exposes.

  2. The appendix defers its own consumers. The stated consumers are "governance dashboard," "public dashboard," and "keeper monitoring." But § Deferred & Open says the tokenomics dashboard panels "are deployment-specific and belong outside the reference set," and § 4/§ dashboard scoping explicitly leaves § Tokenomics Metrics panels out of the reference Grafana dashboard. We would be shipping metric collectors whose only documented readers are dashboards the same document declines to ship. Fix: drop the producers along with the deferred consumers; re-add both together if and when a governance dashboard is actually scoped.

  3. Wrong layer for governance data. Vote weight (ADR 036), quorum denominators, active-operator count for the bootstrap→DAO transition (ADR 009), and slash-appeal state are network-global governance facts. Reading them through one operator's node daemon means N nodes each maintaining N independent, drifting copies of the same global numbers. The correct layer is a single indexer / governance UI reading the chain once — not the operator-facing /metrics endpoint on every daemon. Fix: let the governance surface own governance data.

  4. It buys new RPC-poll load and drift risk for no operational signal. These gauges "sample at the existing RPC-poll cadence," i.e. they add contract reads to the node's hot RPC path. Unlike the slash-safety watchers, none of these values drive a node action — the node does not decide anything based on its own exported decdn_operator_bytes_in_window. It is pure re-export. That is poll cost and a drift-from-chain failure mode (a stale gauge misleads a dashboard) with zero closed-loop benefit to the node. Fix: don't poll for display-only mirrors.

  5. Nothing depends on it yet, so removal is cheap. Because no collector is built, dropping the subsection costs one appendix edit and prevents a chunk of speculative Rust. This is the cleanest possible time to decide against it — consistent with the recent overengineering cuts (Proposal: remove speculative prefetch #1396, Redesign origin addressing: namespace-as-address, drop per-hash claims and the default-open allow-list #1394, Drop aggregated reputation; make ADR 008 reputation local-only #1419).

What removal touches

Blast radius is small and mostly documentary:

  • adr/appendix-observability.md § Tokenomics Metrics — delete the subsection and its four sub-tables (FeeRouter Metrics, Served-Bytes Voting Metrics, CapacityBond Metrics, Slash-Escrow / SlashAppeal Metrics). Prune the two back-references in § dashboard scoping and § Deferred & Open that point at "§ Tokenomics Metrics" (the reference-dashboard scoping note and the "tokenomics dashboard panels are deployment-specific" deferral). The § Slash-Safety Metrics subsection (a separate block, all Mandatory) is not touched.
  • Rust — the RPC-poll collectors in crates/node: correction to the distilled case — these do not exist yet. Confirmed absent from crates/node/src/metrics.rs (4022 lines) and the rest of crates/node/src: none of decdn_capacity_bond_*, decdn_operator_bytes_*, decdn_fee_router_inflow_*, decdn_slash_escrow_*, decdn_slash_appeals, decdn_slash_finalized_total are defined, and the node does not poll bondOf / bytesInWindow / getActiveNodeCount / escrowedTotal to feed a gauge (those calls appear only in crates/e2e and crates/node/tests as assertions, not as metric sources). So on the Rust side "removal" means not writing these collectors, not deleting them. The node's existing FeeRouter interaction is settlement (payment_settlement.rs routes the provider remainder through FeeRouter) — it exports watcher-liveness/settle-party metrics, not an inflow re-projection counter.
  • Tests: nothing to remove — there are no unit tests for these unimplemented metrics. Unaffected: the e2e assertions that read slashedAtEpoch / escrowedTotal / bytesPerEpoch directly from contracts (crates/e2e/src/chain.rs, crates/node/tests/anvil_settlement_e2e.rs) are correctness checks against ADR 016 state, not metric exporters, and stay.

What we keep

All node-local operational metrics stay. Concretely, everything that is either a node-local time series or a closed-loop safety signal the daemon acts on:

  • Slash-Safety Metrics (the separate Mandatory subsection): probe-hold slots, blacklist-version-behind, slash-evidence and blacklist-lag counters. These are early-warning signals for this operator's own slashable exposure.
  • The slash / chain-watcher operational family in metrics.rs — decdn_slashes_detected_total (reads SlashJudge.Slashed for this node's operator so the operator knows to file decdn appeal slash inside the 30-day window), decdn_slash_watcher_down_seconds / _restarts_total / _last_tick_timestamp_seconds / _task_panicked_total, and the sibling staker-set / origin-directory / settlement / reputation watcher-liveness gauges. These measure this node's watcher health and this operator's own slash exposure — operator-local alerting, not a governance re-projection — and they drive operator action.
  • Delivery (cdn/client/v1), Cache, Probe, Payment Channel (this node's channels), Gossip, Reputation (local EWMA), QUIC/0-RTT, DHT/content-discovery, and Node/Process metrics — all node-local, all retained.

The line: keep metrics about this node's behavior and this operator's own risk; drop metrics that merely mirror network-global chain state onto every node's scrape.

Counter-argument

The strongest keep case is keeper monitoring — the one consumer in the list that is not "a dashboard." decdn_slash_escrow_total_token and decdn_slash_appeals{state=…} could feed an alert that watches escrow approaching a finality deadline or appeals piling up in the open state. If keepers are expected to scrape node /metrics rather than run their own chain indexer, deleting these removes a monitoring hook.

Rebuttal, for balance: a keeper is by definition already an on-chain actor with an RPC connection and a wallet; reading escrowedTotal() / SlashAppeal records directly is one eth_call, and doing so gives the keeper the global, authoritative, un-drifted view rather than one node operator's mirror. Coupling keeper safety to whether some operator's daemon is scrapeable is the weaker design. [your call] — is keeper monitoring intended to consume node /metrics, or is it (as ADR 016 canonical-surface framing implies) a chain-native actor that should read contracts directly? If the former, decdn_slash_escrow_total_token and decdn_slash_appeals are the two rows worth preserving and the rest of the subsection still goes.

Secondary keep case: decdn_operator_bytes_in_window and decdn_capacity_bond_amount_token are arguably operator-local — "my bond, my served-bytes share." But an operator reads those from their own on-chain record just as easily, and their value here is again display-only (nothing in the node consumes them). They do not clear the "earns its poll cost" bar the way slash-safety metrics do.

Open questions

  1. Keeper consumption model. Are keepers/watchtowers expected to scrape node /metrics, or to read the chain directly? This decides whether the two Slash-Escrow rows survive as a carve-out. (See counter-argument.)
  2. Operator self-service. If an operator genuinely wants "my bond / my served-bytes / my slash watermark" on their own Grafana without querying the chain, is that better served by a small decdn CLI subcommand (one-shot RPC read) than by standing Prometheus gauges? A CLI read avoids the continuous poll and the drift window.
  3. ADR 036 vote-weight visibility. Served-bytes vote weight (numerator bytesInWindow, denominator totalBytesInWindow) is the headline governance number. Confirm the intended home is the governance UI / indexer, so dropping the node-side mirror leaves no gap in how operators see their own vote weight.
  4. Does any alert rule reference these? monitoring/prometheus-alerts.yml groups are slash-safety / liveness / delivery; confirm none of the tokenomics series are referenced there before removal (spot-check says no, but verify).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions