6

I am getting the XCM error of WeightNotComputable. What could be the cause of this?

enter image description here

Here is the XCM code which fails.

3 Answers 3

1
+50

It was because you use instruction WithdrawAsset(1,Here), but the relaychain cannot handle this token, it only can handle the native token which is (0, Here), this will return Weight::MAX when getting the weight of the instruction. Then cause the error WeightNotComputable.

0

The WeightNotComputable error is returned as an Err from the prepare function below. The Weighter::weight function returns the maximum amount of weight that an attempted execution of this message could consume, so it seems like it has failed to infer the max weight.

fn prepare(
        mut message: Xcm<Config::RuntimeCall>,
    ) -> Result<Self::Prepared, Xcm<Config::RuntimeCall>> {
        match Config::Weigher::weight(&mut message) {
            Ok(weight) => Ok(WeighedMessage(weight, message)),
            Err(_) => Err(message),
        }
    }

Could you please check whether the weight is being loaded correctly in #[pallet::weight(<T as pallet::pallet::Config>::WeightInfo::create_nomination_pool())]?

1
  • How would go about validating that the weight is being loaded correctly?
    – Snowmead
    Jun 28, 2023 at 13:54
0

Here you can checkout that Transact will execute the encoded call that you prepared on the relay chain.Please check the requireWeightAtMost to specify the maximum amount of weight to use in dispatching the XCM call.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.