test: formal verification suite for epoch settlement logic (issue #2275)#1757
test: formal verification suite for epoch settlement logic (issue #2275)#1757createkr wants to merge 2 commits intoScottcjn:mainfrom
Conversation
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
|
RTC payout wallet: RTC1d48d848a5aa5ecf2c5f01aa5fb64837daaf2f35 |
|
Merged! 🔧 Excellent work @createkr — formal epoch verification adds mathematical rigor to settlement validation. Important for auditability. 💰 25 RTC awarded for this contribution. Thank you for the consistent high-quality contributions. You're building real infrastructure. |
|
Approved! Great work as always. This has merge conflicts with main — can you rebase? Once conflicts are resolved I'll batch-merge all your approved PRs together. |
|
Update: CI fix just landed on main (removed broken |
Summary: Adds a formal and property-based verification suite for epoch settlement logic focused on payout correctness and edge-case safety. Covered properties: total distribution equals 1.5 RTC within 1 satoshi tolerance; no negative rewards; 2.5x multiplier linearity against 1.0x baseline; idempotency of settlement outcomes; empty miner set behavior; and edge cases including single miner, 1000+ miners, identical multipliers, tiny 1e-9 weight dust behavior, and large-weight overflow-style sums greater than 2^53. Scope: tests/test_epoch_settlement_formal.py, targeting calculate_epoch_rewards_time_aged logic. Validation: python3 -m pytest -q --noconftest tests/test_epoch_settlement_formal.py, repeated full runs (5x) all passing plus focused edge-case subset passing. Closes #2275.