Skip to content

feat(validator): add Prometheus metrics and improve telemetry for incentive mechanism - #415

Closed
itzlambda wants to merge 2 commits into
mainfrom
improve-telemetry
Closed

feat(validator): add Prometheus metrics and improve telemetry for incentive mechanism#415
itzlambda wants to merge 2 commits into
mainfrom
improve-telemetry

Conversation

@itzlambda

Copy link
Copy Markdown
Contributor

Summary

  • Add 12 Prometheus metrics for the incentive pool: pool USD required/capacity, alpha/TAO token prices, per-GPU-category incentive config (target count, price, window hours), revenue share/slash config, weight-setting success/error counter, and per-miner CU totals with vesting progress
  • Refactor per-miner payout breakdown into a shared MinerCategoryDetail struct computed inside compute_incentive_pool, eliminating the ~120-line duplicate compute_miner_breakdown pass in weight_setter.rs
  • Add #[instrument] tracing spans on attempt_weight_setting, compute_incentive_pool_weights, compute_incentive_pool, and submit_weights_to_chain

Closes #413

…entive mechanism

Add 12 new Prometheus metrics for the incentive pipeline: pool state
(usd_required, usd_emission_capacity), per-GPU-category config
(target_count, price_per_gpu_cents, window_hours), global config
(revenue_share_pct, slash_pct), token prices (alpha, TAO),
weight-setting outcome counter, and per-miner CU vesting gauges
(cu_total, cu_vested_pct by miner_uid + gpu_category).

Refactor compute_miner_breakdown (~120 lines of duplicated payout math)
out of weight_setter into a new MinerCategoryDetail struct returned
directly from compute_incentive_pool, eliminating divergence risk.

Add #[instrument] spans to key async functions for trace correlation
and a cumulative vesting percentage computation for per-miner Grafana
dashboards.
@coderabbitai

coderabbitai Bot commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ad7503f3-0d68-413d-816e-01418c64f903

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch improve-telemetry

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@epappas

epappas commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

Closing: this PR has been migrated to one-covenant/basilica-protocol#5 as part of the repo move to basilica-protocol. The source repo is being re-archived.

@epappas epappas closed this Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants