polkadot-fellows / xcm-format

Polkadot Cross Consensus-system Message format.
Apache License 2.0
181 stars 43 forks source link

RFC: Make `Transact` weight limit optional #55

Closed acatangiu closed 4 months ago

acatangiu commented 7 months ago

Summary

Replace the require_weight_at_most: Weight parameter of the Transact instruction with an optional weight limit: maybe_weight_limit: Option<WeightLimit>

Motivation

The UX of using Transact is not great, and one part of the problem is guesstimating this require_weight_at_most. We've seen multiple Transacts on-chain failures caused by the "incorrect" use or the parameter. In practice, this parameter only adds UX overhead. The vast majority of use cases fall in one of two categories:

  1. Unpaid execution of Transacts - in these cases the require_weight_at_most is not really useful, caller doesn't have to pay for it, and on the call site it either fits the block or not;
  2. Paid execution of single Transact - the weight to be spent by the Transact is already covered by the BuyExecution weight limit parameter.

We've had multiple OpenGov root/whitelisted_caller proposals initiated by core-devs completely or partially fail because of incorrect configuration of require_weight_at_most parameter. This is a strong indication that the instruction is hard to use.

Polkadot-Forum commented 6 months ago

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

https://forum.polkadot.network/t/xcm-user-and-developer-experience-improvements/4511/21

acatangiu commented 4 months ago

Closing in favor of https://github.com/polkadot-fellows/RFCs/pull/101