From 6f28bdc0390f32d827d2b9662e67c1acb9fb49d9 Mon Sep 17 00:00:00 2001 From: xpanvictor Date: Fri, 31 Oct 2025 16:32:31 +0100 Subject: [PATCH 01/11] feat(pallet-broker): add auto-renewal retry limit with counter reset Introduce `T::MaxAutoRenewalRetries` constant in `Config` trait track retry count in `AutoRenewalRetries` storage map, increment on each failed renewal attempt. When retries >= max, emit `AutoRenewalFailed`, remove auto-renew record, and reset counter to 0. Add integration tests: - persistent retry when count < max - record removal when count >= max BREAKING CHANGE: runtime must define `MaxAutoRenewalRetries` --- .../frame/broker/src/coretime_interface.rs | 3 + substrate/frame/broker/src/lib.rs | 9 ++ substrate/frame/broker/src/mock.rs | 3 +- substrate/frame/broker/src/tests.rs | 86 ++++++++++++++++++- substrate/frame/broker/src/tick_impls.rs | 15 +++- substrate/frame/broker/src/types.rs | 5 +- 6 files changed, 109 insertions(+), 12 deletions(-) diff --git a/substrate/frame/broker/src/coretime_interface.rs b/substrate/frame/broker/src/coretime_interface.rs index a78efb0e20852..3d425bbe42b26 100644 --- a/substrate/frame/broker/src/coretime_interface.rs +++ b/substrate/frame/broker/src/coretime_interface.rs @@ -37,6 +37,9 @@ pub type TaskId = u32; /// Fraction expressed as a nominator with an assumed denominator of 57,600. pub type PartsOf57600 = u16; +/// Count of failed renewal retries +pub type RenewalRetriesCount = u8; + /// An element to which a core can be assigned. #[derive( Encode, diff --git a/substrate/frame/broker/src/lib.rs b/substrate/frame/broker/src/lib.rs index 6950d357f4fd4..bcff2c1803ff4 100644 --- a/substrate/frame/broker/src/lib.rs +++ b/substrate/frame/broker/src/lib.rs @@ -126,6 +126,10 @@ pub mod pallet { #[pallet::constant] type MaxAutoRenewals: Get; + /// Max number of retries for failed renewals + #[pallet::constant] + type MaxAutoRenewalRetries: Get; + /// The smallest amount of credits a user can purchase. /// /// Needed to prevent spam attacks. @@ -198,6 +202,11 @@ pub mod pallet { pub type AutoRenewals = StorageValue<_, BoundedVec, ValueQuery>; + /// The amount of renewal retries for this payer + #[pallet::storage] + pub type AutoRenewalRetries = + StorageMap<_, Blake2_128Concat, (CoreIndex, T::AccountId), RenewalRetriesCount, ValueQuery>; + /// Received revenue info from the relay chain. #[pallet::storage] pub type RevenueInbox = StorageValue<_, OnDemandRevenueRecordOf, OptionQuery>; diff --git a/substrate/frame/broker/src/mock.rs b/substrate/frame/broker/src/mock.rs index 850b701440f1a..2352e41b9934b 100644 --- a/substrate/frame/broker/src/mock.rs +++ b/substrate/frame/broker/src/mock.rs @@ -31,7 +31,7 @@ use frame_support::{ }; use frame_system::{EnsureRoot, EnsureSignedBy}; use sp_arithmetic::Perbill; -use sp_core::{ConstU32, ConstU64, Get}; +use sp_core::{ConstU32, ConstU64, ConstU8, Get}; use sp_runtime::{ traits::{BlockNumberProvider, Identity, MaybeConvert}, BuildStorage, Saturating, @@ -217,6 +217,7 @@ impl crate::Config for Test { type MaxAutoRenewals = ConstU32<3>; type PriceAdapter = CenterTargetPrice>; type MinimumCreditPurchase = MinimumCreditPurchase; + type MaxAutoRenewalRetries = ConstU8<2>; } pub fn advance_to(b: u64) { diff --git a/substrate/frame/broker/src/tests.rs b/substrate/frame/broker/src/tests.rs index 512c4e4b725fa..17eaca57758bd 100644 --- a/substrate/frame/broker/src/tests.rs +++ b/substrate/frame/broker/src/tests.rs @@ -25,13 +25,11 @@ use frame_support::{ }; use frame_system::RawOrigin::Root; use pretty_assertions::assert_eq; -use sp_runtime::{ - traits::{BadOrigin, Get}, - Perbill, TokenError, -}; +use sp_runtime::{traits::{BadOrigin, Get}, BuildStorage, Perbill, TokenError}; use CoreAssignment::*; use CoretimeTraceItem::*; use Finality::*; +use sp_core::parameter_types; #[test] fn basic_initialize_works() { @@ -2259,6 +2257,86 @@ fn auto_renewal_works() { }); } +#[test] +fn auto_renewal_retries_persist_when_below_max() { + TestExt::new().endow(1, 1000).execute_with(|| { + assert_ok!(Broker::do_start_sales(100, 2)); + advance_to(2); + + // Purchase 2 cores + let region_1 = Broker::do_purchase(1, u64::max_value()).unwrap(); + let region_2 = Broker::do_purchase(1, u64::max_value()).unwrap(); + + // Assign tasks and enable auto renewals + assert_ok!(Broker::do_assign(region_1, Some(1), 1001, Final)); + assert_ok!(Broker::do_assign(region_2, Some(1), 1002, Final)); + assert_ok!(Broker::do_enable_auto_renew(1001, region_1.core, 1001, Some(7))); + assert_ok!(Broker::do_enable_auto_renew(1002, region_2.core, 1002, Some(7))); + + // Fund only task 1001's sovereign account (1002 will fail) + endow(1001, 1000); + let initial_retry_count = AutoRenewalRetries::::get((region_2.core, 1002)); + + // Trigger renewal time + advance_to(7); + + // Renewal #1 succeeds for task 1001, fails for 1002 + System::assert_has_event(Event::::AutoRenewalFailed { + core: region_2.core, + payer: Some(1002), + }.into()); + + // Retry count should be +1 now + let retry_count = AutoRenewalRetries::::get((region_2.core, 1002)); + assert_eq!(retry_count, initial_retry_count + 1); + + // AutoRenewals should still contain record for core 2 + assert!( + AutoRenewals::::get().iter().any(|r| r.core == region_2.core) + ); + }); +} + + +#[test] +fn auto_renewal_record_removed_when_max_retries_reached() { + TestExt::new().endow(1, 1000).execute_with(|| { + assert_ok!(Broker::do_start_sales(100, 2)); + advance_to(2); + + // Purchase and assign + let region = Broker::do_purchase(1, u64::max_value()).unwrap(); + assert_ok!(Broker::do_assign(region, Some(1), 1002, Final)); + assert_ok!(Broker::do_enable_auto_renew(1002, region.core, 1002, Some(7))); + + // Will just simulate we're at max + let max_retries: u8 = ::MaxAutoRenewalRetries::get(); + AutoRenewalRetries::::insert((region.core, 1002), max_retries); + + // Move to renewal block + advance_to(7); + + // The renewal should fail again, but since we're at max retry, record dropped + System::assert_has_event(Event::::AutoRenewalFailed { + core: region.core, + payer: Some(1002), + }.into()); + + // Ensure it no longer exists in AutoRenewals + assert!( + !AutoRenewals::::get().iter().any(|r| r.core == region.core), + "Auto renewal record should be removed once max retries reached" + ); + + // Retry counter reset + assert_eq!( + AutoRenewalRetries::::get((region.core, 1002)), + 0 + ); + }); +} + + #[test] fn disable_auto_renew_works() { TestExt::new().endow(1, 1000).limit_cores_offered(Some(10)).execute_with(|| { diff --git a/substrate/frame/broker/src/tick_impls.rs b/substrate/frame/broker/src/tick_impls.rs index e0b4932f11e23..4d080b049c88e 100644 --- a/substrate/frame/broker/src/tick_impls.rs +++ b/substrate/frame/broker/src/tick_impls.rs @@ -366,12 +366,21 @@ impl Pallet { next_renewal: sale.region_end, }) } else { + // check if renewal count has been exceeded and reset counter, else increment retry counter + let max_renewal_retries = T::MaxAutoRenewalRetries::get(); + let mut retries = AutoRenewalRetries::::get((record.core, payer.clone())); Self::deposit_event(Event::::AutoRenewalFailed { core: record.core, - payer: Some(payer), + payer: Some(payer.clone()), }); - - None + if retries >= max_renewal_retries { + AutoRenewalRetries::::insert((record.core, payer), 0); + None + } else { + retries = retries.saturating_add(1); + AutoRenewalRetries::::insert((record.core, payer), retries); + Some(record) + } } }) .collect::>() diff --git a/substrate/frame/broker/src/types.rs b/substrate/frame/broker/src/types.rs index ca53fd57b5bf4..472872f278ae2 100644 --- a/substrate/frame/broker/src/types.rs +++ b/substrate/frame/broker/src/types.rs @@ -15,10 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::{ - Config, CoreAssignment, CoreIndex, CoreMask, CoretimeInterface, RCBlockNumberOf, TaskId, - CORE_MASK_BITS, -}; +use crate::{Config, CoreAssignment, CoreIndex, CoreMask, CoretimeInterface, RCBlockNumberOf, RenewalRetriesCount, TaskId, CORE_MASK_BITS}; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use frame_support::traits::fungible::Inspect; use frame_system::Config as SConfig; From 948b1b93ac6852ba3394979a377040ac2d4c950b Mon Sep 17 00:00:00 2001 From: xpanvictor Date: Fri, 31 Oct 2025 17:24:14 +0100 Subject: [PATCH 02/11] fix(test): auto_renewal_works expectation for failed renewal reassignment --- substrate/frame/broker/src/tests.rs | 5 +++-- substrate/frame/broker/src/tick_impls.rs | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/substrate/frame/broker/src/tests.rs b/substrate/frame/broker/src/tests.rs index 17eaca57758bd..afc3e4c2c333b 100644 --- a/substrate/frame/broker/src/tests.rs +++ b/substrate/frame/broker/src/tests.rs @@ -25,11 +25,10 @@ use frame_support::{ }; use frame_system::RawOrigin::Root; use pretty_assertions::assert_eq; -use sp_runtime::{traits::{BadOrigin, Get}, BuildStorage, Perbill, TokenError}; +use sp_runtime::{traits::{BadOrigin, Get}, Perbill, TokenError}; use CoreAssignment::*; use CoretimeTraceItem::*; use Finality::*; -use sp_core::parameter_types; #[test] fn basic_initialize_works() { @@ -2251,6 +2250,8 @@ fn auto_renewal_works() { AutoRenewals::::get().to_vec(), vec![ AutoRenewalRecord { core: 0, task: 1001, next_renewal: 10 }, + AutoRenewalRecord { core: 1, task: 1002, next_renewal: 10 }, + // the renewal now retries since our default retry is 2 for test AutoRenewalRecord { core: 1, task: 1003, next_renewal: 10 }, ] ); diff --git a/substrate/frame/broker/src/tick_impls.rs b/substrate/frame/broker/src/tick_impls.rs index 4d080b049c88e..88f14b2e40fca 100644 --- a/substrate/frame/broker/src/tick_impls.rs +++ b/substrate/frame/broker/src/tick_impls.rs @@ -379,7 +379,11 @@ impl Pallet { } else { retries = retries.saturating_add(1); AutoRenewalRetries::::insert((record.core, payer), retries); - Some(record) + Some(AutoRenewalRecord { + core: record.core, + task: record.task, + next_renewal: sale.region_end, + }) } } }) From 4f848ce8beaf61eb020f708026e4a7836f3e8e93 Mon Sep 17 00:00:00 2001 From: xpanvictor Date: Fri, 31 Oct 2025 17:33:36 +0100 Subject: [PATCH 03/11] fix(pallet-broker): renew_cores reset on success as well --- substrate/frame/broker/src/tests.rs | 2 +- substrate/frame/broker/src/tick_impls.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/substrate/frame/broker/src/tests.rs b/substrate/frame/broker/src/tests.rs index afc3e4c2c333b..06e907c0312e0 100644 --- a/substrate/frame/broker/src/tests.rs +++ b/substrate/frame/broker/src/tests.rs @@ -2244,8 +2244,8 @@ fn auto_renewal_works() { .into(), ); - // Given that core #1 didn't get renewed due to the account not being sufficiently funded, // Task (1003) will now be assigned to that core instead of core #2. + // The renewal persists however due to retry logic assert_eq!( AutoRenewals::::get().to_vec(), vec![ diff --git a/substrate/frame/broker/src/tick_impls.rs b/substrate/frame/broker/src/tick_impls.rs index 88f14b2e40fca..31e6692f70ca7 100644 --- a/substrate/frame/broker/src/tick_impls.rs +++ b/substrate/frame/broker/src/tick_impls.rs @@ -360,6 +360,7 @@ impl Pallet { }; if let Ok(new_core_index) = Self::do_renew(payer.clone(), record.core) { + AutoRenewalRetries::::insert((record.core, payer), 0); Some(AutoRenewalRecord { core: new_core_index, task: record.task, From 2f244de9d79368340a06aeb0b0ccf819a6bdac60 Mon Sep 17 00:00:00 2001 From: "cmd[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 31 Oct 2025 16:41:14 +0000 Subject: [PATCH 04/11] Update from github-actions[bot] running command 'prdoc' --- prdoc/pr_10178.prdoc | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 prdoc/pr_10178.prdoc diff --git a/prdoc/pr_10178.prdoc b/prdoc/pr_10178.prdoc new file mode 100644 index 0000000000000..e9ce8076258b9 --- /dev/null +++ b/prdoc/pr_10178.prdoc @@ -0,0 +1,35 @@ +title: Xpan auto retry limit +doc: +- audience: Todo + description: |- + BREAKING CHANGE: runtime must define `MaxAutoRenewalRetries` + + Fixes #9548 + Problem: After auto-renewal fails due to some error, the system disables autorenewal entirely contrary to the documentation. + Solution: A more robust retry which is configurable in the pallet config. This is compile time setting currently. + Introduce `T::MaxAutoRenewalRetries` constant in `Config` trait track retry count in `AutoRenewalRetries` storage map, increment on each failed renewal attempt. When retries >= max, emit `AutoRenewalFailed`, remove auto-renew record, and reset counter to 0. Add integration tests: + - persistent retry when count < max + - record removal when count >= max + + ## Integration + Downstream projects using pallet-broker must define `MaxAutoRenewalRetries` config. They just need to pass a retries limit. Can be set to `0` for no retry. This is similar to current logic. + + ## Review Notes + ### Changes: + 1. Added `MaxAutoRenewalRetries` to config trait. Default type is `u8`. + 2. Added a storage for renewal retries record. This increments for failed retries. It resets on success or when renewal is cancelled. + 3. Existing code needs to add the new configuration parameter. + + # Checklist + + * [x] My PR includes a detailed description as outlined in the "Description" and its two subsections above. + * [x] My PR follows the [labeling requirements]( + https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/CONTRIBUTING.md#Process + ) of this project (at minimum one label for `T` required) + * External contributors: Use `/cmd label ` to add labels + * Maintainers can also add labels manually + * [ ] I have made corresponding changes to the documentation (if applicable) + * [x] I have added tests that prove my fix is effective or that my feature works (if applicable) +crates: +- name: pallet-broker + bump: major From 112c8d8af5f9bc11fee575bfe5acee2bb5efca92 Mon Sep 17 00:00:00 2001 From: Xpan Victor Date: Fri, 31 Oct 2025 20:51:17 +0100 Subject: [PATCH 05/11] Update pr_10178.prdoc Co-authored-by: Francisco Aguirre --- prdoc/pr_10178.prdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prdoc/pr_10178.prdoc b/prdoc/pr_10178.prdoc index e9ce8076258b9..70369e41e5f6d 100644 --- a/prdoc/pr_10178.prdoc +++ b/prdoc/pr_10178.prdoc @@ -1,6 +1,6 @@ title: Xpan auto retry limit doc: -- audience: Todo +- audience: Runtime Dev description: |- BREAKING CHANGE: runtime must define `MaxAutoRenewalRetries` From 44071d6c9bb12ffba28614791e0232238e5b0378 Mon Sep 17 00:00:00 2001 From: xpanvictor Date: Sat, 1 Nov 2025 18:14:10 +0100 Subject: [PATCH 06/11] feat(runtime): add coretime config to coretime-westend and coretime-rococo --- .../runtimes/coretime/coretime-rococo/src/coretime.rs | 3 ++- .../runtimes/coretime/coretime-westend/src/coretime.rs | 1 + prdoc/pr_10178.prdoc | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/coretime.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/coretime.rs index ef78397fb3e63..14b09b24dd0e1 100644 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/coretime.rs +++ b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/coretime.rs @@ -28,7 +28,7 @@ use frame_support::{ }; use frame_system::Pallet as System; use pallet_broker::{ - CoreAssignment, CoreIndex, CoretimeInterface, PartsOf57600, RCBlockNumberOf, TaskId, + CoreAssignment, CoreIndex, CoretimeInterface, PartsOf57600, RCBlockNumberOf, TaskId }; use parachains_common::{AccountId, Balance}; use rococo_runtime_constants::system_parachain::coretime; @@ -318,4 +318,5 @@ impl pallet_broker::Config for Runtime { type MaxAutoRenewals = ConstU32<100>; type PriceAdapter = pallet_broker::MinimumPrice; type MinimumCreditPurchase = MinimumCreditPurchase; + type MaxAutoRenewalRetries = ConstU8<2>; } diff --git a/cumulus/parachains/runtimes/coretime/coretime-westend/src/coretime.rs b/cumulus/parachains/runtimes/coretime/coretime-westend/src/coretime.rs index c9cd7f80a61ae..03c33436517cd 100644 --- a/cumulus/parachains/runtimes/coretime/coretime-westend/src/coretime.rs +++ b/cumulus/parachains/runtimes/coretime/coretime-westend/src/coretime.rs @@ -331,4 +331,5 @@ impl pallet_broker::Config for Runtime { type MaxAutoRenewals = ConstU32<20>; type PriceAdapter = pallet_broker::MinimumPrice; type MinimumCreditPurchase = MinimumCreditPurchase; + type MaxAutoRenewalRetries = ConstU8<2>; } diff --git a/prdoc/pr_10178.prdoc b/prdoc/pr_10178.prdoc index 70369e41e5f6d..a6d6ef7d569a2 100644 --- a/prdoc/pr_10178.prdoc +++ b/prdoc/pr_10178.prdoc @@ -19,6 +19,7 @@ doc: 1. Added `MaxAutoRenewalRetries` to config trait. Default type is `u8`. 2. Added a storage for renewal retries record. This increments for failed retries. It resets on success or when renewal is cancelled. 3. Existing code needs to add the new configuration parameter. + 4. Added the config parameter with default `constu8<2>` as in test into `coretime-rococo` and `coretime-westend`. # Checklist From dbc004ff5ac5cc676f39eb510a219a1eb40f56ea Mon Sep 17 00:00:00 2001 From: Xpan Victor Date: Wed, 5 Nov 2025 14:33:04 +0100 Subject: [PATCH 07/11] Update prdoc/pr_10178.prdoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Dónal Murray --- prdoc/pr_10178.prdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prdoc/pr_10178.prdoc b/prdoc/pr_10178.prdoc index a6d6ef7d569a2..584febabf3a0d 100644 --- a/prdoc/pr_10178.prdoc +++ b/prdoc/pr_10178.prdoc @@ -1,4 +1,4 @@ -title: Xpan auto retry limit +title: Add auto retry limit to Coretime autorenewal doc: - audience: Runtime Dev description: |- From dbaab258d8259d389a318c36cf54ed5ff0c79b90 Mon Sep 17 00:00:00 2001 From: Xpan Victor Date: Wed, 5 Nov 2025 14:33:58 +0100 Subject: [PATCH 08/11] Update prdoc/pr_10178.prdoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Dónal Murray --- prdoc/pr_10178.prdoc | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/prdoc/pr_10178.prdoc b/prdoc/pr_10178.prdoc index 584febabf3a0d..c976fb5d0543b 100644 --- a/prdoc/pr_10178.prdoc +++ b/prdoc/pr_10178.prdoc @@ -10,27 +10,6 @@ doc: Introduce `T::MaxAutoRenewalRetries` constant in `Config` trait track retry count in `AutoRenewalRetries` storage map, increment on each failed renewal attempt. When retries >= max, emit `AutoRenewalFailed`, remove auto-renew record, and reset counter to 0. Add integration tests: - persistent retry when count < max - record removal when count >= max - - ## Integration - Downstream projects using pallet-broker must define `MaxAutoRenewalRetries` config. They just need to pass a retries limit. Can be set to `0` for no retry. This is similar to current logic. - - ## Review Notes - ### Changes: - 1. Added `MaxAutoRenewalRetries` to config trait. Default type is `u8`. - 2. Added a storage for renewal retries record. This increments for failed retries. It resets on success or when renewal is cancelled. - 3. Existing code needs to add the new configuration parameter. - 4. Added the config parameter with default `constu8<2>` as in test into `coretime-rococo` and `coretime-westend`. - - # Checklist - - * [x] My PR includes a detailed description as outlined in the "Description" and its two subsections above. - * [x] My PR follows the [labeling requirements]( - https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/CONTRIBUTING.md#Process - ) of this project (at minimum one label for `T` required) - * External contributors: Use `/cmd label ` to add labels - * Maintainers can also add labels manually - * [ ] I have made corresponding changes to the documentation (if applicable) - * [x] I have added tests that prove my fix is effective or that my feature works (if applicable) crates: - name: pallet-broker bump: major From aabff6ab1984293072672acddf8f9684dbb16984 Mon Sep 17 00:00:00 2001 From: Xpan Victor Date: Wed, 5 Nov 2025 14:35:29 +0100 Subject: [PATCH 09/11] fix(broker): use u8 for maxautorenewalretries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Dónal Murray --- substrate/frame/broker/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/substrate/frame/broker/src/lib.rs b/substrate/frame/broker/src/lib.rs index bcff2c1803ff4..87f2ec078ecd7 100644 --- a/substrate/frame/broker/src/lib.rs +++ b/substrate/frame/broker/src/lib.rs @@ -128,7 +128,7 @@ pub mod pallet { /// Max number of retries for failed renewals #[pallet::constant] - type MaxAutoRenewalRetries: Get; + type MaxAutoRenewalRetries: Get; /// The smallest amount of credits a user can purchase. /// From c5a3e34d7d7406e24f5288c1bcb68f0b3068fa65 Mon Sep 17 00:00:00 2001 From: Xpan Victor Date: Wed, 5 Nov 2025 14:42:51 +0100 Subject: [PATCH 10/11] fix(broker): remove the config renewal type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Dónal Murray --- substrate/frame/broker/src/coretime_interface.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/substrate/frame/broker/src/coretime_interface.rs b/substrate/frame/broker/src/coretime_interface.rs index 3d425bbe42b26..a78efb0e20852 100644 --- a/substrate/frame/broker/src/coretime_interface.rs +++ b/substrate/frame/broker/src/coretime_interface.rs @@ -37,9 +37,6 @@ pub type TaskId = u32; /// Fraction expressed as a nominator with an assumed denominator of 57,600. pub type PartsOf57600 = u16; -/// Count of failed renewal retries -pub type RenewalRetriesCount = u8; - /// An element to which a core can be assigned. #[derive( Encode, From 993ea6112da350093969d15061a4bc0b4c9d5de2 Mon Sep 17 00:00:00 2001 From: Xpan Victor Date: Wed, 5 Nov 2025 14:49:44 +0100 Subject: [PATCH 11/11] fix(broker): use u8 directly as counter type for autorenewalretries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Dónal Murray --- substrate/frame/broker/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/substrate/frame/broker/src/lib.rs b/substrate/frame/broker/src/lib.rs index 87f2ec078ecd7..93a4105d18cfd 100644 --- a/substrate/frame/broker/src/lib.rs +++ b/substrate/frame/broker/src/lib.rs @@ -205,7 +205,7 @@ pub mod pallet { /// The amount of renewal retries for this payer #[pallet::storage] pub type AutoRenewalRetries = - StorageMap<_, Blake2_128Concat, (CoreIndex, T::AccountId), RenewalRetriesCount, ValueQuery>; + StorageMap<_, Blake2_128Concat, (CoreIndex, T::AccountId), u8, ValueQuery>; /// Received revenue info from the relay chain. #[pallet::storage]