📚 Overview
The current staking settlement logic approximates loser raw stake using weighted ratios instead of actual stake totals.
This leads to incorrect economic outcomes.
🌊 Drips Context
This issue fixes a core economic invariant of the protocol.
Incorrect slashing breaks:
- Fair reward distribution
- Economic integrity
- Trust in verification outcomes
❗ Problem
Current logic:
claim.totalStakeAmount * loserWeighted / totalWeighted
This is incorrect when reputation multipliers differ.
✅ Expected Behavior
- Track exact raw stake:
- totalRawFor
- totalRawAgainst
- Use exact loser raw stake in settlement
🧠 Implementation Guidelines
- Modify staking structure to track per-side raw stake
- Update
_calculateSettlement
- Add invariant tests for:
- mixed reputation
- uneven stake distribution
✅ Acceptance Criteria
- Exact loser raw stake is used
- Rewards/slashes match expected math
- Invariant tests pass
⏳ Complexity
High
🏷 Labels
audit, protocol, high-priority, drips-wave
📚 Overview
The current staking settlement logic approximates loser raw stake using weighted ratios instead of actual stake totals.
This leads to incorrect economic outcomes.
🌊 Drips Context
This issue fixes a core economic invariant of the protocol.
Incorrect slashing breaks:
❗ Problem
Current logic:
claim.totalStakeAmount * loserWeighted / totalWeighted
This is incorrect when reputation multipliers differ.
✅ Expected Behavior
🧠 Implementation Guidelines
_calculateSettlement✅ Acceptance Criteria
⏳ Complexity
High
🏷 Labels
audit, protocol, high-priority, drips-wave