fix: conserve staged-removal validator balance on deferred top-up#377
Conversation
|
Question: should the top-up refund in this staged-removal path be taxed as an invalid deposit? The top-up passed validation when accepted; it is refunded only because the earlier staged removal wins. Since this branch uses |
|
Good question. I think a tax-free withdrawal is more appropriate here. Update(ca07b67):
|
|
Thanks. If we are okay with One small follow-up: the docs still describe summit/docs/deposits-and-withdrawals.md Line 123 in ca07b67 The latest commit addresses my original tax concern too. The staged-removal top-up refund now bypasses the invalid-deposit tax helper and refunds the full top-up amount, with a nonzero-tax regression test covering it. |
ca07b67 to
7d3f85d
Compare
Builds on #276 (which builds on #275).
Addresses #374.
Changes:
account.balance > 0to distinguish a staged-removal validator (still holds a credited balance) from a new-validator placeholder (balance 0). For the former, withdraw the full credited balance (balance_deduction = balance), refund the top-up separately, and let the completion path remove the account. Placeholders and active top-ups are unaffected.test_last_block_topup_does_not_drop_staged_removal_balance.