Skip to content

Commit

Permalink
[AH] Disable Vested Transfers as preparation for AHM (#579)
Browse files Browse the repository at this point in the history
Context: #575

Nobody has used vested transfers on Polkadot or Kusama Asset Hub so far
and disabling it until the Migration would avoid insertion conflicts.

---------

Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Co-authored-by: Bastian Köcher <[email protected]>
Co-authored-by: fellowship-merge-bot[bot] <151052383+fellowship-merge-bot[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Feb 7, 2025
1 parent 68babf4 commit 88803d5
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 12 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,11 @@ jobs:
run: cat .github/env >> $GITHUB_ENV

- name: Install stable toolchain
run: |
rustup install $RUST_STABLE_VERSION
rustup default $RUST_STABLE_VERSION
rustup target add wasm32-unknown-unknown
rustup component add rust-src
uses: dtolnay/rust-toolchain@master
with:
targets: "wasm32-unknown-unknown"
components: "rust-src"
toolchain: "${{env.RUST_STABLE_VERSION}}"

- name: Fetch cache
uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
Expand Down Expand Up @@ -314,7 +314,6 @@ jobs:
run: yarn install

- name: Running ecosystem tests
working-directory: ./ecosystem-tests
uses: nick-fields/retry@v3
with:
timeout_minutes: 60
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Update the XCM `Weigher` from `FixedWeightBounds` to `WeightInfoBounds` with benchmarked weights for Polkadot Collectives ([polkadot-fellows/runtimes#547](https://github.com/polkadot-fellows/runtimes/pull/547))
- Increase max PoV size to 10Mib on Kusama ([polkadot-fellows/runtimes#553](https://github.com/polkadot-fellows/runtimes/pull/553))
- Update to Polkadot SDK `stable2409-4` ([polkadot-fellows/runtimes#558](https://github.com/polkadot-fellows/runtimes/pull/558))
- Asset Hubs: disable vested transfers as preparation for the Asset Hub Migration ([polkadot-fellows/runtime#579](https://github.com/polkadot-fellows/runtimes/pull/579))

#### From [#490](https://github.com/polkadot-fellows/runtimes/pull/490)

Expand Down
13 changes: 10 additions & 3 deletions system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ use frame_support::{
ord_parameter_types, parameter_types,
traits::{
fungible, fungibles, tokens::imbalance::ResolveAssetTo, AsEnsureOriginWithArg, ConstBool,
ConstU128, ConstU32, ConstU64, ConstU8, EitherOfDiverse, Equals, InstanceFilter,
TransformOrigin, WithdrawReasons,
ConstU128, ConstU32, ConstU64, ConstU8, Contains, EitherOfDiverse, Equals, EverythingBut,
InstanceFilter, TransformOrigin, WithdrawReasons,
},
weights::{ConstantMultiplier, Weight, WeightToFee as _},
BoundedVec, PalletId,
Expand Down Expand Up @@ -175,9 +175,16 @@ parameter_types! {
pub const SS58Prefix: u8 = 2;
}

pub struct VestedTransferCalls;
impl Contains<RuntimeCall> for VestedTransferCalls {
fn contains(call: &RuntimeCall) -> bool {
matches!(call, RuntimeCall::Vesting(pallet_vesting::Call::vested_transfer { .. }))
}
}

// Configure FRAME pallets to include in runtime.
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type BaseCallFilter = EverythingBut<VestedTransferCalls>;
type BlockWeights = RuntimeBlockWeights;
type BlockLength = RuntimeBlockLength;
type AccountId = AccountId;
Expand Down
13 changes: 10 additions & 3 deletions system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ use frame_support::{
parameter_types,
traits::{
fungible, fungibles, tokens::imbalance::ResolveAssetTo, AsEnsureOriginWithArg, ConstBool,
ConstU32, ConstU64, ConstU8, EitherOfDiverse, Equals, InstanceFilter, NeverEnsureOrigin,
TransformOrigin, WithdrawReasons,
ConstU32, ConstU64, ConstU8, Contains, EitherOfDiverse, Equals, EverythingBut,
InstanceFilter, NeverEnsureOrigin, TransformOrigin, WithdrawReasons,
},
weights::{ConstantMultiplier, Weight, WeightToFee as _},
PalletId,
Expand Down Expand Up @@ -193,9 +193,16 @@ parameter_types! {
pub const SS58Prefix: u8 = 0;
}

pub struct VestedTransferCalls;
impl Contains<RuntimeCall> for VestedTransferCalls {
fn contains(call: &RuntimeCall) -> bool {
matches!(call, RuntimeCall::Vesting(pallet_vesting::Call::vested_transfer { .. }))
}
}

// Configure FRAME pallets to include in runtime.
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type BaseCallFilter = EverythingBut<VestedTransferCalls>;
type BlockWeights = RuntimeBlockWeights;
type BlockLength = RuntimeBlockLength;
type AccountId = AccountId;
Expand Down

0 comments on commit 88803d5

Please sign in to comment.