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

Claim allocations processes batches by sector #1337

Merged
merged 4 commits into from
Jul 31, 2023

Conversation

anorth
Copy link
Member

@anorth anorth commented Jul 20, 2023

This PR reworks the verified registry ClaimAllocations method to follow the same pattern as the built-in market's ActivateDeals. Claims are grouped by sector, and a failed claim will cause all claims for that sector to fail. The all-or-nothing flag requests any failure to cause an abort.

This doesn't change the observable behaviour today because all-or-nothing is always set to true. But it does follow a pattern for batching now established (#1310) in the market actor, and prepares for the flag to be false when miner APIs support it (e.g. with direct data onboarding).

@anorth anorth requested a review from alexytsu July 20, 2023 03:01
@anorth anorth marked this pull request as ready for review July 20, 2023 03:21
@anorth anorth requested a review from ZenGround0 July 20, 2023 03:22
Copy link
Contributor

@alexytsu alexytsu left a comment

Choose a reason for hiding this comment

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

LGTM

actors/miner/src/lib.rs Show resolved Hide resolved
deal_space: deal_activation.nonverified_deal_space.clone(),
}
.zip(claim_res.sector_claims)
.map(|(sector_deals, sector_claim)| ext::market::DealSpaces {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice this is so much better

pub all_or_nothing: bool,
}

#[derive(Clone, Debug, PartialEq, Eq, Default, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct SectorAllocationClaimResult {
pub struct SectorAllocationClaim {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this name is a bit confusing together with SectorAllocationClaims

Maybe SectorClaimSummary?

Copy link
Member Author

@anorth anorth Jul 30, 2023

Choose a reason for hiding this comment

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

Done

actors/verifreg/src/lib.rs Outdated Show resolved Hide resolved
@ZenGround0
Copy link
Contributor

I am seeing an integration test failure on replica_update_verified_deal_max_term_violated which looks related to the change.

"all or nothing call contained failures: {}",
batch_info.to_string()
return Err(ActorError::checked(
batch_info.fail_codes[0].code,
Copy link
Member Author

Choose a reason for hiding this comment

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

This change to propagate the exit code from the firs failing item when all_or_nothing is true, rather than illegal argument, caused the integration test failure. I will revert it, though think perhaps propagating the code is better.

@anorth anorth force-pushed the anorth/claim-allocation-sectors branch from 171eee4 to 662c463 Compare July 30, 2023 21:57
@anorth anorth enabled auto-merge July 30, 2023 21:58
@anorth anorth disabled auto-merge July 30, 2023 21:59
@anorth anorth enabled auto-merge July 30, 2023 22:00
@anorth anorth force-pushed the anorth/claim-allocation-sectors branch from 811f8b6 to dde209f Compare July 31, 2023 00:45
@anorth anorth added this pull request to the merge queue Jul 31, 2023
@codecov-commenter
Copy link

Codecov Report

Merging #1337 (dde209f) into master (a77674d) will increase coverage by 0.00%.
Report is 1 commits behind head on master.
The diff coverage is 98.82%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1337   +/-   ##
=======================================
  Coverage   90.84%   90.85%           
=======================================
  Files         138      138           
  Lines       27350    27342    -8     
=======================================
- Hits        24847    24841    -6     
+ Misses       2503     2501    -2     
Files Changed Coverage Δ
actors/market/src/types.rs 96.87% <ø> (ø)
actors/verifreg/src/lib.rs 92.83% <98.36%> (+0.72%) ⬆️
actors/market/src/lib.rs 92.49% <100.00%> (ø)
actors/miner/src/ext.rs 63.63% <100.00%> (+1.13%) ⬆️
actors/miner/src/lib.rs 82.96% <100.00%> (-0.03%) ⬇️
actors/verifreg/src/types.rs 100.00% <100.00%> (ø)

... and 4 files with indirect coverage changes

Merged via the queue into master with commit 1b282d4 Jul 31, 2023
@anorth anorth deleted the anorth/claim-allocation-sectors branch July 31, 2023 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants