Skip to content

Include slashed balances in fork choice committee fraction - #10062

Open
NikhilSharmaWe wants to merge 3 commits into
sigp:unstablefrom
NikhilSharmaWe:fix/proposer-score-include-slashed-balances
Open

NikhilSharmaWe wants to merge 3 commits into
sigp:unstablefrom
NikhilSharmaWe:fix/proposer-score-include-slashed-balances

Conversation

@NikhilSharmaWe

Copy link
Copy Markdown

Description

calculate_committee_fraction used total_effective_balance, which excludes active slashed validators. Spec get_total_active_balance includes them.

Use JustifiedBalances::total_active_balance() (unslashed + slashed_balances) in that helper. Attestation balances remain zero for slashings.

Closes #10057

Test plan

  • cargo nextest run -p proto_array justified_balances
  • cargo nextest run -p fork_choice --release

Signed-off-by: Nikhil Sharma <nikhilsharma230303@gmail.com>

@eserilev eserilev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can you add a regression test asserting justified_balances.total_active_balance() matches state.get_total_active_balance()

We have a helper check_justified_balances in fork_choice/tests/test.rs, I think you can throw the assert in there

@chong-he chong-he added bug Something isn't working waiting-on-author The reviewer has suggested changes and awaits thier implementation. fork-choice labels Sep 17, 2026
@NikhilSharmaWe

Copy link
Copy Markdown
Author

can you add a regression test asserting justified_balances.total_active_balance() matches state.get_total_active_balance()

We have a helper check_justified_balances in fork_choice/tests/test.rs, I think you can throw the assert in there

added the assert in check_justified_balances against state.get_total_active_balance()

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working fork-choice waiting-on-author The reviewer has suggested changes and awaits thier implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants