This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
Account for repatriate_reserved
#6329
Labels
J0-enhancement
An additional feature request.
U1-asap
No need to stop dead in your tracks, however issue should be addressed as soon as possible.
Z1-easy
Can be fixed primarily by duplicating and adapting code by an intermediate coder
repatriate_reserved
gets called in a few places (e.g. reaping a preimage, reaping an inactive voter, providing judgement, closing social recovery) and transfers some balance between two accounts. Since this is called internally, you can't see the parameters to this function and there's no way to reconcile the account balances externally.Also, the amount transferred might not equal the amount passed in. Here in democracy we discard the leftover amount but report the param in the event. However, if the account had been slashed, that's not the actual amount transferred.
We should emit an event here with the addresses involved, actual amount transferred, and free/reserved status.
Likewise,
unreserve
transfers some amount between reserved and free balance, and the amount might not equal the param passed into it. An event here withwho, value
would account for this.Always open to non-event-based solutions as I understand the overhead, but these functions are not called regularly, they tend to be things that happen a few times per month.
The text was updated successfully, but these errors were encountered: