From f4e79ac459306737f32785caeb6a14129f8e8dbf Mon Sep 17 00:00:00 2001 From: Puneet Saraswat Date: Wed, 13 Nov 2024 11:05:35 -0600 Subject: [PATCH 1/5] Verify timestamps against relay chain slot numbers via `OnTimestampSet`. --- runtime/frequency/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/frequency/src/lib.rs b/runtime/frequency/src/lib.rs index 026f04a641..2b05bae163 100644 --- a/runtime/frequency/src/lib.rs +++ b/runtime/frequency/src/lib.rs @@ -657,7 +657,7 @@ impl pallet_time_release::Config for Runtime { impl pallet_timestamp::Config for Runtime { /// A timestamp: milliseconds since the unix epoch. type Moment = u64; - type OnTimestampSet = (); + type OnTimestampSet = Aura; type MinimumPeriod = MinimumPeriod; type WeightInfo = weights::pallet_timestamp::SubstrateWeight; } From fbd8ca808987cd9bd23b84864191cf90e049ae8b Mon Sep 17 00:00:00 2001 From: Puneet Saraswat Date: Wed, 13 Nov 2024 11:51:56 -0600 Subject: [PATCH 2/5] update spec version --- runtime/frequency/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/frequency/src/lib.rs b/runtime/frequency/src/lib.rs index 2b05bae163..c84d0e217b 100644 --- a/runtime/frequency/src/lib.rs +++ b/runtime/frequency/src/lib.rs @@ -404,7 +404,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("frequency"), impl_name: create_runtime_str!("frequency"), authoring_version: 1, - spec_version: 131, + spec_version: 132, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -418,7 +418,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("frequency-testnet"), impl_name: create_runtime_str!("frequency"), authoring_version: 1, - spec_version: 131, + spec_version: 132, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, From f29b69a51fc6996e1030adbcf54f393bebcb20fc Mon Sep 17 00:00:00 2001 From: Puneet Saraswat Date: Fri, 15 Nov 2024 13:05:22 -0600 Subject: [PATCH 3/5] bump --- runtime/frequency/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/frequency/src/lib.rs b/runtime/frequency/src/lib.rs index d3a5736e6b..a98bfd2e27 100644 --- a/runtime/frequency/src/lib.rs +++ b/runtime/frequency/src/lib.rs @@ -402,7 +402,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("frequency"), impl_name: create_runtime_str!("frequency"), authoring_version: 1, - spec_version: 132, + spec_version: 133, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -416,7 +416,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("frequency-testnet"), impl_name: create_runtime_str!("frequency"), authoring_version: 1, - spec_version: 132, + spec_version: 133, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, From d88e14f01417037d9ecc62257670ecb3fa3d51ef Mon Sep 17 00:00:00 2001 From: Puneet Saraswat Date: Mon, 18 Nov 2024 13:07:52 -0600 Subject: [PATCH 4/5] fix issue with Aura not availabe in no-relay mode --- runtime/frequency/src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime/frequency/src/lib.rs b/runtime/frequency/src/lib.rs index a98bfd2e27..13815e7d24 100644 --- a/runtime/frequency/src/lib.rs +++ b/runtime/frequency/src/lib.rs @@ -655,7 +655,10 @@ impl pallet_time_release::Config for Runtime { impl pallet_timestamp::Config for Runtime { /// A timestamp: milliseconds since the unix epoch. type Moment = u64; + #[cfg(any(not(feature = "frequency-no-relay"), feature = "frequency-lint-check"))] type OnTimestampSet = Aura; + #[cfg(feature = "frequency-no-relay")] + type OnTimestampSet = (); type MinimumPeriod = MinimumPeriod; type WeightInfo = weights::pallet_timestamp::SubstrateWeight; } From 1fe2a414f1d6dfc092c3c43cffe0401a5d3c0378 Mon Sep 17 00:00:00 2001 From: Puneet Saraswat Date: Thu, 21 Nov 2024 08:04:18 -0600 Subject: [PATCH 5/5] address feedback --- runtime/frequency/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/frequency/src/lib.rs b/runtime/frequency/src/lib.rs index 13815e7d24..724bf36411 100644 --- a/runtime/frequency/src/lib.rs +++ b/runtime/frequency/src/lib.rs @@ -655,7 +655,7 @@ impl pallet_time_release::Config for Runtime { impl pallet_timestamp::Config for Runtime { /// A timestamp: milliseconds since the unix epoch. type Moment = u64; - #[cfg(any(not(feature = "frequency-no-relay"), feature = "frequency-lint-check"))] + #[cfg(not(feature = "frequency-no-relay"))] type OnTimestampSet = Aura; #[cfg(feature = "frequency-no-relay")] type OnTimestampSet = ();