Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pallet-xcm: add support to authorize aliases #6336

Open
wants to merge 41 commits into
base: master
Choose a base branch
from

Conversation

acatangiu
Copy link
Contributor

@acatangiu acatangiu commented Nov 1, 2024

Add calls to pallet-xcm for adding and removing authorization for a certain aliaser location to alias into the caller origin.

pallet-xcm also exposes an AuthorizedAliases filter implementation usable with xcm_executor::Config::Aliasers filter to easily allow runtimes to plug in the explicitly authorized aliases using the calls above.

Usually useful to allow your local account to be aliased into from a remote location also under your control (like your account on another chain).

One cool example is Alice on Para42 doing something on Asset Hub without having to transfer fees from Para42, but instead use her local Asset Hub account:

// called by Alice on Para42
pallet_xcm::send(
	Location::new(1, Parachain(1000)),
	Xcm(vec![
		AliasOrigin(AliceOnAH),
		WithdrawAsset(fees),
		PayFees(fees),
		DoWhatever
	])
);

Part of Empowered cross-chain origins.

Fixes XCM: Arbitrary Origin Aliases #722

@acatangiu acatangiu added the T6-XCM This PR/Issue is related to XCM. label Nov 1, 2024
@acatangiu acatangiu self-assigned this Nov 1, 2024
@acatangiu acatangiu marked this pull request as ready for review November 6, 2024 17:32
@acatangiu acatangiu requested a review from a team as a code owner November 6, 2024 17:32
@acatangiu acatangiu requested a review from muharem November 6, 2024 17:33
Copy link
Contributor

@bkontur bkontur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, left some small nits/questions

polkadot/xcm/pallet-xcm/src/lib.rs Show resolved Hide resolved
polkadot/xcm/pallet-xcm/src/benchmarking.rs Outdated Show resolved Hide resolved
polkadot/xcm/pallet-xcm/src/lib.rs Show resolved Hide resolved
polkadot/xcm/pallet-xcm/src/lib.rs Show resolved Hide resolved
@acatangiu
Copy link
Contributor Author

bot bench polkadot-pallet --subcommand=xcm --runtime=westend --pallet=pallet_xcm
bot bench polkadot-pallet --subcommand=xcm --runtime=rococo --pallet=pallet_xcm

bot bench cumulus-assets --subcommand=xcm --runtime=asset-hub-westend --pallet=pallet_xcm
bot bench cumulus-assets --subcommand=xcm --runtime=asset-hub-rococo --pallet=pallet_xcm

command-bot and others added 5 commits November 7, 2024 12:44
…stend --target_dir=polkadot --pallet=pallet_xcm
…coco --target_dir=polkadot --pallet=pallet_xcm
…set-hub-westend --runtime_dir=assets --target_dir=cumulus --pallet=pallet_xcm
…set-hub-rococo --runtime_dir=assets --target_dir=cumulus --pallet=pallet_xcm
@acatangiu
Copy link
Contributor Author

bot clean

@acatangiu acatangiu enabled auto-merge November 7, 2024 15:37
polkadot/xcm/pallet-xcm/src/benchmarking.rs Outdated Show resolved Hide resolved
polkadot/xcm/pallet-xcm/src/lib.rs Show resolved Hide resolved
polkadot/xcm/pallet-xcm/src/lib.rs Outdated Show resolved Hide resolved
polkadot/xcm/pallet-xcm/src/lib.rs Outdated Show resolved Hide resolved
polkadot/xcm/pallet-xcm/src/migration.rs Outdated Show resolved Hide resolved
prdoc/pr_6336.prdoc Outdated Show resolved Hide resolved
polkadot/xcm/pallet-xcm/src/lib.rs Outdated Show resolved Hide resolved
polkadot/xcm/pallet-xcm/src/lib.rs Outdated Show resolved Hide resolved
polkadot/xcm/pallet-xcm/src/lib.rs Outdated Show resolved Hide resolved
polkadot/xcm/pallet-xcm/src/lib.rs Show resolved Hide resolved
polkadot/xcm/pallet-xcm/src/lib.rs Outdated Show resolved Hide resolved
polkadot/xcm/pallet-xcm/src/lib.rs Outdated Show resolved Hide resolved
polkadot/xcm/pallet-xcm/src/migration.rs Outdated Show resolved Hide resolved
@acatangiu acatangiu marked this pull request as draft January 10, 2025 14:00
auto-merge was automatically disabled January 10, 2025 14:00

Pull request was converted to draft

@acatangiu
Copy link
Contributor Author

acatangiu commented Jan 10, 2025

converted to draft, still pending work:

  • make Consideration working properly - take/refund storage deposit for the saved/stored aliases
  • integrate BlockNumberProvider to properly count "time-to-live" for the stored aliases
  • drop migrations that attempt to auto-prune stale aliases and just rely on owners to reap them and get their Consideration deposit(s) back
  • emit events
  • add tests
  • define & impl runtime APIs

@acatangiu acatangiu marked this pull request as ready for review January 16, 2025 17:04
@acatangiu acatangiu requested a review from a team as a code owner January 16, 2025 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T6-XCM This PR/Issue is related to XCM.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

XCM: Arbitrary Origin Aliases
4 participants