Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

add some unhappy scenarios for cc upgrade #1034

Merged
merged 3 commits into from
Aug 28, 2020

Conversation

acruikshank
Copy link
Contributor

follow up to #1030

Motivation

CC upgrades have a happy-path scenario test. We want to check some of the unhappy scenarios as well.

Proposed Changes

  1. Add test for when a miner fails to prove a sector containing verified deals that the bytes are returned to registry when deals are deactivated.
  2. Add test for when a miner misses first PoSt for cc upgrade sector that power for both sectors is removed.
  3. Add test for when a miner skips a CC upgrade sector in first PoSt that sector is faulted and power is unchanged.

@anorth
Copy link
Member

anorth commented Aug 25, 2020

when a miner misses first PoSt for cc upgrade sector that power for both sectors is removed

The power for the new sector is not added until the first PoSt, so it should not be removed.

I might be confused whether "cc upgrade sector" refers to the upgraded (replaced) or new sector, tho

@wadealexc
Copy link

LGTM. As alex said, power for the new sector isn't added till the first PoSt.

I wonder if it'd be helpful to try and test some of the params for UpdateClaimedPower and values for BurntFunds.MethodSend. Especially where multiple sectors are concerned, it'd be good to know that these invocations correspond to some specific action.

@acruikshank
Copy link
Contributor Author

I think both new and old sectors are faulting in the same deadline resulting in the miner losing power for the old sector. I'll try to tease them apart to show that the old sector isn't faulted until it misses its own PoSt.

@acruikshank acruikshank force-pushed the feat/miner_capacity_upgrade_unhappy branch from bce5c99 to 8ad7e00 Compare August 27, 2020 17:56
@codecov-commenter
Copy link

codecov-commenter commented Aug 27, 2020

Codecov Report

Merging #1034 into master will not change coverage.
The diff coverage is n/a.

@@          Coverage Diff           @@
##           master   #1034   +/-   ##
======================================
  Coverage    74.3%   74.3%           
======================================
  Files          57      57           
  Lines        6576    6576           
======================================
  Hits         4886    4886           
  Misses       1067    1067           
  Partials      623     623           

Partitions: []miner.PoStPartition{{
Index: pIdx,
// skip cc upgrade
Skipped: bitfield.NewFromSet([]uint64{uint64(ccSectorNumber)}),
Copy link
Member

Choose a reason for hiding this comment

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

The nameccSectorNumber is quite confusing here. A committed capacity sector is a sector that has no deals. This, however, is the a sector that has deals that is replacing a committed capacity sector.

Please rename sectorNumber and ccSectorNumber. Perhaps:

  • ccSectorNumber, upgrade/replacementSectorNumber?
  • oldSectorNumber, newSectorNumber?
    Use those terms consistently in the comments and other code (you already use old/new a lot).

Name sectorPower to match.

@acruikshank acruikshank force-pushed the feat/miner_capacity_upgrade_unhappy branch from 8ad7e00 to 232feba Compare August 28, 2020 15:53
@acruikshank acruikshank merged commit d089327 into master Aug 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants