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

Feat/aggregate porep less harsh error #1412

Merged
merged 3 commits into from
May 17, 2021

Conversation

ZenGround0
Copy link
Contributor

  1. AggregateProveCommit does not fail if a subset of precommits exist on chain but are out of date (prove commit epoch greater than epoch due). Instead all inputs are provided to the proof, but only the sectors not out of date are added to the state through confirmSectorsProofsValid.
  2. PreCommitExpiries are now scheduled an additional 8 hours after the corresponding prove commit epoch is due. This provides much more time (8 hours vs 0-30 minutes) for aggregates including expired precommits to make it on chain. This is a somewhat arbitrary choice, feedback on this would be great

TODO:

@ZenGround0 ZenGround0 requested review from anorth and Stebalien May 13, 2021 16:44
Copy link
Member

@anorth anorth left a comment

Choose a reason for hiding this comment

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

LGTM after clarifying language.

Out of curiosity, why did you elect to write a scenario test rather than a unit test for testing the ProveCommitAggregate with a expired sector?

actors/builtin/miner/miner_actor.go Outdated Show resolved Hide resolved
@@ -2122,7 +2122,7 @@ func (h *cronControl) preCommitToStartCron(t *testing.T, preCommitEpoch abi.Chai
// PCD != 0 so cron must be active
h.requireCronActive(t)

expiryEpoch := preCommitEpoch + miner.MaxProveCommitDuration[h.actor.sealProofType] + abi.ChainEpoch(1)
expiryEpoch := preCommitEpoch + miner.MaxProveCommitDuration[h.actor.sealProofType] + miner.PreCommitExpiryDelay
Copy link
Member

Choose a reason for hiding this comment

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

Update the comment to describe the return value as the epoch at which the precommit should be cleaned up, removed from state by cron. Or maybe return both the logical expiration and the clean-up epoch.

@@ -310,3 +310,4 @@ func RewardForDisputedWindowPoSt(proofType abi.RegisteredPoStProof, disputedPowe
const MaxAggregatedSectors = 819
const MinAggregatedSectors = 1
const MaxAggregateProofSize = 192000
const PreCommitExpiryDelay = 8 * builtin.EpochsInHour
Copy link
Member

Choose a reason for hiding this comment

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

Please document the intent here: to leave expired pre-commits in state for a while so they don't take down all the good sectors in a late-running aggregated prove-commit.

Prompted by the comments I made elsewhere, let's also rename this to distinguish expiration from clean-up. So maybe something like [Expired]PreCommitCleanUpDelay.

@@ -99,6 +99,10 @@ func TestCommitPoStFlow(t *testing.T) {
//

t.Run("missed prove commit results in precommit expiry", func(t *testing.T) {
// advance time to precommit expiry
Copy link
Member

Choose a reason for hiding this comment

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

I suggest being precise in the language here, distinguishing the logical expiration (after which it cannot be proven) from clean-up or garbage-collection epoch.

balances := vm.GetMinerBalances(t, v, minerAddrs.IDAddress)
assert.True(t, balances.InitialPledge.GreaterThan(big.Zero()))
assert.True(t, balances.PreCommitDeposit.GreaterThan(big.Zero()))

Copy link
Member

Choose a reason for hiding this comment

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

I suggest rolling forward cron until the expired precommit is cleaned up, too

@ZenGround0
Copy link
Contributor Author

Out of curiosity, why did you elect to write a scenario test rather than a unit test for testing the ProveCommitAggregate with a expired sector?

With the upcoming test vectors project all scenario tests will now generate conformance tests so I now have a slight bias towards testing with scenario tests if it is not too hard to do. In this case I was already warmed up writing similar tests from measuring aggregate porep gas so it seemed worth the extra effort.

@ZenGround0 ZenGround0 force-pushed the spike/aggregate-porep branch 2 times, most recently from f41487f to 5f76287 Compare May 14, 2021 14:25
- expired precommits don't cause AggregateProveCommit failure, expired precommit sectors just skipped
- precommits removed off chain 8 hours after they have expired from prove commit eligibility
@ZenGround0 ZenGround0 force-pushed the feat/aggregate-porep-less-harsh-error branch from b5eeebe to fa31738 Compare May 14, 2021 14:53
@codecov-commenter
Copy link

Codecov Report

Merging #1412 (fa31738) into spike/aggregate-porep (418e07d) will increase coverage by 0.0%.
The diff coverage is 81.2%.

@@                  Coverage Diff                  @@
##           spike/aggregate-porep   #1412   +/-   ##
=====================================================
  Coverage                   69.8%   69.8%           
=====================================================
  Files                         72      72           
  Lines                       7700    7792   +92     
=====================================================
+ Hits                        5378    5446   +68     
- Misses                      1438    1451   +13     
- Partials                     884     895   +11     

@ZenGround0 ZenGround0 changed the base branch from spike/aggregate-porep to master May 14, 2021 14:58
@ZenGround0 ZenGround0 force-pushed the feat/aggregate-porep-less-harsh-error branch from 1ee21c9 to f7aefcb Compare May 17, 2021 16:41
@ZenGround0 ZenGround0 merged commit c7cff61 into master May 17, 2021
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.

3 participants