Skip to content

fix(metrics): use the Electra whistleblower quotient from Electra on - #300

Open
Zyra-V21 wants to merge 1 commit into
devfrom
fix/electra-whistleblower-quotient
Open

Zyra-V21 wants to merge 1 commit into
devfrom
fix/electra-whistleblower-quotient

Conversation

@Zyra-V21

@Zyra-V21 Zyra-V21 commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

The bug

From Electra on, slash_validator divides by WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA (4096). ProcessSlashings in pkg/spec/metrics/state_electra.go still divided by the phase0 WhistleBlowerRewardQuotient (512), so on every Electra and Fulu block with a slashing the proposer was credited eight times the whistleblower reward it actually receives.

Slot 15038043 (Fulu) slashes one validator with 32 ETH effective balance:

gwei
proposer balance, state 15038042 to 15038043 +58,302,762
beacon node /rewards/blocks total 58,302,762
beacon node attester_slashings 7,812,500 (= 32e9 / 4096)
goteth manual reward 112,990,262 (= 58,302,762 - 7,812,500 + 32e9 / 512)

Change

  • WhistleBlowerRewardQuotientElectra = 4096 in pkg/spec/constants.go, used at both sites in state_electra.go. Only Electra and Fulu states reach ElectraMetrics, so earlier forks keep 512 through state_phase0.go.
  • New electra_whistleblower_test.go: one test per branch (attester and proposer slashings), each slashing two validators with different effective balances (2048 and 32 ETH). Putting either site back to 512 fails its test.

Affected data

f_cl_manual_reward in t_block_rewards, plus what GetMaxReward builds from block.ManualReward: the proposer's f_block_experimental_reward in t_validator_rewards_summary, and f_max_reward when the block has no API reward. On a 32 ETH slashing the over-credit is 54,687,500 gwei per slashed validator. Rows already written stay wrong until the post-Electra slashing blocks (t_slashings, valid, f_epoch >= 364032) are re-derived.

The goteth-automatic-QA x7 adjustment in checker/cross_source_validation encodes this bug and has to be dropped when this ships.

slash_validator divides by WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA (4096) from
Electra on. ProcessSlashings in state_electra.go still used the phase0 512, so
every Electra and Fulu block with a slashing credited its proposer eight times
the whistleblower reward it receives on chain.
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.

1 participant