paritytech / substrate

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

Proxy & Mutisig did not respect PostDispatchInfo to disable fee #6917

Open xlc opened 4 years ago

xlc commented 4 years ago

With #6749, it is possible to mark a success transaction execution to be free. However this is not respected by proxy and multisig.

I think we will want to make proxy/multisig call free if the underlying tx call is free?

cc @shawntabrizi

shawntabrizi commented 4 years ago

Thanks, I will look into it 👍

xlc commented 4 years ago

Batch is bit complicated, we may want a partial refund?

xlc commented 3 years ago

Too bad Acala Foundation on Kusama / Polkadot cannot enjoy https://github.com/paritytech/substrate/pull/7661 because our account is multisig / proxy.

emielsebastiaan commented 3 years ago

Same for Polkascan Foundation's multisig account on Kusama. 😃

stale[bot] commented 3 years ago

Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions.

TorstenStueber commented 2 years ago

This feature would actually be quite important when using multisig for the sudo account. A single runtime upgrade executed through the sudo account using pallet-multisig could cost about 5-20 units of native tokens (considering a typical parachain configuration).

This number originates from the dominating term of the formula for transaction fees. This term is LengthToFee applied to the length of the extrinsic. Most (Polkadot) parachains define LengthToFee to just be the multiplier 1 unit/100_000. The length of an extrinsic for a runtime upgrade is about the size of the runtime and that is around 1MByte.

shawntabrizi commented 2 years ago

See my comment in the PR above:

Unfortunately, I don't think it can be trivially added here.

There is some sensibility to bubbling up "no fee payment" when calling batch or derivative or other utility calls, but I worry that this can become an attack vector.

For example imagine I do:

batch(batch(batch(batch(batch...(free_call)...)))))

I can basically do this arbitrarily to take the whole block, and pay no fee because the bottom call pays no fee, and each batch would bubble up that no fee was paid.

I think best to avoid anything like this for now.

TorstenStueber commented 2 years ago

I did not look at the pallet-proxy but at least for the pallet-multisig I would propose not to make the transaction entirely feeless but charge a small fair fee that reflects the space and computation time usage for wrapping the execution. So that for example the PostDispatchInfo returned by the wrapped call would be transformed into the following PostDispatchInfo of the operate extrinsic of pallet-multisig: