diff --git a/substrate/Cargo.lock b/substrate/Cargo.lock
index d4185103f8c9693e928a81627c3e2d0d58c9724e..525f40cedc8dbde7820ddc172542406f68d0a96a 100644
--- a/substrate/Cargo.lock
+++ b/substrate/Cargo.lock
@@ -6864,6 +6864,7 @@ dependencies = [
  "sp-core",
  "sp-io",
  "sp-runtime",
+ "sp-std",
 ]
 
 [[package]]
diff --git a/substrate/bin/node-template/pallets/template/Cargo.toml b/substrate/bin/node-template/pallets/template/Cargo.toml
index ddf7c6e52fb2f5474fa2fc4f843f1351b7b343e0..818dc0bbc8c3c367d2ad0cdffc929c88cea6af82 100644
--- a/substrate/bin/node-template/pallets/template/Cargo.toml
+++ b/substrate/bin/node-template/pallets/template/Cargo.toml
@@ -20,6 +20,7 @@ scale-info = { version = "2.1.1", default-features = false, features = ["derive"
 frame-benchmarking = { version = "4.0.0-dev", default-features = false, optional = true, path = "../../../../frame/benchmarking" }
 frame-support = { version = "4.0.0-dev", default-features = false, path = "../../../../frame/support" }
 frame-system = { version = "4.0.0-dev", default-features = false, path = "../../../../frame/system" }
+sp-std = { version = "5.0.0", default-features = false, path = "../../../../primitives/std" }
 
 [dev-dependencies]
 sp-core = { version = "7.0.0", path = "../../../../primitives/core" }
diff --git a/substrate/bin/node-template/pallets/template/src/benchmarking.rs b/substrate/bin/node-template/pallets/template/src/benchmarking.rs
index 1790849970440f9fee204062d3617ff9a6f3c364..5a262417629c579c6ecf5ada30ae803217623766 100644
--- a/substrate/bin/node-template/pallets/template/src/benchmarking.rs
+++ b/substrate/bin/node-template/pallets/template/src/benchmarking.rs
@@ -1,19 +1,34 @@
 //! Benchmarking setup for pallet-template
-
+#![cfg(feature = "runtime-benchmarks")]
 use super::*;
 
 #[allow(unused)]
 use crate::Pallet as Template;
-use frame_benchmarking::v1::{benchmarks, whitelisted_caller};
+use frame_benchmarking::v2::*;
 use frame_system::RawOrigin;
 
-benchmarks! {
-	do_something {
-		let s in 0 .. 100;
+#[benchmarks]
+mod benchmarks {
+	use super::*;
+
+	#[benchmark]
+	fn do_something() {
+		let value = 100u32.into();
 		let caller: T::AccountId = whitelisted_caller();
-	}: _(RawOrigin::Signed(caller), s)
-	verify {
-		assert_eq!(Something::<T>::get(), Some(s));
+		#[extrinsic_call]
+		do_something(RawOrigin::Signed(caller), value);
+
+		assert_eq!(Something::<T>::get(), Some(value));
+	}
+
+	#[benchmark]
+	fn cause_error() {
+		Something::<T>::put(100u32);
+		let caller: T::AccountId = whitelisted_caller();
+		#[extrinsic_call]
+		cause_error(RawOrigin::Signed(caller));
+
+		assert_eq!(Something::<T>::get(), Some(101u32));
 	}
 
 	impl_benchmark_test_suite!(Template, crate::mock::new_test_ext(), crate::mock::Test);
diff --git a/substrate/bin/node-template/pallets/template/src/lib.rs b/substrate/bin/node-template/pallets/template/src/lib.rs
index 9f17623db328ff4acbec43325953e7bc0321d851..9550d3d546ccac33da789fa48fa07dc56abe4562 100644
--- a/substrate/bin/node-template/pallets/template/src/lib.rs
+++ b/substrate/bin/node-template/pallets/template/src/lib.rs
@@ -13,9 +13,12 @@ mod tests;
 
 #[cfg(feature = "runtime-benchmarks")]
 mod benchmarking;
+pub mod weights;
+pub use weights::*;
 
 #[frame_support::pallet]
 pub mod pallet {
+	use super::*;
 	use frame_support::pallet_prelude::*;
 	use frame_system::pallet_prelude::*;
 
@@ -27,6 +30,8 @@ pub mod pallet {
 	pub trait Config: frame_system::Config {
 		/// Because this pallet emits events, it depends on the runtime's definition of an event.
 		type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
+		/// Type representing the weight of this pallet
+		type WeightInfo: WeightInfo;
 	}
 
 	// The pallet's runtime storage items.
@@ -64,7 +69,7 @@ pub mod pallet {
 		/// An example dispatchable that takes a singles value as a parameter, writes the value to
 		/// storage and emits an event. This function must be dispatched by a signed extrinsic.
 		#[pallet::call_index(0)]
-		#[pallet::weight(10_000 + T::DbWeight::get().writes(1).ref_time())]
+		#[pallet::weight(T::WeightInfo::do_something())]
 		pub fn do_something(origin: OriginFor<T>, something: u32) -> DispatchResult {
 			// Check that the extrinsic was signed and get the signer.
 			// This function will return an error if the extrinsic is not signed.
@@ -82,7 +87,7 @@ pub mod pallet {
 
 		/// An example dispatchable that may throw a custom error.
 		#[pallet::call_index(1)]
-		#[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1).ref_time())]
+		#[pallet::weight(T::WeightInfo::cause_error())]
 		pub fn cause_error(origin: OriginFor<T>) -> DispatchResult {
 			let _who = ensure_signed(origin)?;
 
diff --git a/substrate/bin/node-template/pallets/template/src/mock.rs b/substrate/bin/node-template/pallets/template/src/mock.rs
index 91a1bf6ed5fc812a3995beb62ba74ec0461b3dfb..b4d6905378a5dafd54c1f302679a7aa73e8341ff 100644
--- a/substrate/bin/node-template/pallets/template/src/mock.rs
+++ b/substrate/bin/node-template/pallets/template/src/mock.rs
@@ -50,6 +50,7 @@ impl frame_system::Config for Test {
 
 impl pallet_template::Config for Test {
 	type RuntimeEvent = RuntimeEvent;
+	type WeightInfo = ();
 }
 
 // Build genesis storage according to the mock runtime.
diff --git a/substrate/bin/node-template/pallets/template/src/weights.rs b/substrate/bin/node-template/pallets/template/src/weights.rs
new file mode 100644
index 0000000000000000000000000000000000000000..952aba49bb3d4e2751747af40acd56796a382031
--- /dev/null
+++ b/substrate/bin/node-template/pallets/template/src/weights.rs
@@ -0,0 +1,91 @@
+
+//! Autogenerated weights for pallet_template
+//!
+//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
+//! DATE: 2023-04-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
+//! WORST CASE MAP SIZE: `1000000`
+//! HOSTNAME: `Alexs-MacBook-Pro-2.local`, CPU: `<UNKNOWN>`
+//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024
+
+// Executed Command:
+// ../../target/release/node-template
+// benchmark
+// pallet
+// --chain
+// dev
+// --pallet
+// pallet_template
+// --extrinsic
+// *
+// --steps=50
+// --repeat=20
+// --execution=wasm
+// --wasm-execution=compiled
+// --output
+// pallets/template/src/weights.rs
+// --template
+// ../../.maintain/frame-weight-template.hbs
+
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(unused_parens)]
+#![allow(unused_imports)]
+
+use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
+use sp_std::marker::PhantomData;
+
+/// Weight functions needed for pallet_template.
+pub trait WeightInfo {
+	fn do_something() -> Weight;
+	fn cause_error() -> Weight;
+}
+
+/// Weights for pallet_template using the Substrate node and recommended hardware.
+pub struct SubstrateWeight<T>(PhantomData<T>);
+impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
+	/// Storage: TemplateModule Something (r:0 w:1)
+	/// Proof: TemplateModule Something (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
+	fn do_something() -> Weight {
+		// Proof Size summary in bytes:
+		//  Measured:  `0`
+		//  Estimated: `0`
+		// Minimum execution time: 8_000_000 picoseconds.
+		Weight::from_parts(8_000_000, 0)
+			.saturating_add(T::DbWeight::get().writes(1_u64))
+	}
+	/// Storage: TemplateModule Something (r:1 w:1)
+	/// Proof: TemplateModule Something (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
+	fn cause_error() -> Weight {
+		// Proof Size summary in bytes:
+		//  Measured:  `32`
+		//  Estimated: `1489`
+		// Minimum execution time: 5_000_000 picoseconds.
+		Weight::from_parts(6_000_000, 1489)
+			.saturating_add(T::DbWeight::get().reads(1_u64))
+			.saturating_add(T::DbWeight::get().writes(1_u64))
+	}
+}
+
+// For backwards compatibility and tests
+impl WeightInfo for () {
+	/// Storage: TemplateModule Something (r:0 w:1)
+	/// Proof: TemplateModule Something (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
+	fn do_something() -> Weight {
+		// Proof Size summary in bytes:
+		//  Measured:  `0`
+		//  Estimated: `0`
+		// Minimum execution time: 8_000_000 picoseconds.
+		Weight::from_parts(8_000_000, 0)
+			.saturating_add(RocksDbWeight::get().writes(1_u64))
+	}
+	/// Storage: TemplateModule Something (r:1 w:1)
+	/// Proof: TemplateModule Something (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
+	fn cause_error() -> Weight {
+		// Proof Size summary in bytes:
+		//  Measured:  `32`
+		//  Estimated: `1489`
+		// Minimum execution time: 5_000_000 picoseconds.
+		Weight::from_parts(6_000_000, 1489)
+			.saturating_add(RocksDbWeight::get().reads(1_u64))
+			.saturating_add(RocksDbWeight::get().writes(1_u64))
+	}
+}
diff --git a/substrate/bin/node-template/runtime/src/lib.rs b/substrate/bin/node-template/runtime/src/lib.rs
index 50bcb67cb479088d23b784ba65da954c243d86ed..3dcf1b5564deca88ba8165e8c17b67ab5906ad65 100644
--- a/substrate/bin/node-template/runtime/src/lib.rs
+++ b/substrate/bin/node-template/runtime/src/lib.rs
@@ -270,6 +270,7 @@ impl pallet_sudo::Config for Runtime {
 /// Configure the pallet-template in pallets/template.
 impl pallet_template::Config for Runtime {
 	type RuntimeEvent = RuntimeEvent;
+	type WeightInfo = pallet_template::weights::SubstrateWeight<Runtime>;
 }
 
 // Create the runtime by composing the FRAME pallets that were previously configured.