Skip to content

Skip megapools with no active validators when calculating ETH Rewards#1008

Merged
thomaspanf merged 3 commits intomasterfrom
skip-empty-megapools
Feb 16, 2026
Merged

Skip megapools with no active validators when calculating ETH Rewards#1008
thomaspanf merged 3 commits intomasterfrom
skip-empty-megapools

Conversation

@thomaspanf
Copy link
Member

This PR resolves the following:

rocketpool_watchtower  | 2026/02/15 22:01:11 [Balances] Approximating tree using Ruleset v11.
rocketpool_watchtower  | 2026/02/15 22:01:11 [Balances] Creating tree for 161 nodes
rocketpool_watchtower  | 2026/02/15 22:01:11 [Balances] Smoothing Pool Balance:    76911844449941980    (0.077)
rocketpool_watchtower  | 2026/02/15 22:01:11 [Balances] Voter Share from Megapools not in the smoothing pool:    764172624442500000    (0.764)
rocketpool_watchtower  | 2026/02/15 22:01:11 [Balances] Getting details of nodes for Smoothing Pool calculation...
rocketpool_watchtower  | 2026/02/15 22:01:11 [Balances] 127 / 161 nodes (30 with megapools) were eligible for Smoothing Pool rewards
rocketpool_watchtower  | panic: division by zero
rocketpool_watchtower  | 
rocketpool_watchtower  | goroutine 9129 [running]:
rocketpool_watchtower  | math/big.nat.div({0x0?, 0x4000000000006?, 0x7eff0c745158?}, 0x7eff6d7a0108?, {0x0?, 0xc000101808?, 0xc0028f2260?}, {0xc001834900, 0x0, 0x8}, ...)
rocketpool_watchtower  |     /usr/local/go/src/math/big/natdiv.go:520 +0x4b5
rocketpool_watchtower  | math/big.(*Int).QuoRem(0xc0028f2260, 0xc00181dd40, 0xc00004b410, 0xc00004b3c0)
rocketpool_watchtower  |     /usr/local/go/src/math/big/int.go:300 +0x8c
rocketpool_watchtower  | math/big.(*Int).Div(0xc0028f2260, 0x6?, 0x2?)
rocketpool_watchtower  |     /usr/local/go/src/math/big/int.go:311 +0x38
rocketpool_watchtower  | github.com/rocket-pool/smartnode/bindings/utils/state.(*NativeMegapoolDetails).GetMegapoolBondNormalized(0xc00004b8f0)
rocketpool_watchtower  |     /src/bindings/utils/state/megapool.go:47 +0x8d
rocketpool_watchtower  | github.com/rocket-pool/smartnode/shared/services/rewards.(*treeGeneratorImpl_v11).calculateEthRewards(0xc000570960, 0x0)
rocketpool_watchtower  |     /src/shared/services/rewards/generator-impl-v11.go:585 +0x26c5

Also includes a minor optimization by setting the network level values nodeFee, voterFee, pdaoFee and megapool bond once per megapool instead of once per validator.

@thomaspanf thomaspanf merged commit bda0fc2 into master Feb 16, 2026
5 checks passed
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