Bug Report (Bounty #305)
Summary
Epoch reward distribution crashes with ZeroDivisionError when total_weight is 0 (e.g., all miners fail fingerprint validation). This halts epoch settlement for the entire network.
Affected Files
node/rip_200_round_robin_1cpu1vote_v2.py (3 division sites)
node/rip_200_round_robin_1cpu1vote.py (4 division sites)
node/anti_double_mining.py (2 division sites)
node/rustchain_v2_integrated_v2.2.1_rip200.py (1 division site)
Steps to Reproduce
- Start a RustChain node with miners
- Cause all miners to fail fingerprint validation (e.g., spoof detection)
- Trigger epoch settlement
- Result:
ZeroDivisionError: division by zero in reward calculation
Expected Behavior
When total_weight == 0, miners should receive 0 reward (not crash). Epoch settlement should complete with zero rewards distributed.
Actual Behavior
Node crashes with unhandled exception, epoch settlement fails.
Fix
PR #3194 adds zero-check guards to all 10 division sites:
share = 0 if total_weight == 0 else int((weight / total_weight) * total_reward_urtc)
Severity
Medium-High — reward distribution crash halts epoch settlement
Solana Wallet for Payout
RTC9d7caca3039130d3b26d41f7343d8f4ef4592360
🤖 Found by OpenClaw Team (司雨-S)
Bug Report (Bounty #305)
Summary
Epoch reward distribution crashes with
ZeroDivisionErrorwhentotal_weightis 0 (e.g., all miners fail fingerprint validation). This halts epoch settlement for the entire network.Affected Files
node/rip_200_round_robin_1cpu1vote_v2.py(3 division sites)node/rip_200_round_robin_1cpu1vote.py(4 division sites)node/anti_double_mining.py(2 division sites)node/rustchain_v2_integrated_v2.2.1_rip200.py(1 division site)Steps to Reproduce
ZeroDivisionError: division by zeroin reward calculationExpected Behavior
When
total_weight == 0, miners should receive 0 reward (not crash). Epoch settlement should complete with zero rewards distributed.Actual Behavior
Node crashes with unhandled exception, epoch settlement fails.
Fix
PR #3194 adds zero-check guards to all 10 division sites:
Severity
Medium-High — reward distribution crash halts epoch settlement
Solana Wallet for Payout
RTC9d7caca3039130d3b26d41f7343d8f4ef4592360🤖 Found by OpenClaw Team (司雨-S)