From 7c5224cb01710d0c14c87bf3463cc79e49b3e7b5 Mon Sep 17 00:00:00 2001
From: gupnik <mail.guptanikhil@gmail.com>
Date: Fri, 22 Nov 2024 10:16:45 +0530
Subject: [PATCH] Adds `BlockNumberProvider` in multisig, proxy and nft pallets
 (#5723)

Step in https://github.com/paritytech/polkadot-sdk/issues/3268

This PR adds the ability for these pallets to specify their source of
the block number. This is useful when these pallets are migrated from
the relay chain to a parachain and vice versa.

This change is backwards compatible:
1. If the `BlockNumberProvider` continues to use the system pallet's
block number
2. When a pallet deployed on the relay chain is moved to a parachain,
but still uses the relay chain's block number

However, we would need migrations if the deployed pallets are upgraded
on an existing parachain, and the `BlockNumberProvider` uses the relay
chain block number.

---------

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
---
 .../assets/asset-hub-rococo/src/lib.rs        |  3 ++
 .../assets/asset-hub-westend/src/lib.rs       |  3 ++
 .../bridge-hubs/bridge-hub-rococo/src/lib.rs  |  1 +
 .../bridge-hubs/bridge-hub-westend/src/lib.rs |  1 +
 .../collectives-westend/src/lib.rs            |  2 ++
 .../contracts/contracts-rococo/src/lib.rs     |  1 +
 .../coretime/coretime-rococo/src/lib.rs       |  2 ++
 .../coretime/coretime-westend/src/lib.rs      |  2 ++
 .../runtimes/people/people-rococo/src/lib.rs  |  2 ++
 .../runtimes/people/people-westend/src/lib.rs |  2 ++
 polkadot/runtime/rococo/src/lib.rs            |  2 ++
 polkadot/runtime/westend/src/lib.rs           |  2 ++
 prdoc/pr_5723.prdoc                           | 24 +++++++++++++++
 substrate/bin/node/runtime/src/lib.rs         |  3 ++
 substrate/frame/contracts/src/tests.rs        |  1 +
 substrate/frame/multisig/src/lib.rs           | 10 +++++--
 substrate/frame/multisig/src/tests.rs         |  1 +
 .../frame/nft-fractionalization/src/mock.rs   |  1 +
 substrate/frame/nfts/src/benchmarking.rs      | 22 +++++++-------
 .../frame/nfts/src/features/approvals.rs      |  6 ++--
 .../frame/nfts/src/features/atomic_swap.rs    |  8 ++---
 .../frame/nfts/src/features/attributes.rs     |  2 +-
 .../nfts/src/features/create_delete_item.rs   |  2 +-
 substrate/frame/nfts/src/features/settings.rs |  6 +---
 substrate/frame/nfts/src/lib.rs               | 29 ++++++++++---------
 substrate/frame/nfts/src/mock.rs              |  1 +
 substrate/frame/nfts/src/types.rs             | 12 ++++----
 substrate/frame/proxy/src/benchmarking.rs     |  6 ++--
 substrate/frame/proxy/src/lib.rs              | 12 ++++++--
 substrate/frame/proxy/src/tests.rs            |  1 +
 substrate/frame/revive/src/tests.rs           |  1 +
 substrate/frame/safe-mode/src/mock.rs         |  1 +
 substrate/frame/src/lib.rs                    |  4 +--
 substrate/frame/tx-pause/src/mock.rs          |  1 +
 34 files changed, 125 insertions(+), 52 deletions(-)
 create mode 100644 prdoc/pr_5723.prdoc

diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs
index 2f9d83bd9d0..bc48c2d805f 100644
--- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs
+++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs
@@ -467,6 +467,7 @@ impl pallet_multisig::Config for Runtime {
 	type DepositFactor = DepositFactor;
 	type MaxSignatories = MaxSignatories;
 	type WeightInfo = weights::pallet_multisig::WeightInfo<Runtime>;
+	type BlockNumberProvider = frame_system::Pallet<Runtime>;
 }
 
 impl pallet_utility::Config for Runtime {
@@ -652,6 +653,7 @@ impl pallet_proxy::Config for Runtime {
 	type CallHasher = BlakeTwo256;
 	type AnnouncementDepositBase = AnnouncementDepositBase;
 	type AnnouncementDepositFactor = AnnouncementDepositFactor;
+	type BlockNumberProvider = frame_system::Pallet<Runtime>;
 }
 
 parameter_types! {
@@ -918,6 +920,7 @@ impl pallet_nfts::Config for Runtime {
 	type WeightInfo = weights::pallet_nfts::WeightInfo<Runtime>;
 	#[cfg(feature = "runtime-benchmarks")]
 	type Helper = ();
+	type BlockNumberProvider = frame_system::Pallet<Runtime>;
 }
 
 /// XCM router instance to BridgeHub with bridging capabilities for `Westend` global
diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs
index 2206aea78ec..cafea3b6ff8 100644
--- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs
+++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs
@@ -466,6 +466,7 @@ impl pallet_multisig::Config for Runtime {
 	type DepositFactor = DepositFactor;
 	type MaxSignatories = MaxSignatories;
 	type WeightInfo = weights::pallet_multisig::WeightInfo<Runtime>;
+	type BlockNumberProvider = frame_system::Pallet<Runtime>;
 }
 
 impl pallet_utility::Config for Runtime {
@@ -651,6 +652,7 @@ impl pallet_proxy::Config for Runtime {
 	type CallHasher = BlakeTwo256;
 	type AnnouncementDepositBase = AnnouncementDepositBase;
 	type AnnouncementDepositFactor = AnnouncementDepositFactor;
+	type BlockNumberProvider = frame_system::Pallet<Runtime>;
 }
 
 parameter_types! {
@@ -912,6 +914,7 @@ impl pallet_nfts::Config for Runtime {
 	type WeightInfo = weights::pallet_nfts::WeightInfo<Runtime>;
 	#[cfg(feature = "runtime-benchmarks")]
 	type Helper = ();
+	type BlockNumberProvider = frame_system::Pallet<Runtime>;
 }
 
 /// XCM router instance to BridgeHub with bridging capabilities for `Rococo` global
diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs
index ff7af475f5e..3f3316d0be4 100644
--- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs
+++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs
@@ -537,6 +537,7 @@ impl pallet_multisig::Config for Runtime {
 	type DepositFactor = DepositFactor;
 	type MaxSignatories = ConstU32<100>;
 	type WeightInfo = weights::pallet_multisig::WeightInfo<Runtime>;
+	type BlockNumberProvider = frame_system::Pallet<Runtime>;
 }
 
 impl pallet_utility::Config for Runtime {
diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs
index 06540001679..65e7d291dc3 100644
--- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs
+++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs
@@ -513,6 +513,7 @@ impl pallet_multisig::Config for Runtime {
 	type DepositFactor = DepositFactor;
 	type MaxSignatories = ConstU32<100>;
 	type WeightInfo = weights::pallet_multisig::WeightInfo<Runtime>;
+	type BlockNumberProvider = frame_system::Pallet<Runtime>;
 }
 
 impl pallet_utility::Config for Runtime {
diff --git a/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs b/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs
index c3e105a84fb..0ee3a406871 100644
--- a/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs
+++ b/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs
@@ -258,6 +258,7 @@ impl pallet_multisig::Config for Runtime {
 	type DepositFactor = DepositFactor;
 	type MaxSignatories = ConstU32<100>;
 	type WeightInfo = weights::pallet_multisig::WeightInfo<Runtime>;
+	type BlockNumberProvider = frame_system::Pallet<Runtime>;
 }
 
 impl pallet_utility::Config for Runtime {
@@ -382,6 +383,7 @@ impl pallet_proxy::Config for Runtime {
 	type CallHasher = BlakeTwo256;
 	type AnnouncementDepositBase = AnnouncementDepositBase;
 	type AnnouncementDepositFactor = AnnouncementDepositFactor;
+	type BlockNumberProvider = frame_system::Pallet<Runtime>;
 }
 
 parameter_types! {
diff --git a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs
index f661a8bdccf..2951662a979 100644
--- a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs
+++ b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs
@@ -268,6 +268,7 @@ impl pallet_multisig::Config for Runtime {
 	type DepositFactor = DepositFactor;
 	type MaxSignatories = ConstU32<100>;
 	type WeightInfo = pallet_multisig::weights::SubstrateWeight<Runtime>;
+	type BlockNumberProvider = frame_system::Pallet<Runtime>;
 }
 
 impl pallet_utility::Config for Runtime {
diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs
index 31700c2e25f..3f3126b749d 100644
--- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs
+++ b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs
@@ -445,6 +445,7 @@ impl pallet_multisig::Config for Runtime {
 	type DepositFactor = DepositFactor;
 	type MaxSignatories = ConstU32<100>;
 	type WeightInfo = weights::pallet_multisig::WeightInfo<Runtime>;
+	type BlockNumberProvider = frame_system::Pallet<Runtime>;
 }
 
 /// The type used to represent the kinds of proxying allowed.
@@ -577,6 +578,7 @@ impl pallet_proxy::Config for Runtime {
 	type CallHasher = BlakeTwo256;
 	type AnnouncementDepositBase = AnnouncementDepositBase;
 	type AnnouncementDepositFactor = AnnouncementDepositFactor;
+	type BlockNumberProvider = frame_system::Pallet<Runtime>;
 }
 
 impl pallet_utility::Config for Runtime {
diff --git a/cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs b/cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs
index 1f0f54884fa..098a17cc998 100644
--- a/cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs
+++ b/cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs
@@ -446,6 +446,7 @@ impl pallet_multisig::Config for Runtime {
 	type DepositFactor = DepositFactor;
 	type MaxSignatories = ConstU32<100>;
 	type WeightInfo = weights::pallet_multisig::WeightInfo<Runtime>;
+	type BlockNumberProvider = frame_system::Pallet<Runtime>;
 }
 
 /// The type used to represent the kinds of proxying allowed.
@@ -578,6 +579,7 @@ impl pallet_proxy::Config for Runtime {
 	type CallHasher = BlakeTwo256;
 	type AnnouncementDepositBase = AnnouncementDepositBase;
 	type AnnouncementDepositFactor = AnnouncementDepositFactor;
+	type BlockNumberProvider = frame_system::Pallet<Runtime>;
 }
 
 impl pallet_utility::Config for Runtime {
diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/lib.rs b/cumulus/parachains/runtimes/people/people-rococo/src/lib.rs
index 25356a84806..7921030f2bb 100644
--- a/cumulus/parachains/runtimes/people/people-rococo/src/lib.rs
+++ b/cumulus/parachains/runtimes/people/people-rococo/src/lib.rs
@@ -407,6 +407,7 @@ impl pallet_multisig::Config for Runtime {
 	type DepositFactor = DepositFactor;
 	type MaxSignatories = ConstU32<100>;
 	type WeightInfo = weights::pallet_multisig::WeightInfo<Runtime>;
+	type BlockNumberProvider = frame_system::Pallet<Runtime>;
 }
 
 /// The type used to represent the kinds of proxying allowed.
@@ -520,6 +521,7 @@ impl pallet_proxy::Config for Runtime {
 	type CallHasher = BlakeTwo256;
 	type AnnouncementDepositBase = AnnouncementDepositBase;
 	type AnnouncementDepositFactor = AnnouncementDepositFactor;
+	type BlockNumberProvider = frame_system::Pallet<Runtime>;
 }
 
 impl pallet_utility::Config for Runtime {
diff --git a/cumulus/parachains/runtimes/people/people-westend/src/lib.rs b/cumulus/parachains/runtimes/people/people-westend/src/lib.rs
index 1c5183636c4..19a64ab8d6e 100644
--- a/cumulus/parachains/runtimes/people/people-westend/src/lib.rs
+++ b/cumulus/parachains/runtimes/people/people-westend/src/lib.rs
@@ -406,6 +406,7 @@ impl pallet_multisig::Config for Runtime {
 	type DepositFactor = DepositFactor;
 	type MaxSignatories = ConstU32<100>;
 	type WeightInfo = weights::pallet_multisig::WeightInfo<Runtime>;
+	type BlockNumberProvider = frame_system::Pallet<Runtime>;
 }
 
 /// The type used to represent the kinds of proxying allowed.
@@ -519,6 +520,7 @@ impl pallet_proxy::Config for Runtime {
 	type CallHasher = BlakeTwo256;
 	type AnnouncementDepositBase = AnnouncementDepositBase;
 	type AnnouncementDepositFactor = AnnouncementDepositFactor;
+	type BlockNumberProvider = frame_system::Pallet<Runtime>;
 }
 
 impl pallet_utility::Config for Runtime {
diff --git a/polkadot/runtime/rococo/src/lib.rs b/polkadot/runtime/rococo/src/lib.rs
index 96a97faa475..5da9da86f02 100644
--- a/polkadot/runtime/rococo/src/lib.rs
+++ b/polkadot/runtime/rococo/src/lib.rs
@@ -767,6 +767,7 @@ impl pallet_multisig::Config for Runtime {
 	type DepositFactor = DepositFactor;
 	type MaxSignatories = MaxSignatories;
 	type WeightInfo = weights::pallet_multisig::WeightInfo<Runtime>;
+	type BlockNumberProvider = frame_system::Pallet<Runtime>;
 }
 
 parameter_types! {
@@ -971,6 +972,7 @@ impl pallet_proxy::Config for Runtime {
 	type CallHasher = BlakeTwo256;
 	type AnnouncementDepositBase = AnnouncementDepositBase;
 	type AnnouncementDepositFactor = AnnouncementDepositFactor;
+	type BlockNumberProvider = frame_system::Pallet<Runtime>;
 }
 
 impl parachains_origin::Config for Runtime {}
diff --git a/polkadot/runtime/westend/src/lib.rs b/polkadot/runtime/westend/src/lib.rs
index 7a5562cc98c..9f0b701f20b 100644
--- a/polkadot/runtime/westend/src/lib.rs
+++ b/polkadot/runtime/westend/src/lib.rs
@@ -1004,6 +1004,7 @@ impl pallet_multisig::Config for Runtime {
 	type DepositFactor = DepositFactor;
 	type MaxSignatories = MaxSignatories;
 	type WeightInfo = weights::pallet_multisig::WeightInfo<Runtime>;
+	type BlockNumberProvider = frame_system::Pallet<Runtime>;
 }
 
 parameter_types! {
@@ -1204,6 +1205,7 @@ impl pallet_proxy::Config for Runtime {
 	type CallHasher = BlakeTwo256;
 	type AnnouncementDepositBase = AnnouncementDepositBase;
 	type AnnouncementDepositFactor = AnnouncementDepositFactor;
+	type BlockNumberProvider = frame_system::Pallet<Runtime>;
 }
 
 impl parachains_origin::Config for Runtime {}
diff --git a/prdoc/pr_5723.prdoc b/prdoc/pr_5723.prdoc
new file mode 100644
index 00000000000..ded5f9cebd1
--- /dev/null
+++ b/prdoc/pr_5723.prdoc
@@ -0,0 +1,24 @@
+title: Adds `BlockNumberProvider` in multisig, proxy and nft pallets
+
+doc:
+  - audience: Runtime Dev
+    description: |
+      This PR adds the ability for these pallets to specify their source of the block number.
+      This is useful when these pallets are migrated from the relay chain to a parachain and 
+      vice versa.
+
+      This change is backwards compatible:
+      1. If the `BlockNumberProvider` continues to use the system pallet's block number
+      2. When a pallet deployed on the relay chain is moved to a parachain, but still uses the 
+      relay chain's block number
+
+      However, we would need migrations if the deployed pallets are upgraded on an existing parachain,
+      and the `BlockNumberProvider` uses the relay chain block number.  
+
+crates:
+  - name: pallet-multisig
+    bump: major
+  - name: pallet-proxy
+    bump: major
+  - name: pallet-nfts
+    bump: major
diff --git a/substrate/bin/node/runtime/src/lib.rs b/substrate/bin/node/runtime/src/lib.rs
index e68e0484077..bff26354808 100644
--- a/substrate/bin/node/runtime/src/lib.rs
+++ b/substrate/bin/node/runtime/src/lib.rs
@@ -392,6 +392,7 @@ impl pallet_multisig::Config for Runtime {
 	type DepositFactor = DepositFactor;
 	type MaxSignatories = ConstU32<100>;
 	type WeightInfo = pallet_multisig::weights::SubstrateWeight<Runtime>;
+	type BlockNumberProvider = frame_system::Pallet<Runtime>;
 }
 
 parameter_types! {
@@ -479,6 +480,7 @@ impl pallet_proxy::Config for Runtime {
 	type CallHasher = BlakeTwo256;
 	type AnnouncementDepositBase = AnnouncementDepositBase;
 	type AnnouncementDepositFactor = AnnouncementDepositFactor;
+	type BlockNumberProvider = frame_system::Pallet<Runtime>;
 }
 
 parameter_types! {
@@ -2048,6 +2050,7 @@ impl pallet_nfts::Config for Runtime {
 	type Helper = ();
 	type CreateOrigin = AsEnsureOriginWithArg<EnsureSigned<AccountId>>;
 	type Locker = ();
+	type BlockNumberProvider = frame_system::Pallet<Runtime>;
 }
 
 impl pallet_transaction_storage::Config for Runtime {
diff --git a/substrate/frame/contracts/src/tests.rs b/substrate/frame/contracts/src/tests.rs
index c3b6e3273f3..b01d0aa4fa4 100644
--- a/substrate/frame/contracts/src/tests.rs
+++ b/substrate/frame/contracts/src/tests.rs
@@ -399,6 +399,7 @@ impl pallet_proxy::Config for Test {
 	type CallHasher = BlakeTwo256;
 	type AnnouncementDepositBase = ConstU64<1>;
 	type AnnouncementDepositFactor = ConstU64<1>;
+	type BlockNumberProvider = frame_system::Pallet<Test>;
 }
 
 impl pallet_dummy::Config for Test {}
diff --git a/substrate/frame/multisig/src/lib.rs b/substrate/frame/multisig/src/lib.rs
index 4a30b5c119b..869b4adc2ad 100644
--- a/substrate/frame/multisig/src/lib.rs
+++ b/substrate/frame/multisig/src/lib.rs
@@ -77,6 +77,9 @@ macro_rules! log {
 type BalanceOf<T> =
 	<<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance;
 
+pub type BlockNumberFor<T> =
+	<<T as Config>::BlockNumberProvider as BlockNumberProvider>::BlockNumber;
+
 /// A global extrinsic index, formed as the extrinsic index within a block, together with that
 /// block's height. This allows a transaction in which a multisig operation of a particular
 /// composite was created to be uniquely identified.
@@ -153,6 +156,9 @@ pub mod pallet {
 
 		/// Weight information for extrinsics in this pallet.
 		type WeightInfo: weights::WeightInfo;
+
+		/// Provider for the block number. Normally this is the `frame_system` pallet.
+		type BlockNumberProvider: BlockNumberProvider;
 	}
 
 	/// The in-code storage version.
@@ -235,7 +241,7 @@ pub mod pallet {
 	}
 
 	#[pallet::hooks]
-	impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
+	impl<T: Config> Hooks<frame_system::pallet_prelude::BlockNumberFor<T>> for Pallet<T> {}
 
 	#[pallet::call]
 	impl<T: Config> Pallet<T> {
@@ -626,7 +632,7 @@ impl<T: Config> Pallet<T> {
 	/// The current `Timepoint`.
 	pub fn timepoint() -> Timepoint<BlockNumberFor<T>> {
 		Timepoint {
-			height: <frame_system::Pallet<T>>::block_number(),
+			height: T::BlockNumberProvider::current_block_number(),
 			index: <frame_system::Pallet<T>>::extrinsic_index().unwrap_or_default(),
 		}
 	}
diff --git a/substrate/frame/multisig/src/tests.rs b/substrate/frame/multisig/src/tests.rs
index c5a98845270..4065ce73f90 100644
--- a/substrate/frame/multisig/src/tests.rs
+++ b/substrate/frame/multisig/src/tests.rs
@@ -66,6 +66,7 @@ impl Config for Test {
 	type DepositFactor = ConstU64<1>;
 	type MaxSignatories = ConstU32<3>;
 	type WeightInfo = ();
+	type BlockNumberProvider = frame_system::Pallet<Test>;
 }
 
 use pallet_balances::Call as BalancesCall;
diff --git a/substrate/frame/nft-fractionalization/src/mock.rs b/substrate/frame/nft-fractionalization/src/mock.rs
index 50b41b5fc64..762c1776e30 100644
--- a/substrate/frame/nft-fractionalization/src/mock.rs
+++ b/substrate/frame/nft-fractionalization/src/mock.rs
@@ -115,6 +115,7 @@ impl pallet_nfts::Config for Test {
 	type OffchainSignature = Signature;
 	type OffchainPublic = AccountPublic;
 	type WeightInfo = ();
+	type BlockNumberProvider = frame_system::Pallet<Test>;
 	pallet_nfts::runtime_benchmarks_enabled! {
 		type Helper = ();
 	}
diff --git a/substrate/frame/nfts/src/benchmarking.rs b/substrate/frame/nfts/src/benchmarking.rs
index bc81096b459..81828be5fa0 100644
--- a/substrate/frame/nfts/src/benchmarking.rs
+++ b/substrate/frame/nfts/src/benchmarking.rs
@@ -29,7 +29,7 @@ use frame_support::{
 	traits::{EnsureOrigin, Get, UnfilteredDispatchable},
 	BoundedVec,
 };
-use frame_system::{pallet_prelude::BlockNumberFor, RawOrigin as SystemOrigin};
+use frame_system::RawOrigin as SystemOrigin;
 use sp_runtime::traits::{Bounded, One};
 
 use crate::Pallet as Nfts;
@@ -577,7 +577,7 @@ benchmarks_instance_pallet! {
 		let (item, ..) = mint_item::<T, I>(0);
 		let delegate: T::AccountId = account("delegate", 0, SEED);
 		let delegate_lookup = T::Lookup::unlookup(delegate.clone());
-		let deadline = BlockNumberFor::<T>::max_value();
+		let deadline = BlockNumberFor::<T, I>::max_value();
 	}: _(SystemOrigin::Signed(caller.clone()), collection, item, delegate_lookup, Some(deadline))
 	verify {
 		assert_last_event::<T, I>(Event::TransferApproved { collection, item, owner: caller, delegate, deadline: Some(deadline) }.into());
@@ -589,7 +589,7 @@ benchmarks_instance_pallet! {
 		let delegate: T::AccountId = account("delegate", 0, SEED);
 		let delegate_lookup = T::Lookup::unlookup(delegate.clone());
 		let origin = SystemOrigin::Signed(caller.clone()).into();
-		let deadline = BlockNumberFor::<T>::max_value();
+		let deadline = BlockNumberFor::<T, I>::max_value();
 		Nfts::<T, I>::approve_transfer(origin, collection, item, delegate_lookup.clone(), Some(deadline))?;
 	}: _(SystemOrigin::Signed(caller.clone()), collection, item, delegate_lookup)
 	verify {
@@ -602,7 +602,7 @@ benchmarks_instance_pallet! {
 		let delegate: T::AccountId = account("delegate", 0, SEED);
 		let delegate_lookup = T::Lookup::unlookup(delegate.clone());
 		let origin = SystemOrigin::Signed(caller.clone()).into();
-		let deadline = BlockNumberFor::<T>::max_value();
+		let deadline = BlockNumberFor::<T, I>::max_value();
 		Nfts::<T, I>::approve_transfer(origin, collection, item, delegate_lookup.clone(), Some(deadline))?;
 	}: _(SystemOrigin::Signed(caller.clone()), collection, item)
 	verify {
@@ -712,10 +712,10 @@ benchmarks_instance_pallet! {
 		let price_direction = PriceDirection::Receive;
 		let price_with_direction = PriceWithDirection { amount: price, direction: price_direction };
 		let duration = T::MaxDeadlineDuration::get();
-		frame_system::Pallet::<T>::set_block_number(One::one());
+		T::BlockNumberProvider::set_block_number(One::one());
 	}: _(SystemOrigin::Signed(caller.clone()), collection, item1, collection, Some(item2), Some(price_with_direction.clone()), duration)
 	verify {
-		let current_block = frame_system::Pallet::<T>::block_number();
+		let current_block = T::BlockNumberProvider::current_block_number();
 		assert_last_event::<T, I>(Event::SwapCreated {
 			offered_collection: collection,
 			offered_item: item1,
@@ -735,7 +735,7 @@ benchmarks_instance_pallet! {
 		let duration = T::MaxDeadlineDuration::get();
 		let price_direction = PriceDirection::Receive;
 		let price_with_direction = PriceWithDirection { amount: price, direction: price_direction };
-		frame_system::Pallet::<T>::set_block_number(One::one());
+		T::BlockNumberProvider::set_block_number(One::one());
 		Nfts::<T, I>::create_swap(origin, collection, item1, collection, Some(item2), Some(price_with_direction.clone()), duration)?;
 	}: _(SystemOrigin::Signed(caller.clone()), collection, item1)
 	verify {
@@ -761,7 +761,7 @@ benchmarks_instance_pallet! {
 		let target_lookup = T::Lookup::unlookup(target.clone());
 		T::Currency::make_free_balance_be(&target, T::Currency::minimum_balance());
 		let origin = SystemOrigin::Signed(caller.clone());
-		frame_system::Pallet::<T>::set_block_number(One::one());
+		T::BlockNumberProvider::set_block_number(One::one());
 		Nfts::<T, I>::transfer(origin.clone().into(), collection, item2, target_lookup)?;
 		Nfts::<T, I>::create_swap(
 			origin.clone().into(),
@@ -774,7 +774,7 @@ benchmarks_instance_pallet! {
 		)?;
 	}: _(SystemOrigin::Signed(target.clone()), collection, item2, collection, item1, Some(price_with_direction.clone()))
 	verify {
-		let current_block = frame_system::Pallet::<T>::block_number();
+		let current_block = T::BlockNumberProvider::current_block_number();
 		assert_last_event::<T, I>(Event::SwapClaimed {
 			sent_collection: collection,
 			sent_item: item2,
@@ -822,7 +822,7 @@ benchmarks_instance_pallet! {
 
 		let target: T::AccountId = account("target", 0, SEED);
 		T::Currency::make_free_balance_be(&target, DepositBalanceOf::<T, I>::max_value());
-		frame_system::Pallet::<T>::set_block_number(One::one());
+		T::BlockNumberProvider::set_block_number(One::one());
 	}: _(SystemOrigin::Signed(target.clone()), Box::new(mint_data), signature.into(), caller)
 	verify {
 		let metadata: BoundedVec<_, _> = metadata.try_into().unwrap();
@@ -865,7 +865,7 @@ benchmarks_instance_pallet! {
 		let message = Encode::encode(&pre_signed_data);
 		let signature = T::Helper::sign(&signer_public, &message);
 
-		frame_system::Pallet::<T>::set_block_number(One::one());
+		T::BlockNumberProvider::set_block_number(One::one());
 	}: _(SystemOrigin::Signed(item_owner.clone()), pre_signed_data, signature.into(), signer.clone())
 	verify {
 		assert_last_event::<T, I>(
diff --git a/substrate/frame/nfts/src/features/approvals.rs b/substrate/frame/nfts/src/features/approvals.rs
index 053fa67163b..4738f69f83c 100644
--- a/substrate/frame/nfts/src/features/approvals.rs
+++ b/substrate/frame/nfts/src/features/approvals.rs
@@ -46,7 +46,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
 		collection: T::CollectionId,
 		item: T::ItemId,
 		delegate: T::AccountId,
-		maybe_deadline: Option<frame_system::pallet_prelude::BlockNumberFor<T>>,
+		maybe_deadline: Option<BlockNumberFor<T, I>>,
 	) -> DispatchResult {
 		ensure!(
 			Self::is_pallet_feature_enabled(PalletFeature::Approvals),
@@ -65,7 +65,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
 			ensure!(check_origin == details.owner, Error::<T, I>::NoPermission);
 		}
 
-		let now = frame_system::Pallet::<T>::block_number();
+		let now = T::BlockNumberProvider::current_block_number();
 		let deadline = maybe_deadline.map(|d| d.saturating_add(now));
 
 		details
@@ -111,7 +111,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
 		let maybe_deadline = details.approvals.get(&delegate).ok_or(Error::<T, I>::NotDelegate)?;
 
 		let is_past_deadline = if let Some(deadline) = maybe_deadline {
-			let now = frame_system::Pallet::<T>::block_number();
+			let now = T::BlockNumberProvider::current_block_number();
 			now > *deadline
 		} else {
 			false
diff --git a/substrate/frame/nfts/src/features/atomic_swap.rs b/substrate/frame/nfts/src/features/atomic_swap.rs
index 830283b73c2..03ebd35b81b 100644
--- a/substrate/frame/nfts/src/features/atomic_swap.rs
+++ b/substrate/frame/nfts/src/features/atomic_swap.rs
@@ -53,7 +53,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
 		desired_collection_id: T::CollectionId,
 		maybe_desired_item_id: Option<T::ItemId>,
 		maybe_price: Option<PriceWithDirection<ItemPrice<T, I>>>,
-		duration: frame_system::pallet_prelude::BlockNumberFor<T>,
+		duration: BlockNumberFor<T, I>,
 	) -> DispatchResult {
 		ensure!(
 			Self::is_pallet_feature_enabled(PalletFeature::Swaps),
@@ -76,7 +76,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
 			),
 		};
 
-		let now = frame_system::Pallet::<T>::block_number();
+		let now = T::BlockNumberProvider::current_block_number();
 		let deadline = duration.saturating_add(now);
 
 		PendingSwapOf::<T, I>::insert(
@@ -119,7 +119,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
 		let swap = PendingSwapOf::<T, I>::get(&offered_collection_id, &offered_item_id)
 			.ok_or(Error::<T, I>::UnknownSwap)?;
 
-		let now = frame_system::Pallet::<T>::block_number();
+		let now = T::BlockNumberProvider::current_block_number();
 		if swap.deadline > now {
 			let item = Item::<T, I>::get(&offered_collection_id, &offered_item_id)
 				.ok_or(Error::<T, I>::UnknownItem)?;
@@ -187,7 +187,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
 			ensure!(desired_item == send_item_id, Error::<T, I>::UnknownSwap);
 		}
 
-		let now = frame_system::Pallet::<T>::block_number();
+		let now = T::BlockNumberProvider::current_block_number();
 		ensure!(now <= swap.deadline, Error::<T, I>::DeadlineExpired);
 
 		if let Some(ref price) = swap.price {
diff --git a/substrate/frame/nfts/src/features/attributes.rs b/substrate/frame/nfts/src/features/attributes.rs
index 28f7bd2c58c..2cd09f7d219 100644
--- a/substrate/frame/nfts/src/features/attributes.rs
+++ b/substrate/frame/nfts/src/features/attributes.rs
@@ -225,7 +225,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
 			Error::<T, I>::MaxAttributesLimitReached
 		);
 
-		let now = frame_system::Pallet::<T>::block_number();
+		let now = T::BlockNumberProvider::current_block_number();
 		ensure!(deadline >= now, Error::<T, I>::DeadlineExpired);
 
 		let item_details =
diff --git a/substrate/frame/nfts/src/features/create_delete_item.rs b/substrate/frame/nfts/src/features/create_delete_item.rs
index 37f64ae1b1b..57366127f14 100644
--- a/substrate/frame/nfts/src/features/create_delete_item.rs
+++ b/substrate/frame/nfts/src/features/create_delete_item.rs
@@ -145,7 +145,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
 			ensure!(account == mint_to, Error::<T, I>::WrongOrigin);
 		}
 
-		let now = frame_system::Pallet::<T>::block_number();
+		let now = T::BlockNumberProvider::current_block_number();
 		ensure!(deadline >= now, Error::<T, I>::DeadlineExpired);
 
 		ensure!(
diff --git a/substrate/frame/nfts/src/features/settings.rs b/substrate/frame/nfts/src/features/settings.rs
index d4f7533ffa4..48719ae2c20 100644
--- a/substrate/frame/nfts/src/features/settings.rs
+++ b/substrate/frame/nfts/src/features/settings.rs
@@ -96,11 +96,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
 	pub(crate) fn do_update_mint_settings(
 		maybe_check_origin: Option<T::AccountId>,
 		collection: T::CollectionId,
-		mint_settings: MintSettings<
-			BalanceOf<T, I>,
-			frame_system::pallet_prelude::BlockNumberFor<T>,
-			T::CollectionId,
-		>,
+		mint_settings: MintSettings<BalanceOf<T, I>, BlockNumberFor<T, I>, T::CollectionId>,
 	) -> DispatchResult {
 		if let Some(check_origin) = &maybe_check_origin {
 			ensure!(
diff --git a/substrate/frame/nfts/src/lib.rs b/substrate/frame/nfts/src/lib.rs
index 4e5493a3c75..346ad162c50 100644
--- a/substrate/frame/nfts/src/lib.rs
+++ b/substrate/frame/nfts/src/lib.rs
@@ -58,7 +58,7 @@ use frame_support::traits::{
 };
 use frame_system::Config as SystemConfig;
 use sp_runtime::{
-	traits::{IdentifyAccount, Saturating, StaticLookup, Verify, Zero},
+	traits::{BlockNumberProvider, IdentifyAccount, Saturating, StaticLookup, Verify, Zero},
 	RuntimeDebug,
 };
 
@@ -76,7 +76,7 @@ type AccountIdLookupOf<T> = <<T as SystemConfig>::Lookup as StaticLookup>::Sourc
 pub mod pallet {
 	use super::*;
 	use frame_support::{pallet_prelude::*, traits::ExistenceRequirement};
-	use frame_system::pallet_prelude::*;
+	use frame_system::{ensure_signed, pallet_prelude::OriginFor};
 
 	/// The in-code storage version.
 	const STORAGE_VERSION: StorageVersion = StorageVersion::new(1);
@@ -210,7 +210,7 @@ pub mod pallet {
 
 		/// The max duration in blocks for deadlines.
 		#[pallet::constant]
-		type MaxDeadlineDuration: Get<BlockNumberFor<Self>>;
+		type MaxDeadlineDuration: Get<BlockNumberFor<Self, I>>;
 
 		/// The max number of attributes a user could set per call.
 		#[pallet::constant]
@@ -242,6 +242,9 @@ pub mod pallet {
 
 		/// Weight information for extrinsics in this pallet.
 		type WeightInfo: WeightInfo;
+
+		/// Provider for the block number. Normally this is the `frame_system` pallet.
+		type BlockNumberProvider: BlockNumberProvider;
 	}
 
 	/// Details of a collection.
@@ -388,7 +391,7 @@ pub mod pallet {
 			T::CollectionId,
 			T::ItemId,
 			PriceWithDirection<ItemPrice<T, I>>,
-			BlockNumberFor<T>,
+			BlockNumberFor<T, I>,
 		>,
 		OptionQuery,
 	>;
@@ -459,7 +462,7 @@ pub mod pallet {
 			item: T::ItemId,
 			owner: T::AccountId,
 			delegate: T::AccountId,
-			deadline: Option<BlockNumberFor<T>>,
+			deadline: Option<BlockNumberFor<T, I>>,
 		},
 		/// An approval for a `delegate` account to transfer the `item` of an item
 		/// `collection` was cancelled by its `owner`.
@@ -554,7 +557,7 @@ pub mod pallet {
 			desired_collection: T::CollectionId,
 			desired_item: Option<T::ItemId>,
 			price: Option<PriceWithDirection<ItemPrice<T, I>>>,
-			deadline: BlockNumberFor<T>,
+			deadline: BlockNumberFor<T, I>,
 		},
 		/// The swap was cancelled.
 		SwapCancelled {
@@ -563,7 +566,7 @@ pub mod pallet {
 			desired_collection: T::CollectionId,
 			desired_item: Option<T::ItemId>,
 			price: Option<PriceWithDirection<ItemPrice<T, I>>>,
-			deadline: BlockNumberFor<T>,
+			deadline: BlockNumberFor<T, I>,
 		},
 		/// The swap has been claimed.
 		SwapClaimed {
@@ -574,7 +577,7 @@ pub mod pallet {
 			received_item: T::ItemId,
 			received_item_owner: T::AccountId,
 			price: Option<PriceWithDirection<ItemPrice<T, I>>>,
-			deadline: BlockNumberFor<T>,
+			deadline: BlockNumberFor<T, I>,
 		},
 		/// New attributes have been set for an `item` of the `collection`.
 		PreSignedAttributesSet {
@@ -857,7 +860,7 @@ pub mod pallet {
 				item_config,
 				|collection_details, collection_config| {
 					let mint_settings = collection_config.mint_settings;
-					let now = frame_system::Pallet::<T>::block_number();
+					let now = T::BlockNumberProvider::current_block_number();
 
 					if let Some(start_block) = mint_settings.start_block {
 						ensure!(start_block <= now, Error::<T, I>::MintNotStarted);
@@ -1029,7 +1032,7 @@ pub mod pallet {
 					let deadline =
 						details.approvals.get(&origin).ok_or(Error::<T, I>::NoPermission)?;
 					if let Some(d) = deadline {
-						let block_number = frame_system::Pallet::<T>::block_number();
+						let block_number = T::BlockNumberProvider::current_block_number();
 						ensure!(block_number <= *d, Error::<T, I>::ApprovalExpired);
 					}
 				}
@@ -1290,7 +1293,7 @@ pub mod pallet {
 			collection: T::CollectionId,
 			item: T::ItemId,
 			delegate: AccountIdLookupOf<T>,
-			maybe_deadline: Option<BlockNumberFor<T>>,
+			maybe_deadline: Option<BlockNumberFor<T, I>>,
 		) -> DispatchResult {
 			let maybe_check_origin = T::ForceOrigin::try_origin(origin)
 				.map(|_| None)
@@ -1713,7 +1716,7 @@ pub mod pallet {
 		pub fn update_mint_settings(
 			origin: OriginFor<T>,
 			collection: T::CollectionId,
-			mint_settings: MintSettings<BalanceOf<T, I>, BlockNumberFor<T>, T::CollectionId>,
+			mint_settings: MintSettings<BalanceOf<T, I>, BlockNumberFor<T, I>, T::CollectionId>,
 		) -> DispatchResult {
 			let maybe_check_origin = T::ForceOrigin::try_origin(origin)
 				.map(|_| None)
@@ -1809,7 +1812,7 @@ pub mod pallet {
 			desired_collection: T::CollectionId,
 			maybe_desired_item: Option<T::ItemId>,
 			maybe_price: Option<PriceWithDirection<ItemPrice<T, I>>>,
-			duration: BlockNumberFor<T>,
+			duration: BlockNumberFor<T, I>,
 		) -> DispatchResult {
 			let origin = ensure_signed(origin)?;
 			Self::do_create_swap(
diff --git a/substrate/frame/nfts/src/mock.rs b/substrate/frame/nfts/src/mock.rs
index 5b589f591ca..291c3c08133 100644
--- a/substrate/frame/nfts/src/mock.rs
+++ b/substrate/frame/nfts/src/mock.rs
@@ -92,6 +92,7 @@ impl Config for Test {
 	type WeightInfo = ();
 	#[cfg(feature = "runtime-benchmarks")]
 	type Helper = ();
+	type BlockNumberProvider = frame_system::Pallet<Test>;
 }
 
 pub(crate) fn new_test_ext() -> sp_io::TestExternalities {
diff --git a/substrate/frame/nfts/src/types.rs b/substrate/frame/nfts/src/types.rs
index d67fb404ea7..3ab85993473 100644
--- a/substrate/frame/nfts/src/types.rs
+++ b/substrate/frame/nfts/src/types.rs
@@ -27,9 +27,11 @@ use frame_support::{
 	traits::Get,
 	BoundedBTreeMap, BoundedBTreeSet,
 };
-use frame_system::pallet_prelude::BlockNumberFor;
 use scale_info::{build::Fields, meta_type, Path, Type, TypeInfo, TypeParameter};
 
+pub type BlockNumberFor<T, I = ()> =
+	<<T as Config<I>>::BlockNumberProvider as BlockNumberProvider>::BlockNumber;
+
 /// A type alias for handling balance deposits.
 pub type DepositBalanceOf<T, I = ()> =
 	<<T as Config<I>>::Currency as Currency<<T as SystemConfig>::AccountId>>::Balance;
@@ -39,7 +41,7 @@ pub type CollectionDetailsFor<T, I> =
 /// A type alias for keeping track of approvals used by a single item.
 pub type ApprovalsOf<T, I = ()> = BoundedBTreeMap<
 	<T as SystemConfig>::AccountId,
-	Option<BlockNumberFor<T>>,
+	Option<BlockNumberFor<T, I>>,
 	<T as Config<I>>::ApprovalsLimit,
 >;
 /// A type alias for keeping track of approvals for an item's attributes.
@@ -70,13 +72,13 @@ pub type ItemTipOf<T, I = ()> = ItemTip<
 >;
 /// A type alias for the settings configuration of a collection.
 pub type CollectionConfigFor<T, I = ()> =
-	CollectionConfig<BalanceOf<T, I>, BlockNumberFor<T>, <T as Config<I>>::CollectionId>;
+	CollectionConfig<BalanceOf<T, I>, BlockNumberFor<T, I>, <T as Config<I>>::CollectionId>;
 /// A type alias for the pre-signed minting configuration for a specified collection.
 pub type PreSignedMintOf<T, I = ()> = PreSignedMint<
 	<T as Config<I>>::CollectionId,
 	<T as Config<I>>::ItemId,
 	<T as SystemConfig>::AccountId,
-	BlockNumberFor<T>,
+	BlockNumberFor<T, I>,
 	BalanceOf<T, I>,
 >;
 /// A type alias for the pre-signed minting configuration on the attribute level of an item.
@@ -84,7 +86,7 @@ pub type PreSignedAttributesOf<T, I = ()> = PreSignedAttributes<
 	<T as Config<I>>::CollectionId,
 	<T as Config<I>>::ItemId,
 	<T as SystemConfig>::AccountId,
-	BlockNumberFor<T>,
+	BlockNumberFor<T, I>,
 >;
 
 /// Information about a collection.
diff --git a/substrate/frame/proxy/src/benchmarking.rs b/substrate/frame/proxy/src/benchmarking.rs
index eebb506bf37..b72f53af8e7 100644
--- a/substrate/frame/proxy/src/benchmarking.rs
+++ b/substrate/frame/proxy/src/benchmarking.rs
@@ -22,7 +22,9 @@
 use super::*;
 use crate::Pallet as Proxy;
 use alloc::{boxed::Box, vec};
-use frame::benchmarking::prelude::*;
+use frame::benchmarking::prelude::{
+	account, benchmarks, impl_test_function, whitelisted_caller, BenchmarkError, RawOrigin,
+};
 
 const SEED: u32 = 0;
 
@@ -317,7 +319,7 @@ mod benchmarks {
 			BlockNumberFor::<T>::zero(),
 			0,
 		)?;
-		let height = frame_system::Pallet::<T>::block_number();
+		let height = T::BlockNumberProvider::current_block_number();
 		let ext_index = frame_system::Pallet::<T>::extrinsic_index().unwrap_or(0);
 		let pure_account = Pallet::<T>::pure_account(&caller, &T::ProxyType::default(), 0, None);
 
diff --git a/substrate/frame/proxy/src/lib.rs b/substrate/frame/proxy/src/lib.rs
index cc8aeedcc5f..cc21db7469b 100644
--- a/substrate/frame/proxy/src/lib.rs
+++ b/substrate/frame/proxy/src/lib.rs
@@ -47,6 +47,9 @@ type CallHashOf<T> = <<T as Config>::CallHasher as Hash>::Output;
 type BalanceOf<T> =
 	<<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance;
 
+pub type BlockNumberFor<T> =
+	<<T as Config>::BlockNumberProvider as BlockNumberProvider>::BlockNumber;
+
 type AccountIdLookupOf<T> = <<T as frame_system::Config>::Lookup as StaticLookup>::Source;
 
 /// The parameters under which a particular account has a proxy relationship with some other
@@ -163,6 +166,9 @@ pub mod pallet {
 		/// into a pre-existing storage value.
 		#[pallet::constant]
 		type AnnouncementDepositFactor: Get<BalanceOf<Self>>;
+
+		/// Provider for the block number. Normally this is the `frame_system` pallet.
+		type BlockNumberProvider: BlockNumberProvider;
 	}
 
 	#[pallet::call]
@@ -379,7 +385,7 @@ pub mod pallet {
 			let announcement = Announcement {
 				real: real.clone(),
 				call_hash,
-				height: frame_system::Pallet::<T>::block_number(),
+				height: T::BlockNumberProvider::current_block_number(),
 			};
 
 			Announcements::<T>::try_mutate(&who, |(ref mut pending, ref mut deposit)| {
@@ -490,7 +496,7 @@ pub mod pallet {
 			let def = Self::find_proxy(&real, &delegate, force_proxy_type)?;
 
 			let call_hash = T::CallHasher::hash_of(&call);
-			let now = frame_system::Pallet::<T>::block_number();
+			let now = T::BlockNumberProvider::current_block_number();
 			Self::edit_announcements(&delegate, |ann| {
 				ann.real != real ||
 					ann.call_hash != call_hash ||
@@ -626,7 +632,7 @@ impl<T: Config> Pallet<T> {
 	) -> T::AccountId {
 		let (height, ext_index) = maybe_when.unwrap_or_else(|| {
 			(
-				frame_system::Pallet::<T>::block_number(),
+				T::BlockNumberProvider::current_block_number(),
 				frame_system::Pallet::<T>::extrinsic_index().unwrap_or_default(),
 			)
 		});
diff --git a/substrate/frame/proxy/src/tests.rs b/substrate/frame/proxy/src/tests.rs
index 5baf9bb9e83..afc668188e6 100644
--- a/substrate/frame/proxy/src/tests.rs
+++ b/substrate/frame/proxy/src/tests.rs
@@ -119,6 +119,7 @@ impl Config for Test {
 	type MaxPending = ConstU32<2>;
 	type AnnouncementDepositBase = ConstU64<1>;
 	type AnnouncementDepositFactor = ConstU64<1>;
+	type BlockNumberProvider = frame_system::Pallet<Test>;
 }
 
 use super::{Call as ProxyCall, Event as ProxyEvent};
diff --git a/substrate/frame/revive/src/tests.rs b/substrate/frame/revive/src/tests.rs
index 177b8dff706..34afe8aabfe 100644
--- a/substrate/frame/revive/src/tests.rs
+++ b/substrate/frame/revive/src/tests.rs
@@ -416,6 +416,7 @@ impl pallet_proxy::Config for Test {
 	type CallHasher = BlakeTwo256;
 	type AnnouncementDepositBase = ConstU64<1>;
 	type AnnouncementDepositFactor = ConstU64<1>;
+	type BlockNumberProvider = frame_system::Pallet<Test>;
 }
 
 parameter_types! {
diff --git a/substrate/frame/safe-mode/src/mock.rs b/substrate/frame/safe-mode/src/mock.rs
index ec1ad824951..aaf3456272f 100644
--- a/substrate/frame/safe-mode/src/mock.rs
+++ b/substrate/frame/safe-mode/src/mock.rs
@@ -138,6 +138,7 @@ impl pallet_proxy::Config for Test {
 	type MaxPending = ConstU32<2>;
 	type AnnouncementDepositBase = ConstU64<1>;
 	type AnnouncementDepositFactor = ConstU64<1>;
+	type BlockNumberProvider = frame_system::Pallet<Test>;
 }
 
 /// The calls that can always bypass safe-mode.
diff --git a/substrate/frame/src/lib.rs b/substrate/frame/src/lib.rs
index 0ca36ca8545..03d815e349d 100644
--- a/substrate/frame/src/lib.rs
+++ b/substrate/frame/src/lib.rs
@@ -219,8 +219,8 @@ pub mod prelude {
 	/// Runtime traits
 	#[doc(no_inline)]
 	pub use sp_runtime::traits::{
-		Bounded, DispatchInfoOf, Dispatchable, SaturatedConversion, Saturating, StaticLookup,
-		TrailingZeroInput,
+		BlockNumberProvider, Bounded, DispatchInfoOf, Dispatchable, SaturatedConversion,
+		Saturating, StaticLookup, TrailingZeroInput,
 	};
 
 	/// Other error/result types for runtime
diff --git a/substrate/frame/tx-pause/src/mock.rs b/substrate/frame/tx-pause/src/mock.rs
index 84ce45e8352..fd9b3b552cc 100644
--- a/substrate/frame/tx-pause/src/mock.rs
+++ b/substrate/frame/tx-pause/src/mock.rs
@@ -105,6 +105,7 @@ impl pallet_proxy::Config for Test {
 	type MaxPending = ConstU32<2>;
 	type AnnouncementDepositBase = ConstU64<1>;
 	type AnnouncementDepositFactor = ConstU64<1>;
+	type BlockNumberProvider = frame_system::Pallet<Test>;
 }
 
 parameter_types! {
-- 
GitLab