-
Notifications
You must be signed in to change notification settings - Fork 700
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix reserved amounts for pure proxies #237
Comments
related paritytech/substrate#8550 |
I thought I might illustrate this with a specific motivating use-case where we mix pure/regular proxy semantics at Chainflip: To implement a vault on polkadot, we're using a pure account with a proxy controlled by threshold multisig. We periodically update the ownership of the pure vault account by removing the old multisig proxy and adding a new one. Currently we need to fund both the initial multisig proxy account and the pure account; otherwise there aren't enough funds in the pure account to pay for the addition of the next proxy. If the funds were transferred to the pure account on creation, we would be able to remove the old and add a new for net-zero extra funds. Secondly, the funds reserved in the initial 'spawner' proxy account during creation stay reserved until (maybe one day) the pure account is killed. Given that, in our case, the creator account is a multisig, and that the account was deliberately removed from the proxy list, it's likely that by the time the funds are recovered, the spawning multisig will be defunct. I agree that transferring the funds to the pure account when it is created would make pure accounts more intuitive to use. Additionally, I would suggest allowing the caller of FWIW both of the above issues are minor and easy to work around once you're aware of them: make sure the pure account is funded (and learn to live with the fact that you might never see your deposit again!). |
I don't know if the following is an artifact of this issue, but I was closing up an account that I had used for the configuration I prepared in Referendum 145. I used Today I decided to reap whatever transferrable funds were left in So now there is no such account with a proper reserved balance recorded in the chain state to reflect the proxy relationships recorded here:
I don't know if that matters or if it's intentional, but I assume there should exist some account that holds a reserve balance to reflect the storage of these proxy relationships. Idk if this report is at all tip worthy but in any case: Kusama address: GqC37KSFFeGAoL7YxSeP1YDwr85WJvLmDDQiSaprTDAm8Jj |
* auto exchange tx relay dashboard * cargo fmt --all * single metrics startup fn
* auto exchange tx relay dashboard * cargo fmt --all * single metrics startup fn
* auto exchange tx relay dashboard * cargo fmt --all * single metrics startup fn
* auto exchange tx relay dashboard * cargo fmt --all * single metrics startup fn
* auto exchange tx relay dashboard * cargo fmt --all * single metrics startup fn
* auto exchange tx relay dashboard * cargo fmt --all * single metrics startup fn
* auto exchange tx relay dashboard * cargo fmt --all * single metrics startup fn
* auto exchange tx relay dashboard * cargo fmt --all * single metrics startup fn
* auto exchange tx relay dashboard * cargo fmt --all * single metrics startup fn
* auto exchange tx relay dashboard * cargo fmt --all * single metrics startup fn
* auto exchange tx relay dashboard * cargo fmt --all * single metrics startup fn
Framing
Regular Proxy
slave ---calls---> add_proxy(master)
slave
must have fundsslave
has additional amount reserved to pay for recording the relationship.Pure Proxy
master ---calls---> pure_proxy()
which createsslave
:master
must have fundsmaster
has amount reserved to pay for recording the relationship.Problem and solution
When these two models are mixed (i.e. when a pure proxy is created which then adds a regular proxy), then problems ensue: more is reserved than should be and not enough can be freed.
Instead of having two different places where the funds can be held in reserve (depending on whether the relationship was started with a pure proxy or a regular proxy), it should always be held by the slave. When a pure proxy is created, the funds should not be reserved in the
master
account, but first transferred into theslave
account and reserved there.kill_pure
must do the reverse: remove all records/deposits and transfer them back to themaster
account.See bkchr-demonstrate-proxy-reserve-issue for one test demonstrating the issue.
The text was updated successfully, but these errors were encountered: