-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Update specs-actors & cbor-gen #2965
Conversation
Stebalien
commented
Aug 10, 2020
•
edited
Loading
edited
- Updates specs-actors & cbor-gen.
- Binds WindowPoSts to a particular chain using chain randomness.
- Switches over to by-value bitfields.
4cbfc2c
to
ef27b5b
Compare
6b4cbe1
to
445eb0b
Compare
42cd236
to
4a5de8d
Compare
@magik6k nvm. I misunderstood where |
cfa3aa8
to
228b885
Compare
} | ||
|
||
func (w *randWrapper) GetBeaconRandomness(ctx context.Context, pers crypto.DomainSeparationTag, round abi.ChainEpoch, entropy []byte) ([]byte, error) { | ||
return w.rand.Randomness(ctx, pers, round, entropy) |
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 going to prevent the tests from catching some errors. I believe we'll need to get chain-validation to pass us two random sources.
// date by the time we submit, it'll be rejected. | ||
// TODO: we need a better lookback value, but I'm not sure what it should be. | ||
commEpoch := ts.Height() - StartConfidence | ||
commRand, err := s.api.ChainGetRandomnessFromTickets(ctx, ts.Key(), crypto.DomainSeparationTag_PoStChainCommit, commEpoch, nil) |
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.
I'm not sure how we should actually do this. I assume that StartConfidence is way too short.
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.
Since we have to submit the post within the ChallengeWindow anyways, I'd assume that we can just pull this from the di.Open
epoch
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.
That works. But note, we should probably be computing PoSts in advance of the deadline opening.
0dbddcf
to
221f04b
Compare
9d472c8
to
bf7fb53
Compare
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.
Couple of comments, looks good in general
if minExpiration := height + miner.MaxSealDuration[sector.SectorType] + miner.MinSectorExpiration + 10; expiration < minExpiration { | ||
expiration = minExpiration | ||
} | ||
// TODO: enforce a reasonable _maximum_ sector lifetime? |
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.
That happens at other levels (at least it should)
// date by the time we submit, it'll be rejected. | ||
// TODO: we need a better lookback value, but I'm not sure what it should be. | ||
commEpoch := ts.Height() - StartConfidence | ||
commRand, err := s.api.ChainGetRandomnessFromTickets(ctx, ts.Key(), crypto.DomainSeparationTag_PoStChainCommit, commEpoch, nil) |
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.
Since we have to submit the post within the ChallengeWindow anyways, I'd assume that we can just pull this from the di.Open
epoch
This ensures we can't end up decoding nil bitfields from clients when not expecting them. Part of filecoin-project/specs-actors#895. Please see this issue for details and leave any comments there.
6834477
to
6f03199
Compare
@@ -159,6 +159,13 @@ func (m *Sealing) handlePreCommitting(ctx statemachine.Context, sector SectorInf | |||
return ctx.Send(SectorSealPreCommit1Failed{xerrors.Errorf("handlePreCommitting: failed to compute pre-commit expiry: %w", err)}) | |||
} | |||
|
|||
// Sectors must last _at least_ MinSectorExpiration + MaxSealDuration. | |||
// TODO: The "+10" allows the pre-commit to take 10 blocks to be accepted. |
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.
@magik6k this needs attention.