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

Snap Deals Lotus Integration: FSM Posting and integration test #7810

Merged
merged 8 commits into from
Jan 11, 2022

Conversation

ZenGround0
Copy link
Contributor

Implements the miner node logic to run snap deals upgrades. It also handles posting (winning and window) over upgraded sectors.

  1. There are still occasional bugs in the integration tests that I am investigating, lots of random print and log statements everywhere
  2. FSM error handling is a mess, only the happy path is really written
  3. The market integration is quite a hack, I would like suggestions on how to make it cleaner

Base automatically changed from next to master December 17, 2021 03:12
@@ -358,6 +370,11 @@ func (m *Sealing) updateInput(ctx context.Context, sp abi.RegisteredSealProof) e

for id, sector := range m.openSectors {
avail := abi.PaddedPieceSize(ssize).Unpadded() - sector.used
// check that sector lifetime is long enough to fit deal
if sector.expiration > 0 && sector.expiration < piece.deal.DealProposal.EndEpoch {
Copy link
Member

Choose a reason for hiding this comment

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

should only need the later check cuz dealproposal must >0?

@ZenGround0 ZenGround0 force-pushed the feat/snap-deals branch 2 times, most recently from ea1e282 to 0da857f Compare December 21, 2021 21:52
@BlocksOnAChain BlocksOnAChain added this to the SnapDeals milestone Dec 29, 2021
@ZenGround0 ZenGround0 marked this pull request as ready for review December 29, 2021 18:24
@ZenGround0 ZenGround0 requested a review from a team as a code owner December 29, 2021 18:24
Copy link
Contributor

@arajasek arajasek left a comment

Choose a reason for hiding this comment

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

Review of the consensus parts of things seems fine, will tackle miner tomorrow. Hopefully.

@@ -74,6 +74,9 @@ func NewActorRegistry() *ActorRegistry {
}

func (ar *ActorRegistry) Invoke(codeCid cid.Cid, rt vmr.Runtime, method abi.MethodNum, params []byte) ([]byte, aerrors.ActorError) {
if method == 27 {
Copy link
Contributor

Choose a reason for hiding this comment

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

No, sir. I say to you, no.

Copy link
Contributor

@magik6k magik6k left a comment

Choose a reason for hiding this comment

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

Looks reasonable, a couple of comments.

The market integration is quite a hack, I would like suggestions on how to make it cleaner

I can't think of any cleaner way to do this, I'd say it's not more hacky than the thing we have right now.

api/api_full.go Show resolved Hide resolved
chain/vm/invoker.go Outdated Show resolved Hide resolved
chain/vm/syscalls.go Outdated Show resolved Hide resolved
cmd/lotus-seal-worker/main.go Show resolved Hide resolved
extern/sector-storage/ffiwrapper/verifier_cgo.go Outdated Show resolved Hide resolved
@@ -110,7 +111,7 @@ func (mgr *SectorCommittedManager) OnDealSectorPreCommitted(ctx context.Context,

// Watch for a pre-commit message to the provider.
matchEvent := func(msg *types.Message) (bool, error) {
matched := msg.To == provider && (msg.Method == miner.Methods.PreCommitSector || msg.Method == miner.Methods.PreCommitSectorBatch)
matched := msg.To == provider && (msg.Method == miner.Methods.PreCommitSector || msg.Method == miner.Methods.PreCommitSectorBatch || msg.Method == miner.Methods.ProveReplicaUpdates)
Copy link
Contributor

Choose a reason for hiding this comment

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

We will need to make sure other market users are aware of this change (filc/boost/others?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Any advice on how to propagate this information?

markets/storageadapter/ondealsectorcommitted.go Outdated Show resolved Hide resolved
markets/storageadapter/ondealsectorcommitted.go Outdated Show resolved Hide resolved
storage/wdpost_changehandler.go Outdated Show resolved Hide resolved
storage/wdpost_run.go Outdated Show resolved Hide resolved
Copy link
Contributor

@arajasek arajasek left a comment

Choose a reason for hiding this comment

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

Another review wave

chain/vm/syscalls.go Outdated Show resolved Hide resolved
cmd/lotus-miner/sectors.go Outdated Show resolved Hide resolved
extern/sector-storage/ffiwrapper/sealer_cgo.go Outdated Show resolved Hide resolved
extern/sector-storage/ffiwrapper/verifier_cgo.go Outdated Show resolved Hide resolved
VerifySeal(proof.SealVerifyInfo) (bool, error)
VerifyAggregateSeals(aggregate proof.AggregateSealVerifyProofAndInfos) (bool, error)
VerifyReplicaUpdate(update proof.ReplicaUpdateInfo) (bool, error)
VerifyWinningPoSt(ctx context.Context, info proof.WinningPoStVerifyInfo, currEpoch abi.ChainEpoch, v network.Version) (bool, error)
Copy link
Contributor

Choose a reason for hiding this comment

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

new params can go i think

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No harm keeping them all up to date right?

if err != nil {
return nil, nil, xerrors.Errorf("gathering sector info: %w", err)
}
log.Errorf("got private sectors")
Copy link
Contributor

Choose a reason for hiding this comment

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

logs are bad

cache = paths.UpdateCache
sealed = paths.Update
} else {
log.Errorf("Posting over sector key sector for sector id: %d", s.SectorNumber)
Copy link
Contributor

Choose a reason for hiding this comment

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

this log and the one above need to go?

@jennijuju jennijuju modified the milestones: SnapDeals, v1.14.0 Jan 3, 2022
@ZenGround0 ZenGround0 force-pushed the feat/snap-deals branch 2 times, most recently from e3cd18b to 61e1732 Compare January 5, 2022 08:10
- FSM handles the actual cc upgrade process including error states
- PoSting (winning and window) works over upgraded and upgrading sectors
- Integration test and changes to itest framework to reduce flakes
- Update CLI to handle new upgrade
- Update dependencies
Copy link
Contributor

@magik6k magik6k left a comment

Choose a reason for hiding this comment

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

2 small things

api/api_full.go Show resolved Hide resolved
cmd/lotus-seal-worker/main.go Show resolved Hide resolved
@arajasek arajasek disabled auto-merge January 11, 2022 17:46
@arajasek arajasek enabled auto-merge January 11, 2022 17:46
@arajasek arajasek disabled auto-merge January 11, 2022 17:46
@arajasek arajasek merged commit 207d33e into master Jan 11, 2022
@arajasek arajasek deleted the feat/snap-deals branch January 11, 2022 17:46
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.

6 participants