From 306a6ae0d5b4f7875c4cad97503266df1b9c52ad Mon Sep 17 00:00:00 2001 From: librelois Date: Wed, 8 Nov 2023 16:49:30 +0100 Subject: [PATCH 1/3] Set parachain-system inherent weights hint to max block weights --- cumulus/pallets/parachain-system/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cumulus/pallets/parachain-system/src/lib.rs b/cumulus/pallets/parachain-system/src/lib.rs index bac1ee28a7ca..46bc632ec945 100644 --- a/cumulus/pallets/parachain-system/src/lib.rs +++ b/cumulus/pallets/parachain-system/src/lib.rs @@ -526,7 +526,7 @@ pub mod pallet { /// As a side effect, this function upgrades the current validation function /// if the appropriate time has come. #[pallet::call_index(0)] - #[pallet::weight((0, DispatchClass::Mandatory))] + #[pallet::weight((::BlockWeights::get().max_block, DispatchClass::Mandatory))] // TODO: This weight should be corrected. pub fn set_validation_data( origin: OriginFor, From 0f5def575b817174063e57cf8c0c21aab18e3845 Mon Sep 17 00:00:00 2001 From: librelois Date: Wed, 8 Nov 2023 17:13:06 +0100 Subject: [PATCH 2/3] add comment --- cumulus/pallets/parachain-system/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cumulus/pallets/parachain-system/src/lib.rs b/cumulus/pallets/parachain-system/src/lib.rs index 46bc632ec945..43e43c52e9e8 100644 --- a/cumulus/pallets/parachain-system/src/lib.rs +++ b/cumulus/pallets/parachain-system/src/lib.rs @@ -527,7 +527,10 @@ pub mod pallet { /// if the appropriate time has come. #[pallet::call_index(0)] #[pallet::weight((::BlockWeights::get().max_block, DispatchClass::Mandatory))] - // TODO: This weight should be corrected. + // It makes no sense to have a weight hint for mandatory inherents, because like hooks they must be + // executed regardless of the weight they consume. We just need to be sure that: + // - The returned `actual_weight` field is always Some. + // - The weight hint is always greather tha,n the returned `actual_weight`. pub fn set_validation_data( origin: OriginFor, data: ParachainInherentData, From 8a25b842ca65864217016a4c691a968a1e78f485 Mon Sep 17 00:00:00 2001 From: librelois Date: Wed, 8 Nov 2023 17:13:49 +0100 Subject: [PATCH 3/3] typo --- cumulus/pallets/parachain-system/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cumulus/pallets/parachain-system/src/lib.rs b/cumulus/pallets/parachain-system/src/lib.rs index 43e43c52e9e8..5afab5d49493 100644 --- a/cumulus/pallets/parachain-system/src/lib.rs +++ b/cumulus/pallets/parachain-system/src/lib.rs @@ -530,7 +530,7 @@ pub mod pallet { // It makes no sense to have a weight hint for mandatory inherents, because like hooks they must be // executed regardless of the weight they consume. We just need to be sure that: // - The returned `actual_weight` field is always Some. - // - The weight hint is always greather tha,n the returned `actual_weight`. + // - The weight hint is always greather than the returned `actual_weight`. pub fn set_validation_data( origin: OriginFor, data: ParachainInherentData,