-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Limit derived accounts per parachain? #3641
Comments
We also need to prevent nested as_derivative call, and anonymous proxy, and as_multi_threshold_1. I just don't feel this is the right approach. A normal account on relaychain requires pay ED to exists. Same restriction for sub accounts. I don't see why there is a need for an additional limit just for parachains sovereign accounts. |
I'd also prefer no additional limit for parachain sovereign accounts! If that is how this issue is resolved, then I'll be happy. I opened this so we can figure out the path forward instead of assuming no limit and then building things out without planning for a limit. I recited the explanation given to me for why the additional limit would be necessary:
For example, if there are 1,000 parachains and each has >1,000 derivative accounts, then the relay chain Existential Deposit would be raised to inaccessible levels for normal users in order to implicitly limit the number of balance-holding accounts stored on-chain. |
It still going to cost 1 ed for parachain sub accounts. Same cost for non parachain sub accounts. I don’t see why we want / can only increase the cost of parachain sub accounts. Also people should avoid using relaychain in future anyway. |
They're going to increase the ed so that there aren't more than 1 million accounts on-chain. If we reach 500k accounts, they'll double the ed and then they'll double the ed again at 750k accounts. If the parachain sub accounts are driving the increase in accounts and the ed increase, then non parachain sub accounts are less accessible than they were before.
Agreed. If someone at Parity wants to close this because no limits will be enforced, please do. I'll be happy. |
But limiting sub accounts of parachain is not solving the right problem. |
Background: parachains need a way for smart contracts to control relay chain accounts
As of now, the relay chain supports 1 sovereign account (on the relay chain) per parachain. Each parachain can send upward XCM to the relay chain to dispatch actions on behalf of this account.
For example, if a parachain account owns a relay chain token derivative stored on the parachain, they could burn the token derivative on the parachain to trigger an upward XCM that transfers a proportional amount of relay chain token out of the parachain's sovereign account to an account they control on the relay chain.
However, the above example assumes the user burning the token derivative on the parachain is an individual who controls the private key of a relay chain account. If the user is a smart contract on the parachain, then that contract needs a way to control a relay chain account from the parachain.
Parachain solution: account derivation from sovereign account
The Moonbeam team implemented an attempted workaround wherein the parachain derives proxy accounts from its relay chain sovereign account and dispatches calls for these proxy accounts on behalf of its smart contracts. A similar implementation could use
pallet_utility::as_derivative
to control up tou16::MAX
derived accounts from a single sovereign account.While this approach would work from the parachain perspective, discussions have revealed a preference to limit the number of relay chain accounts controlled by each parachain. This desire to limit parachain-controlled relay chain accounts is related to a practical limit on the number of balance-holding accounts for any given substrate chain (related frontier issue).
Accessibility for creating relay chain accounts should be independent of parachain-controlled relay chain accounts; unbounded parachain-controlled accounts could lead to the relay chain ExistentialDeposit increasing such that creating new relay chain accounts for users is inaccessible.
Feature request: bounded account derivation from sovereign account
Due to the above justification, the relay chain will likely filter deriving accounts from the parachain sovereign account if this functionality is (ab)used.
The purpose of this issue is to request an explicit limit on the number of derived accounts controlled by a parachain. The number mentioned in previous discussions was
1_000
accounts to start.Parachains will need to implement some simple auction to decide who controls the limited number of derived relay chain accounts.
The text was updated successfully, but these errors were encountered: