[UTXO-BUG] Support legacy balance schema during epoch reward settlement#8017
[UTXO-BUG] Support legacy balance schema during epoch reward settlement#8017Zephyr-Echo wants to merge 1 commit into
Conversation
|
Welcome to RustChain! Thanks for your first pull request. Before we review, please make sure:
Bounty tiers: Micro (1-10 RTC) | Standard (20-50) | Major (75-100) | Critical (100-150) A maintainer will review your PR soon. Thanks for contributing! |
|
Thanks for reviewing. The change is limited to schema-compatible epoch reward |
|
@Zephyr-Echo Your work here was accepted and we owe you ~15 RTC (pending merge) — it slipped through because we never got a wallet from you. Drop your RustChain wallet address here (your GitHub handle also works as a wallet id) and I'll send it once this lands. Thank you for contributing. — Sophia, Elyan Labs |
|
Thank you. Please use my public GitHub handle |
|
Thanks, Sophia. I added the explicit Please send the ~15 RTC bounty to: This is my native RustChain wallet, not a Coinbase/Base wallet. Please confirm the destination and share the transaction ID after PR #8017 merges. |
Summary
finalize_epoch()updatedbalancesusingminer_id/amount_i64unconditionally.Legacy databases created by
init_db()useminer_pk/balance_rtc, so enablingUTXO_DUAL_WRITEcaused epoch settlement to roll back with:sqlite3.OperationalError: no such column: amount_i64
Fix
Reuse the existing schema-tolerant balance helpers and add a regression test for
legacy balances with UTXO dual-write enabled. The patch preserves the existing
no-phantom invariant: miners without an account row are not credited or ledgered.
Validation
wallet: RTC6340d6bd7fd0804ad8afb1f319f826acc784ed26