-
Notifications
You must be signed in to change notification settings - Fork 766
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
[pallet-broker] Force-unpool provisionally pooled regions before redispatching them #4081
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: Bastian Köcher <[email protected]>
The CI pipeline was cancelled due to failure one of the required jobs. |
@@ -390,6 +390,14 @@ pub mod pallet { | |||
/// The Region whose contribution is no longer exists. | |||
region_id: RegionId, | |||
}, | |||
/// A region has been force-removed from the pool. This is usually due to a provisionally | |||
/// pooled region being redeployed. | |||
RegionUnpooled { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the reason for the major bump, but since there is an event for a region being pooled we should also have one for it being unpooled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests seem to fail?
// the current timeslice if we are already part-way through the region. | ||
let size = region_id.mask.count_ones() as i32; | ||
let unpooled_at = end_timeslice.max(region_id.begin); | ||
InstaPoolIo::<T>::mutate(unpooled_at, |a| a.private.saturating_reduce(size)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we leave the WorkPlan
as is on purpose?
Hmm yea I just updated from master today after a while of waiting for audit, and it seems that #3940 changed the mock for these tests |
All GitHub workflows were cancelled due to failure one of the required jobs. |
This PR force removes regions from the pool before allowing them to be redispatched (through
partition
/interlace
/assign
) in the case that a region was pooled withProvisional
finality.This PR does not account for the case where a pooled region already entitles the benefactor to a contribution reward before the point of it being redispatched. However,
claim_revenue
should be called before trying to redispatch a region anyway.Otherwise there would be ambiguity as to what should be done with the first part of a partitioned region. The first of the two new regions actually has the exact same
region_id
as the original region -- leave it pooled/withdraw from pool/claim contribution then withdraw?