Existing use cases of `pallet_utility::as_derivative` in XCM

Hey, some implementation details from the Lido on Polkadot and Kusama team:

  1. There are certain use cases of nesting calls we have for liquid staking at Lido on Polkadot and Kusama. For staking via XCM we use three nested calls (RuntimeCall::utility + RuntimeCall::utility + RuntimeCall::Staking or RuntimeCall::xcmPallet).

Here is the full list of calls used:

  • nominate()
  • bond()
  • bondExtra()
  • unbond()
  • withdrawUnbonded()
  • rebond()
  • chill()
  • limitedReserveTransferAssets()
  1. Abusive nesting usage may be addressed either by whitelisting those calls that are confirmed to be in use by different teams/products or by restricting nesting levels at a certain constant, also confirmed by exact use cases, e.g. five.

  2. Whitelisting as_derivative also helps: Introduce whitelist for Transact and limit UMP processing to 10 messages per block by KiChjang · Pull Request #6280 · paritytech/polkadot · GitHub