ProtocolMetrics and Scoring

Metrics and Scoring

Tangle’s incentive programs can be driven by on-chain activity metrics. Metrics are optional: the protocol is designed so that core actions still work even if metrics recording is disabled or temporarily unavailable.

Core Components

  • TangleMetrics: an on-chain activity recorder implementing IMetricsRecorder.
  • Metrics hooks: best-effort calls from core contracts (wrapped in try/catch) that emit or aggregate activity data.
  • InflationPool: a pre-funded TNT budget that can distribute TNT based on recorded metrics.
  • ServiceFeeDistributor: distributes the staker share of service fees and exposes USD-weighted exposure views for staker inflation.

What Gets Recorded

Depending on what is configured on-chain, the protocol can record:

  • Blueprint activity: blueprint creation and operator registrations.
  • Service activity: service creation/termination, job calls, job completion success rates.
  • Payments: total fees paid by customers.
  • Operator liveness: heartbeats for active services.
  • Slashing: the full slashing lifecycle is observable via ITangleSlashing events: SlashProposed, SlashDisputed, SlashExecuted, SlashCancelled, and SlashConfigUpdated. TangleMetrics records executed slashes (count and slashed amount) for incentive accounting; indexers that need full lifecycle context (proposers, dispute reasons, config history) should subscribe to all five events directly.

Staker “Exposure” Scoring

For staker rewards funded by InflationPool, exposure is computed at distribution time:

  • InflationPool.distributeEpochWithServices queries ServiceFeeDistributor.getOperatorServiceUsdExposure.
  • Exposure uses the same security requirements and commitments that gate service-fee payouts.
  • If a price oracle is configured, the exposure is normalized in USD terms; otherwise it falls back to raw amounts.

This avoids storing per-delegator exposure metrics on-chain and keeps staker inflation aligned with the same exposure model used for fees.

Heartbeats and QoS

Operators (often via their blueprint manager) can submit service heartbeats to OperatorStatusRegistry. Heartbeats:

  • Provide an on-chain signal of liveness for a given (serviceId, operator).
  • Can mark operators offline for a service when heartbeats are missed.
  • Are often used as part of off-chain monitoring, and may be referenced when proposing a slash.

Heartbeats do not automatically slash an operator by themselves; slashing requires an authorized on-chain proposal and execution.

Important Note on Budgets

Merit-based rewards only exist if InflationPool is funded with TNT. If it has a zero balance, there is nothing to distribute, even if metrics are recorded.

Source Contracts (GitHub)