Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #6102 #6384

Merged
merged 8 commits into from
Nov 6, 2024
Merged

Fix #6102 #6384

merged 8 commits into from
Nov 6, 2024

Conversation

eskimor
Copy link
Member

@eskimor eskimor commented Nov 6, 2024

Relax requirements for assign_core so that it accepts updates for the last scheduled entry.

Fixes #6102

@eskimor
Copy link
Member Author

eskimor commented Nov 6, 2024

/cmd prdoc

@eskimor eskimor added T2-pallets This PR/Issue is related to a particular pallet. T8-polkadot This PR/Issue is related to/affects the Polkadot network. labels Nov 6, 2024
polkadot/runtime/parachains/src/assigner_coretime/mod.rs Outdated Show resolved Hide resolved
polkadot/runtime/parachains/src/assigner_coretime/mod.rs Outdated Show resolved Hide resolved
polkadot/runtime/parachains/src/assigner_coretime/mod.rs Outdated Show resolved Hide resolved
.try_fold(PartsOf57600::ZERO, |sum, parts| {
sum.checked_add(parts).ok_or(Error::<T>::OverScheduled)
})?;
ensure!(parts_sum.is_full(), Error::<T>::UnderScheduled);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if the schedule is split up, but we only receive one message in time? Will it break any assumptions if we don't have the full parts scheduled?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. I checked, the code does not really care whether the schedule is full or not.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably worth a unit test in case this behaviour is changed in future.
Should be very quick to add - just an additional core that is not fully assigned in the test.

.try_fold(PartsOf57600::ZERO, |sum, parts| {
sum.checked_add(parts).ok_or(Error::<T>::OverScheduled)
})?;
ensure!(parts_sum.is_full(), Error::<T>::UnderScheduled);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably worth a unit test in case this behaviour is changed in future.
Should be very quick to add - just an additional core that is not fully assigned in the test.

@eskimor eskimor added this pull request to the merge queue Nov 6, 2024
Merged via the queue into master with commit 86e1e38 Nov 6, 2024
196 of 197 checks passed
@eskimor eskimor deleted the rk-relax-assign-core-requirements branch November 6, 2024 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T2-pallets This PR/Issue is related to a particular pallet. T8-polkadot This PR/Issue is related to/affects the Polkadot network.
Projects
None yet
5 participants