Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

update safe call filter #7080

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion runtime/kusama/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,9 @@ impl Contains<RuntimeCall> for SafeCallFilter {
) |
RuntimeCall::XcmPallet(pallet_xcm::Call::limited_reserve_transfer_assets {
..
}) => true,
}) |
RuntimeCall::Whitelist(pallet_whitelist::Call::whitelist_call { .. }) |
RuntimeCall::Proxy(..) => true,
Copy link
Member

Choose a reason for hiding this comment

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

The docs of this filter state:

/// 2. Cannot lead to another call being made;

I guess in this case it should be fine since the proxy pallet routes all calls through this filter again?

/// 3. Have a defined proof size weight, e.g. no unbounded vecs in call parameters.

Proxy::proxy does accept call: Box<<T as Config>::RuntimeCall>, so this is not given.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, but we actually still allow Utility::as_derivative which is an extrinsic that itself contains a Call, in order to allow use cases on both Moonbeam and Acala to still work as intended, so allowing Proxy::proxy is also based on the same logic.

In principle however, the 2nd rule may not be necessary, as it's impossible to create an infinitely recursive extrinsic call -- the chain would have thrown an error during decoding as there is a max decoding depth of 10 in the SCALE codec.

_ => false,
}
}
Expand Down
53 changes: 11 additions & 42 deletions runtime/polkadot/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,48 +220,16 @@ impl Contains<RuntimeCall> for SafeCallFilter {
RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) |
RuntimeCall::Grandpa(..) |
RuntimeCall::ImOnline(..) |
RuntimeCall::Democracy(
pallet_democracy::Call::second { .. } |
pallet_democracy::Call::vote { .. } |
pallet_democracy::Call::emergency_cancel { .. } |
pallet_democracy::Call::fast_track { .. } |
pallet_democracy::Call::veto_external { .. } |
pallet_democracy::Call::cancel_referendum { .. } |
pallet_democracy::Call::delegate { .. } |
pallet_democracy::Call::undelegate { .. } |
pallet_democracy::Call::clear_public_proposals { .. } |
pallet_democracy::Call::unlock { .. } |
pallet_democracy::Call::remove_vote { .. } |
pallet_democracy::Call::remove_other_vote { .. } |
pallet_democracy::Call::blacklist { .. } |
pallet_democracy::Call::cancel_proposal { .. },
) |
RuntimeCall::Council(
pallet_collective::Call::vote { .. } |
pallet_collective::Call::disapprove_proposal { .. } |
pallet_collective::Call::close { .. },
) |
RuntimeCall::TechnicalCommittee(
pallet_collective::Call::vote { .. } |
pallet_collective::Call::disapprove_proposal { .. } |
pallet_collective::Call::close { .. },
) |
RuntimeCall::PhragmenElection(
pallet_elections_phragmen::Call::remove_voter { .. } |
pallet_elections_phragmen::Call::submit_candidacy { .. } |
pallet_elections_phragmen::Call::renounce_candidacy { .. } |
pallet_elections_phragmen::Call::remove_member { .. } |
pallet_elections_phragmen::Call::clean_defunct_voters { .. },
) |
RuntimeCall::TechnicalMembership(
pallet_membership::Call::add_member { .. } |
pallet_membership::Call::remove_member { .. } |
pallet_membership::Call::swap_member { .. } |
pallet_membership::Call::change_key { .. } |
pallet_membership::Call::set_prime { .. } |
pallet_membership::Call::clear_prime { .. },
) |
RuntimeCall::Treasury(..) |
RuntimeCall::ConvictionVoting(..) |
RuntimeCall::Referenda(
pallet_referenda::Call::place_decision_deposit { .. } |
pallet_referenda::Call::refund_decision_deposit { .. } |
pallet_referenda::Call::cancel { .. } |
pallet_referenda::Call::kill { .. } |
pallet_referenda::Call::nudge_referendum { .. } |
pallet_referenda::Call::one_fewer_deciding { .. },
) |
RuntimeCall::Claims(
super::claims::Call::claim { .. } |
super::claims::Call::mint_claim { .. } |
Expand Down Expand Up @@ -323,7 +291,8 @@ impl Contains<RuntimeCall> for SafeCallFilter {
RuntimeCall::XcmPallet(pallet_xcm::Call::limited_reserve_transfer_assets {
..
}) |
RuntimeCall::Whitelist(pallet_whitelist::Call::whitelist_call { .. }) => true,
RuntimeCall::Whitelist(pallet_whitelist::Call::whitelist_call { .. }) |
RuntimeCall::Proxy(..) => true,
_ => false,
}
}
Expand Down