Skip to content

Enabling auto-renewal on newly purchased & assigned core triggers renewal of same core ID for existing region. #10006

@ipapandinas

Description

@ipapandinas

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:

// 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

  1. 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.
  2. Enable auto-renewal for that core ID, using the sale region’s end date as the workload hint.
  3. Observe an attempt of renewal for the same core ID in the ongoing region.

Metadata

Metadata

Assignees

No one assigned

    Labels

    I10-unconfirmedIssue might be valid, but it's not yet known.I2-bugThe node fails to follow expected behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions