paritytech / substrate

Substrate: The platform for blockchain innovators
Apache License 2.0
8.39k stars 2.65k forks source link

Proxy accounts with dynamic delay #7894

Open olanod opened 3 years ago

olanod commented 3 years ago

When adding a proxy account there's a delay parameter that specifies the number of blocks to wait before the transaction is submitted, it would be nice if it would be more granular or dynamic in some way so a user can create a proxy that can for example transfer only a maximum amount of tokens in a given time or if transferring a large amount of resources would have to wait a longer period of time giving the owner of the main account more time to cancel it if it's dangerously suspicious.

bkchr commented 3 years ago

CC @shawntabrizi @thiolliere

xlc commented 3 years ago

There is no way to write a pallet that support all the possible configurations. Should just use smart contract.

olanod commented 3 years ago

Fair enough, I still think a slightly updated set of very general purpose configurations could be enough but even if that's the case it could be made more convenient if for example there's a variant of add_proxy that accepts a smart contract codehash and expects the contract to follow a specific interface. On our chain we are not planning to use smart contracts so it would probably better if the handler/filter is a configurable associated type that accepts something like a dispatchable call?

gui1117 commented 3 years ago

we could add an associated type on proxy::Config: AdditionalDelay which would basically hold a function which takes Call and ProxyDefinition (or maybe ProxyType instead) and return a number of block. in call: proxy_announced we would then add the additional delay to the proxy delay.

Thus we could define some proxy type, which have some additional delay on specific Call

gui1117 commented 3 years ago

or the filter itself could return a number of block instead of just a boolean

Polkadot-Forum commented 1 year ago

This issue has been mentioned on Polkadot Forum. There might be relevant details there:

https://forum.polkadot.network/t/proxy-pallet-on-steriods/292/3

Polkadot-Forum commented 1 year ago

This issue has been mentioned on Polkadot Forum. There might be relevant details there:

https://forum.polkadot.network/t/preventing-attacks-on-xcm-reserves/902/3