Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Account for repatriate_reserved #6329

Closed
joepetrowski opened this issue Jun 11, 2020 · 1 comment · Fixed by #6330
Closed

Account for repatriate_reserved #6329

joepetrowski opened this issue Jun 11, 2020 · 1 comment · Fixed by #6330
Assignees
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

Comments

@joepetrowski
Copy link
Contributor

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 with who, 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.

@joepetrowski joepetrowski added 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 labels Jun 11, 2020
@kianenigma
Copy link
Contributor

I am fine with adding events as well since they have been optimised lately, but doing this stuff offchain is also rather easy (better to say: easier than things like fee calculation).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants