Skip to content

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?

@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
@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
@fellowship-merge-bot
Copy link
Contributor

Failed to update PR ❌

There was an error while trying to keep this PR up-to-date

You may have conflicts ‼️ or may have to manually sync it with the target branch 👉❇️

More info in the logs 📋

@bkchr bkchr merged commit 6b85bf6 into main Feb 28, 2025
58 of 59 checks passed
@bkchr
Copy link
Contributor Author

bkchr commented Feb 28, 2025

Fuck why was this merged 🙈

@bkchr
Copy link
Contributor Author

bkchr commented Feb 28, 2025

Apparently some checks were not part of the required checks 🙈

@bkchr bkchr deleted the bkchr-remote-proxy branch March 3, 2025 20:08

impl<
LocalProxyType,
ProxyDefinitionConverter: Convert<
Copy link
Member

Choose a reason for hiding this comment

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

There is also a TryConvert for fallible conversions

type RuntimeCall = RuntimeCall;
type Currency = Balances;
type ProxyType = ProxyType;
type ProxyType = TransparentProxyType<ProxyType>;
Copy link
Member

Choose a reason for hiding this comment

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

This is probably interesting for downstream proxy dApps. Going to ping this to some people.

/// the older the proof can be. This is not only seen as a maximum number, but also as the
/// maximum difference between the latest and the oldest storage root stored. This means
/// that if the chain for example did not progress for `MaxStorageRootsToKeep` blocks, only
/// the latest added storage root will be available for validating proofs.
Copy link
Member

Choose a reason for hiding this comment

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

It also means that this is the maximum time after which removal of a proxy will be visible here, or? So users will need to be aware that there is a delay of removing a proxy now.

pub struct Pallet<T, I = ()>(_);

/// Stores the last [`Config::MaxStorageRootsToKeep`] block to storage root mappings of the
/// target chain.
Copy link
Member

Choose a reason for hiding this comment

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

One comment please on the order of entries here.


// We always remove all the old items before, thus there should always be space in
// the vector.
let _res = roots.try_push((block, hash));
Copy link
Member

Choose a reason for hiding this comment

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

Could use defensive_proof here to get a production error log.

/// chain.
///
/// The dispatch origin for this call must be _Signed_. The difference to
/// [`Self::remote_proxy`] is that the proof nees to registered before using
Copy link
Member

Choose a reason for hiding this comment

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

typo

proxy_definitions
.into_iter()
.filter_map(T::RemoteProxy::remote_to_local_proxy_defintion)
.find(f)
Copy link
Member

Choose a reason for hiding this comment

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

I guess in the case that there are multiple proxies and no force type, it will just pick the first one?
Should not produce issues i think, just an observation.

@ggwpez ggwpez mentioned this pull request Mar 5, 2025
fellowship-merge-bot bot pushed a commit that referenced this pull request Mar 10, 2025
Release 1.4.2 for:
- #535 (PAH and KAH)
- #614 (P Collectives)
- #604 (PAH and KAH)

---------

Signed-off-by: Oliver Tale-Yazdi <[email protected]>
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.

10 participants