diff --git a/404.html b/404.html index c93958c..bc8b60e 100644 --- a/404.html +++ b/404.html @@ -91,7 +91,7 @@ diff --git a/approved/0001-agile-coretime.html b/approved/0001-agile-coretime.html index 0b0cad1..eb2dfa4 100644 --- a/approved/0001-agile-coretime.html +++ b/approved/0001-agile-coretime.html @@ -90,7 +90,7 @@ diff --git a/approved/0005-coretime-interface.html b/approved/0005-coretime-interface.html index 95fc143..b903c06 100644 --- a/approved/0005-coretime-interface.html +++ b/approved/0005-coretime-interface.html @@ -90,7 +90,7 @@ diff --git a/approved/0007-system-collator-selection.html b/approved/0007-system-collator-selection.html index 604d70c..e564a61 100644 --- a/approved/0007-system-collator-selection.html +++ b/approved/0007-system-collator-selection.html @@ -90,7 +90,7 @@ diff --git a/approved/0008-parachain-bootnodes-dht.html b/approved/0008-parachain-bootnodes-dht.html index fff1499..51b0fd5 100644 --- a/approved/0008-parachain-bootnodes-dht.html +++ b/approved/0008-parachain-bootnodes-dht.html @@ -90,7 +90,7 @@ diff --git a/approved/0010-burn-coretime-revenue.html b/approved/0010-burn-coretime-revenue.html index cda718a..f605fec 100644 --- a/approved/0010-burn-coretime-revenue.html +++ b/approved/0010-burn-coretime-revenue.html @@ -90,7 +90,7 @@ diff --git a/approved/0012-process-for-adding-new-collectives.html b/approved/0012-process-for-adding-new-collectives.html index 5f291e5..b55966e 100644 --- a/approved/0012-process-for-adding-new-collectives.html +++ b/approved/0012-process-for-adding-new-collectives.html @@ -90,7 +90,7 @@ diff --git a/approved/0013-prepare-blockbuilder-and-core-runtime-apis-for-mbms.html b/approved/0013-prepare-blockbuilder-and-core-runtime-apis-for-mbms.html index cdf6208..5aaf132 100644 --- a/approved/0013-prepare-blockbuilder-and-core-runtime-apis-for-mbms.html +++ b/approved/0013-prepare-blockbuilder-and-core-runtime-apis-for-mbms.html @@ -90,7 +90,7 @@ diff --git a/approved/0014-improve-locking-mechanism-for-parachains.html b/approved/0014-improve-locking-mechanism-for-parachains.html index 65707c8..4b359b0 100644 --- a/approved/0014-improve-locking-mechanism-for-parachains.html +++ b/approved/0014-improve-locking-mechanism-for-parachains.html @@ -90,7 +90,7 @@ diff --git a/approved/0022-adopt-encointer-runtime.html b/approved/0022-adopt-encointer-runtime.html index 3db1f02..ccebe7b 100644 --- a/approved/0022-adopt-encointer-runtime.html +++ b/approved/0022-adopt-encointer-runtime.html @@ -90,7 +90,7 @@ diff --git a/approved/0026-sassafras-consensus.html b/approved/0026-sassafras-consensus.html index 3d4da9a..313a4a7 100644 --- a/approved/0026-sassafras-consensus.html +++ b/approved/0026-sassafras-consensus.html @@ -90,7 +90,7 @@ diff --git a/approved/0032-minimal-relay.html b/approved/0032-minimal-relay.html index 56eb036..6f33b06 100644 --- a/approved/0032-minimal-relay.html +++ b/approved/0032-minimal-relay.html @@ -90,7 +90,7 @@ diff --git a/approved/0042-extrinsics-state-version.html b/approved/0042-extrinsics-state-version.html index 3e78808..6c4b4ed 100644 --- a/approved/0042-extrinsics-state-version.html +++ b/approved/0042-extrinsics-state-version.html @@ -90,7 +90,7 @@ diff --git a/approved/0043-storage-proof-size-hostfunction.html b/approved/0043-storage-proof-size-hostfunction.html index 87faef7..b1e65d1 100644 --- a/approved/0043-storage-proof-size-hostfunction.html +++ b/approved/0043-storage-proof-size-hostfunction.html @@ -90,7 +90,7 @@ diff --git a/approved/0045-nft-deposits-asset-hub.html b/approved/0045-nft-deposits-asset-hub.html index ba8acb4..9db20df 100644 --- a/approved/0045-nft-deposits-asset-hub.html +++ b/approved/0045-nft-deposits-asset-hub.html @@ -90,7 +90,7 @@ diff --git a/approved/0047-assignment-of-availability-chunks.html b/approved/0047-assignment-of-availability-chunks.html index f27b564..63e96c7 100644 --- a/approved/0047-assignment-of-availability-chunks.html +++ b/approved/0047-assignment-of-availability-chunks.html @@ -90,7 +90,7 @@ diff --git a/approved/0048-session-keys-runtime-api.html b/approved/0048-session-keys-runtime-api.html index 7127698..d92a2cd 100644 --- a/approved/0048-session-keys-runtime-api.html +++ b/approved/0048-session-keys-runtime-api.html @@ -90,7 +90,7 @@ diff --git a/approved/0050-fellowship-salaries.html b/approved/0050-fellowship-salaries.html index b9911b3..91e1d08 100644 --- a/approved/0050-fellowship-salaries.html +++ b/approved/0050-fellowship-salaries.html @@ -90,7 +90,7 @@ diff --git a/approved/0056-one-transaction-per-notification.html b/approved/0056-one-transaction-per-notification.html index 67391a5..c620abc 100644 --- a/approved/0056-one-transaction-per-notification.html +++ b/approved/0056-one-transaction-per-notification.html @@ -90,7 +90,7 @@ diff --git a/approved/0059-nodes-capabilities-discovery.html b/approved/0059-nodes-capabilities-discovery.html index 8dada72..6b78a13 100644 --- a/approved/0059-nodes-capabilities-discovery.html +++ b/approved/0059-nodes-capabilities-discovery.html @@ -90,7 +90,7 @@ diff --git a/approved/0078-merkleized-metadata.html b/approved/0078-merkleized-metadata.html index b501342..bbf95ea 100644 --- a/approved/0078-merkleized-metadata.html +++ b/approved/0078-merkleized-metadata.html @@ -90,7 +90,7 @@ diff --git a/approved/0084-general-transaction-extrinsic-format.html b/approved/0084-general-transaction-extrinsic-format.html index 965f422..d37f554 100644 --- a/approved/0084-general-transaction-extrinsic-format.html +++ b/approved/0084-general-transaction-extrinsic-format.html @@ -90,7 +90,7 @@ diff --git a/approved/0091-dht-record-creation-time.html b/approved/0091-dht-record-creation-time.html index 9823c51..f60206e 100644 --- a/approved/0091-dht-record-creation-time.html +++ b/approved/0091-dht-record-creation-time.html @@ -90,7 +90,7 @@ diff --git a/approved/0099-transaction-extension-version.html b/approved/0099-transaction-extension-version.html index 71cabc6..0ca6984 100644 --- a/approved/0099-transaction-extension-version.html +++ b/approved/0099-transaction-extension-version.html @@ -90,7 +90,7 @@ diff --git a/index.html b/index.html index ab93f4d..b8f532f 100644 --- a/index.html +++ b/index.html @@ -90,7 +90,7 @@ diff --git a/introduction.html b/introduction.html index ab93f4d..b8f532f 100644 --- a/introduction.html +++ b/introduction.html @@ -90,7 +90,7 @@ diff --git a/new/0105-xcm-improved-fee-mechanism.html b/new/0105-xcm-improved-fee-mechanism.html index 759e9c4..84dda78 100644 --- a/new/0105-xcm-improved-fee-mechanism.html +++ b/new/0105-xcm-improved-fee-mechanism.html @@ -90,7 +90,7 @@ diff --git a/new/0106-xcm-remove-fees-mode.html b/new/0106-xcm-remove-fees-mode.html index 84006fe..426080b 100644 --- a/new/0106-xcm-remove-fees-mode.html +++ b/new/0106-xcm-remove-fees-mode.html @@ -90,7 +90,7 @@ diff --git a/new/0107-xcm-execution-hints.html b/new/0107-xcm-execution-hints.html index 09101a1..f1f4f82 100644 --- a/new/0107-xcm-execution-hints.html +++ b/new/0107-xcm-execution-hints.html @@ -90,7 +90,7 @@ diff --git a/new/0108-xcm-remove-testnet-ids.html b/new/0108-xcm-remove-testnet-ids.html index b04e776..0d7b56a 100644 --- a/new/0108-xcm-remove-testnet-ids.html +++ b/new/0108-xcm-remove-testnet-ids.html @@ -90,7 +90,7 @@ diff --git a/new/0109-xcm-descend-instead-of-clear-origin.html b/new/0109-xcm-descend-instead-of-clear-origin.html index b669377..78afa14 100644 --- a/new/0109-xcm-descend-instead-of-clear-origin.html +++ b/new/0109-xcm-descend-instead-of-clear-origin.html @@ -90,7 +90,7 @@ diff --git a/print.html b/print.html index 99aa51c..f21e2cf 100644 --- a/print.html +++ b/print.html @@ -91,7 +91,7 @@ @@ -1505,37 +1505,37 @@ deliberate decision for enhancing UX - in practice, people/dApps care abount lim

