Bridge-Hubs: Add proxy pallet#1045
Merged
Merged
Conversation
Comment on lines
+569
to
+611
| impl InstanceFilter<RuntimeCall> for ProxyType { | ||
| fn filter(&self, c: &RuntimeCall) -> bool { | ||
| match self { | ||
| ProxyType::Any => true, | ||
| ProxyType::NonTransfer => matches!( | ||
| c, | ||
| RuntimeCall::System(_) | | ||
| RuntimeCall::ParachainSystem(_) | | ||
| RuntimeCall::Timestamp(_) | | ||
| RuntimeCall::CollatorSelection(_) | | ||
| RuntimeCall::Session(_) | | ||
| RuntimeCall::Utility(_) | | ||
| RuntimeCall::Multisig(_) | | ||
| RuntimeCall::Proxy(_) | | ||
| RuntimeCall::BridgeRelayers(pallet_bridge_relayers::Call::register { .. }) | | ||
| RuntimeCall::BridgeRelayers(pallet_bridge_relayers::Call::deregister { .. }) | | ||
| RuntimeCall::BridgeRelayers(pallet_bridge_relayers::Call::claim_rewards { .. }) | ||
| ), | ||
| ProxyType::CancelProxy => matches!( | ||
| c, | ||
| RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. }) | | ||
| RuntimeCall::Utility { .. } | | ||
| RuntimeCall::Multisig { .. } | ||
| ), | ||
| ProxyType::Collator => matches!( | ||
| c, | ||
| RuntimeCall::CollatorSelection { .. } | | ||
| RuntimeCall::Utility { .. } | | ||
| RuntimeCall::Multisig { .. } | ||
| ), | ||
| } | ||
| } | ||
|
|
||
| fn is_superset(&self, o: &Self) -> bool { | ||
| match (self, o) { | ||
| (x, y) if x == y => true, | ||
| (ProxyType::Any, _) => true, | ||
| (_, ProxyType::Any) => false, | ||
| (ProxyType::NonTransfer, ProxyType::Collator) => true, | ||
| _ => false, | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
ProxyType::NonTransfer allows RuntimeCall::Utility(_) and RuntimeCall::Multisig(_) ([Line 580-586]). Both pallets can dispatch arbitrary inner calls (e.g., utility::batch{,_all} wrapping balances::transfer, and multisig executing any call), which effectively bypasses the 'non-transfer' restriction and turns this proxy into an Any proxy. Fix by either (a) removing Utility and Multisig from NonTransfer, or (b) implementing a recursive filter that inspects inner calls and rejects any that transfer funds/assets (and similarly handles nested proxy/batch).
ggwpez
reviewed
Jan 2, 2026
clangenb
approved these changes
Jan 8, 2026
clangenb
left a comment
Contributor
There was a problem hiding this comment.
One question, but looks good otherwise. I have cross-checked:
- Proxy deposits with other chains ✅
- Proxy type rights with other chains ✅
claravanstaden
approved these changes
Jan 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.