-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Labels
I10-unconfirmedIssue might be valid, but it's not yet known.Issue might be valid, but it's not yet known.I2-bugThe node fails to follow expected behavior.The node fails to follow expected behavior.
Description
Is there an existing issue?
- I have searched the existing issues
Experiencing problems? Have you tried our Stack Exchange first?
- This is not a support question.
Description of bug
When enabling auto-renewals on a new purchased core with some task assigned to it, if the same core ID is also associated with another task not yet renewed from the current region, the account pays for the other core renewal.
The behavior likely stems from this part in the code:
polkadot-sdk/substrate/frame/broker/src/dispatchable_impls.rs
Lines 562 to 578 in 13320f3
// Check if the core is expiring in the next bulk period; if so, we will renew it now. | |
// | |
// In case we renew it now, we don't need to check the workload end since we know it is | |
// eligible for renewal. | |
if PotentialRenewals::<T>::get(PotentialRenewalId { core, when: sale.region_begin }) | |
.is_some() | |
{ | |
Self::do_renew(sovereign_account.clone(), core)?; | |
} else if let Some(workload_end) = workload_end_hint { | |
ensure!( | |
PotentialRenewals::<T>::get(PotentialRenewalId { core, when: workload_end }) | |
.is_some(), | |
Error::<T>::NotAllowed | |
); | |
} else { | |
return Err(Error::<T>::NotAllowed.into()) | |
} |
This issues makes direct auto-renewal setting enablement impossible without paying extra DOTs to renew a core I don't own.
Steps to reproduce
- Purchase a new core during an active sale period, using a core ID that is already associated with an unrenewed core in the ongoing region.
- Enable auto-renewal for that core ID, using the sale region’s end date as the workload hint.
- Observe an attempt of renewal for the same core ID in the ongoing region.
Metadata
Metadata
Assignees
Labels
I10-unconfirmedIssue might be valid, but it's not yet known.Issue might be valid, but it's not yet known.I2-bugThe node fails to follow expected behavior.The node fails to follow expected behavior.