(source)

Table of Contents

-

RFC-0101: XCM Transact shall also allow Unlimited weight

+

RFC-0101: XCM Transact remove require_weight_at_most parameter

- +
Start Date12 July 2024
DescriptionEnchance XCM Transact to allow Unlimited weight inner call
DescriptionRemove require_weight_at_most parameter from XCM Transact
AuthorsAdrian Catangiu

Summary

The Transact XCM instruction currently forces the user to set a specific maximum weight allowed to the inner call and then also pay for that much weight regardless of how much the call actually needs in practice.

-

This RFC proposes improving the usability of Transact by having the remote chain (which executes the Transact), get and charge the actual weight of the inner call from its dispatch info.

+

This RFC proposes improving the usability of Transact by removing that parameter and instead get and charge the actual weight of the inner call from its dispatch info on the remote chain.

Motivation

The UX of using Transact is poor because of having to guess/estimate the require_weight_at_most weight used by the inner call on the target.

We've seen multiple Transact on-chain failures caused by guessing wrong values for this require_weight_at_most even though the rest of the XCM program would have worked.

@@ -1557,28 +1557,25 @@ instruction is hard to use.

  • dApps,
  • Explanation

    -

    The proposed enhancement is simple: change Transact instruction:

    +

    The proposed enhancement is simple: remove require_weight_at_most parameter from the instruction:

    - Transact { origin_kind: OriginKind, require_weight_at_most: Weight, call: DoubleEncoded<Call> },
    -+ Transact { origin_kind: OriginKind, weight_limit: WeightLimit, call: DoubleEncoded<Call> },
    ++ Transact { origin_kind: OriginKind, call: DoubleEncoded<Call> },
     
    -

    With the new API, users who do not need to artificially limit the maximum weight used by the inner call, -can pass weight_limit: Unlimited; while those who need to do it, still can.

    -

    The XCVM implementation shall not use the weight_limit for weighing. Instead, it shall weigh the Transact instruction by also decoding and weighing the inner call.

    -

    The weight_limit shall be used to bail early if the actual weight is more than the specified limit.

    +

    The XCVM implementation shall no longer use require_weight_at_most for weighing. Instead, it shall weigh the Transact instruction by decoding and weighing the inner call.

    Drawbacks

    No drawbacks, existing scenarios work as before, while this also allows new/easier flows.

    Testing, Security, and Privacy

    Currently, an XCVM implementation can weigh a message just by looking at the decoded instructions without decoding the Transact's call, but assuming require_weight_at_most weight for it. With the new version it has to decode the inner call to know its actual weight.

    But this does not actually change the security considerations, as can be seen below.

    -

    When using weight_limit = Unlimited, the weighing happens after decoding the inner call. The entirety of the XCM program containing this Transact needs to be either covered by enough bought weight using a BuyExecution, or the origin has to be allowed to do free execution.

    +

    With the new Transact the weighing happens after decoding the inner call. The entirety of the XCM program containing this Transact needs to be either covered by enough bought weight using a BuyExecution, or the origin has to be allowed to do free execution.

    The security considerations around how much can someone execute for free are the same for both this new version and the old. In both cases, an "attacker" can do the XCM decoding (including Transact inner calls) for free by adding a large enough BuyExecution without actually having the funds available.

    -

    In both cases, decoding is done for free, but execution fails early on BuyExecution.

    +

    In both cases, decoding is done for free, but in both cases execution fails early on BuyExecution.

    Performance, Ergonomics, and Compatibility

    Performance

    No performance change.

    Ergonomics

    -

    Ergonomics are slightly improved by allowing Unlimited max weight for most scenarios.

    +

    Ergonomics are slightly improved by simplifying Transact API.

    Compatibility

    Compatible with previous XCM programs.

    Prior Art and References

    @@ -1586,7 +1583,7 @@ both this new version and the old. In both cases, an "attacker" can do

    Unresolved Questions

    None.

    -

    If we see that nobody uses actual limits (all on-chain calls use weight_limit = Unlimited), we should remove it completely.

    +

    None.

    (source)

    Table of Contents

    Explanation

    -

    The proposed enhancement is simple: change Transact instruction:

    +

    The proposed enhancement is simple: remove require_weight_at_most parameter from the instruction:

    - Transact { origin_kind: OriginKind, require_weight_at_most: Weight, call: DoubleEncoded<Call> },
    -+ Transact { origin_kind: OriginKind, weight_limit: WeightLimit, call: DoubleEncoded<Call> },
    ++ Transact { origin_kind: OriginKind, call: DoubleEncoded<Call> },
     
    -

    With the new API, users who do not need to artificially limit the maximum weight used by the inner call, -can pass weight_limit: Unlimited; while those who need to do it, still can.

    -

    The XCVM implementation shall not use the weight_limit for weighing. Instead, it shall weigh the Transact instruction by also decoding and weighing the inner call.

    -

    The weight_limit shall be used to bail early if the actual weight is more than the specified limit.

    +

    The XCVM implementation shall no longer use require_weight_at_most for weighing. Instead, it shall weigh the Transact instruction by decoding and weighing the inner call.

    Drawbacks

    No drawbacks, existing scenarios work as before, while this also allows new/easier flows.

    Testing, Security, and Privacy

    Currently, an XCVM implementation can weigh a message just by looking at the decoded instructions without decoding the Transact's call, but assuming require_weight_at_most weight for it. With the new version it has to decode the inner call to know its actual weight.

    But this does not actually change the security considerations, as can be seen below.

    -

    When using weight_limit = Unlimited, the weighing happens after decoding the inner call. The entirety of the XCM program containing this Transact needs to be either covered by enough bought weight using a BuyExecution, or the origin has to be allowed to do free execution.

    +

    With the new Transact the weighing happens after decoding the inner call. The entirety of the XCM program containing this Transact needs to be either covered by enough bought weight using a BuyExecution, or the origin has to be allowed to do free execution.

    The security considerations around how much can someone execute for free are the same for both this new version and the old. In both cases, an "attacker" can do the XCM decoding (including Transact inner calls) for free by adding a large enough BuyExecution without actually having the funds available.

    -

    In both cases, decoding is done for free, but execution fails early on BuyExecution.

    +

    In both cases, decoding is done for free, but in both cases execution fails early on BuyExecution.

    Performance, Ergonomics, and Compatibility

    Performance

    No performance change.

    Ergonomics

    -

    Ergonomics are slightly improved by allowing Unlimited max weight for most scenarios.

    +

    Ergonomics are slightly improved by simplifying Transact API.

    Compatibility

    Compatible with previous XCM programs.

    Prior Art and References

    @@ -258,7 +255,7 @@ both this new version and the old. In both cases, an "attacker" can do

    Unresolved Questions

    None.

    -

    If we see that nobody uses actual limits (all on-chain calls use weight_limit = Unlimited), we should remove it completely.

    +

    None.

    diff --git a/proposed/0102-offchain-parachain-runtime-upgrades.html b/proposed/0102-offchain-parachain-runtime-upgrades.html index c8b33b5..839b99f 100644 --- a/proposed/0102-offchain-parachain-runtime-upgrades.html +++ b/proposed/0102-offchain-parachain-runtime-upgrades.html @@ -90,7 +90,7 @@ @@ -518,7 +518,7 @@ sharing if multiple parachains use the same data (e.g. same smart contracts).

    - @@ -532,7 +532,7 @@ sharing if multiple parachains use the same data (e.g. same smart contracts).