Skip to content

feat(validator-debt): abort calculation if fees are zero (#3244)#286

Merged
bgm-malbeclabs merged 1 commit intomainfrom
bgm/abort_if_zero
Mar 11, 2026
Merged

feat(validator-debt): abort calculation if fees are zero (#3244)#286
bgm-malbeclabs merged 1 commit intomainfrom
bgm/abort_if_zero

Conversation

@bgm-malbeclabs
Copy link
Copy Markdown
Collaborator

@bgm-malbeclabs bgm-malbeclabs commented Mar 11, 2026

Summary of Changes

This PR short circuits the debt calculation if fees are set to zero.

Closes malbeclabs/doublezero#3244

Testing Verification

  • Ran locally and validated that the fees are expected

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an early-exit guard in the validator debt calculation workflow: if the fee parameters are zero, the distribution calculation is aborted instead of proceeding with a zero-fee computation.

Changes:

  • Added a check in calculate_distribution to bail out when base_block_rewards_pct is zero
  • Added a CHANGELOG entry for the new behavior

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
crates/validator-debt/src/worker/mod.rs Adds early bail if base_block_rewards_pct is zero before debt calculation
crates/validator-debt/CHANGELOG.md Documents the new feature (PR link placeholder not filled in)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

karl-dz
karl-dz previously approved these changes Mar 11, 2026
@bgm-malbeclabs bgm-malbeclabs merged commit 07df005 into main Mar 11, 2026
2 checks passed
@bgm-malbeclabs bgm-malbeclabs deleted the bgm/abort_if_zero branch March 11, 2026 23:16
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.

If fees set to zero, abort

3 participants