This repository was archived by the owner on Sep 8, 2026. It is now read-only.
feat(validator-debt): better summarized debt - #218
Merged
Merged
Conversation
bgm-malbeclabs
marked this pull request as draft
December 2, 2025 00:41
bgm-malbeclabs
force-pushed
the
bgm/deliquents
branch
3 times, most recently
from
December 3, 2025 01:19
c039ec1 to
67dbaec
Compare
bgm-malbeclabs
force-pushed
the
bgm/deliquents
branch
from
December 3, 2025 01:21
67dbaec to
bb31d83
Compare
bgm-malbeclabs
marked this pull request as ready for review
December 3, 2025 01:23
There was a problem hiding this comment.
Pull request overview
This PR enhances debt collection reporting by adding detailed summaries for both individual epochs and aggregated totals across all epochs. The changes move Slack notification logic into the validator-debt crate to improve code reusability and add tracking of total debt, total paid amounts, and insufficient payment counts throughout the debt collection process.
Key Changes:
- Refactored debt collection results to use detailed structs instead of simple counts
- Added cumulative tracking of debt metrics across epochs in the PayDebt GenServer
- Created a new endpoint to post aggregated debt summaries to Slack
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| scheduler/native/scheduler_doublezero/src/lib.rs | Added debt collection structs, new post_debt_summary NIF function, and modified pay_debt to return detailed collection results |
| scheduler/native/scheduler_doublezero/Cargo.toml | Added reqwest dependency for HTTP requests |
| scheduler/mix.exs | Removed trailing comma from deps() call |
| scheduler/lib/scheduler/worker/pay_debt.ex | Enhanced GenServer state to track cumulative debt metrics and post summary on completion |
| scheduler/lib/scheduler/validator_debt/debt_collection.ex | Created Elixir structs for debt collection results |
| scheduler/lib/scheduler/scheduler_doublezero.ex | Added NIF declaration for post_debt_summary |
| scheduler/CHANGELOG.md | Added changelog entry for debt summarization feature |
| crates/validator-debt/src/worker.rs | Moved post_debt_collection_to_slack function from slack-notifier with enhanced details |
| crates/validator-debt/src/transaction.rs | Changed debt collection results from counts to vectors of detailed results |
| crates/solana-cli/src/command/revenue_distribution/relay/mod.rs | Updated to use refactored debt collection posting function |
| crates/slack-notifier/src/validator_debt.rs | Removed post_debt_collection_to_slack function and changed post_to_slack visibility to public |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
karl-dz
approved these changes
Dec 3, 2025
karl-dz
approved these changes
Dec 3, 2025
bgm-malbeclabs
added a commit
to malbeclabs/doublezero
that referenced
this pull request
Aug 28, 2026
…ffchain#218) ## Summary of Changes This PR adds in more details for when debt collection is posted to slack and also summarizes debt collection for all epochs. It moves some of the debt-related slack composition to the validator-debt crate so we can reuse the existing structs instead of a many-arity function. It also adds total debt, total paid, and insufficient payment counts to the pay debt GenServer which are then posted to slack at the end of a debt collection run. Closes #2256. ## Testing Verification * This was tested locally in a private slack channel: <img width="1269" height="702" alt="Screenshot 2025-12-02 at 17 19 46" src="https://github.com/user-attachments/assets/a8f75951-01e0-4ba4-a4f6-9d8cf2657dab" />
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
This PR adds in more details for when debt collection is posted to slack and also summarizes debt collection for all epochs. It moves some of the debt-related slack composition to the validator-debt crate so we can reuse the existing structs instead of a many-arity function. It also adds total debt, total paid, and insufficient payment counts to the pay debt GenServer which are then posted to slack at the end of a debt collection run.
Closes malbeclabs/doublezero#2256.
Testing Verification