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

Add remote proxy support to AH Kusama #535

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open

Add remote proxy support to AH Kusama #535

wants to merge 25 commits into from

Conversation

bkchr
Copy link
Contributor

@bkchr bkchr commented Jan 9, 2025

This adds remote proxy support to AssetHub on Polkadot and Kusama. Currently it is configured only to support using proxies registered on the relay chain to work on AssetHub. In the future this can be expanded.

Copy link
Contributor

@xlc xlc left a comment

Choose a reason for hiding this comment

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

this is not in polkadot-sdk repo so how do we want to test it on westend?

pallets/remote-proxy/src/lib.rs Show resolved Hide resolved
@bkchr
Copy link
Contributor Author

bkchr commented Jan 10, 2025

this is not in polkadot-sdk repo so how do we want to test it on westend?

I will also port it there. I wanted to include it in the next release if possible. People are having more and more these problems of proxies not being on AH and similar. This pallet could solve the issue without requiring a root referendum (we already had one and another is prepared AFAIK).

@bkchr bkchr marked this pull request as ready for review January 15, 2025 20:49
@bkchr bkchr mentioned this pull request Jan 15, 2025
6 tasks
pallets/remote-proxy/src/lib.rs Show resolved Hide resolved
pallets/remote-proxy/src/lib.rs Outdated Show resolved Hide resolved
system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs Outdated Show resolved Hide resolved
@bkchr bkchr changed the title Add remote proxy pallet Add remote proxy support to AH Polkadot&Kusama Jan 16, 2025
@acatangiu
Copy link
Contributor

I'd be more comfortable if we also did a security audit for this before adding it to live Polkadot AssetHub

@bkchr
Copy link
Contributor Author

bkchr commented Jan 17, 2025

I'd be more comfortable if we also did a security audit for this before adding it to live Polkadot AssetHub

The scope of the changes is quite narrow. Doing some proper review should be fine. The only difference to the real proxy pallet is that the data is coming in from the outside.

@bkchr bkchr changed the title Add remote proxy support to AH Polkadot&Kusama Add remote proxy support to AH Kusama Jan 27, 2025
@bkchr
Copy link
Contributor Author

bkchr commented Jan 27, 2025

Okay removed the Polkadot integration for now. It can come later after the audit.

@Tbaut
Copy link

Tbaut commented Jan 27, 2025

Any chance the people chains can also be included while we're at it? This would help change the identity of pure proxies.

Copy link
Contributor

@xlc xlc left a comment

Choose a reason for hiding this comment

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

This means remove proxy is only fully effective after MaxStorageRootsToKeep blocks. It could be possible to construct some attack based on this behaivour. We should at very minimal document and communicate this change to ensure people are aware of the consequence.
We could ask the UI to display a warning to user when they are trying to remove a proxy indicating the account still have permission on other chain for X blocks.
Another way is somehow be able to blacklist this account for X blocks.

pallets/remote-proxy/src/lib.rs Outdated Show resolved Hide resolved
@bkchr
Copy link
Contributor Author

bkchr commented Jan 28, 2025

We should at very minimal document and communicate this change to ensure people are aware of the consequence.

I mean I have documented it. Or where should I document this?

Co-authored-by: Xiliang Chen <xlchen1291@gmail.com>
@xlc
Copy link
Contributor

xlc commented Jan 28, 2025

#441 we haven't figured out the whole process yet. I see a changelog entry but it does not have the warning. No one really read doc comments.

@bkchr
Copy link
Contributor Author

bkchr commented Jan 28, 2025

#441 we haven't figured out the whole process yet. I see a changelog entry but it does not have the warning. No one really read doc comments.

What kind of warning should there be? I mean users will not see this changelog and would not understand it either. For them nothing breaks, this is more about telling UI builders to show this warning? And they hopefully read the docs to understand on how to implement it? We can also reduce the "keep alive" timer to 1 minute. Should still be enough time to build the proof and get it included.

@xlc
Copy link
Contributor

xlc commented Jan 29, 2025

If the keep alive timer is only 1 minute then I wouldn't worry about it too much. Still mention it changelog will be nice, which I expect UI builders to read and think about it.

Copy link
Contributor

@muharem muharem left a comment

Choose a reason for hiding this comment

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

Nice.
It looks good to me. I’m not very familiar with the sp_trie API you’re using, though.

@@ -38,12 +38,15 @@ use assets_common::{
};
use cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases;
use cumulus_primitives_core::{AggregateMessageOrigin, ParaId};
use kusama_runtime_constants::time::MINUTES;
Copy link
Contributor

Choose a reason for hiding this comment

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

how about alias like RC_MINUTES? very easy to confuse with local MINUTES

) -> Option<ProxyDefinition<AccountId, ProxyType, BlockNumber>> {
let proxy_type = match a.proxy_type {
kusama_runtime_constants::proxy::ProxyType::Any => ProxyType::Any,
kusama_runtime_constants::proxy::ProxyType::NonTransfer => ProxyType::NonTransfer,
Copy link
Contributor

Choose a reason for hiding this comment

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

non transfer on two chains are very different. I think the initial idea was to let this for Any type.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In what way they are different? The point being that you can not do any transfers. For me that is exactly the same on every chain.


impl WeightInfo for () {
fn remote_proxy_with_registered_proof() -> Weight {
Weight::zero()
Copy link
Contributor

Choose a reason for hiding this comment

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

may be MAX instead?

@@ -0,0 +1,70 @@
[package]
name = "pallet-remote-proxy"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it a good idea to add the pallet here, instead of the sdk (or separate repo)? In particular, having it here prevents us from using it on Westend, Rococo and Versi.

Copy link
Contributor

Choose a reason for hiding this comment

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

Disregard, was already asked.

@bkchr
Copy link
Contributor Author

bkchr commented Jan 29, 2025

/cmd bench --pallet pallet_remote_proxy

Copy link

Command "bench --pallet pallet_remote_proxy" has started 🚀 See logs here

Copy link

Command "bench --pallet pallet_remote_proxy" has finished ✅ See logs here

@bkchr
Copy link
Contributor Author

bkchr commented Jan 29, 2025

/cmd bench --pallet pallet_remote_proxy

Copy link

Command "bench --pallet pallet_remote_proxy" has started 🚀 See logs here

Copy link

Command "bench --pallet pallet_remote_proxy" has finished ✅ See logs here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants