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

StorageDeal: transfer mechanisms and assurances #193

Merged
merged 5 commits into from Apr 1, 2019

Conversation

whyrusleeping
Copy link
Member

I'm working on defining exactly how the references in the storage deal proposal translate into data that goes into the sector, and also working through how some of the interactions with PoRep (and payments) need to work.

@porcuquine It would be much appreciated if you could take a look at this, and maybe then we could discuss in a call.

@porcuquine
Copy link
Contributor

@whyrusleeping I've read this now so could discuss in the next few days.

Size: size,
Payment: payInfo,
PieceRef: file,
TranslatedRef: commitment,
Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: add SerializationMode to this

```

```go
func OnSectorSealed(prop StorageDealProposal) {
Copy link
Member Author

Choose a reason for hiding this comment

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

note: called once for each deal in the sector

}

// TODO: is TranslatedRef actually needed? How does it tie in?
pieceConfirmation := SectorBuilder.PackData(prop.PieceRef, prop.SerializationMode)
Copy link
Contributor

@laser laser Mar 21, 2019

Choose a reason for hiding this comment

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

At this point, the SectorBuilder will have added a user's piece to a yet-to-be-sealed sector. The miner doesn't have to seal it immediately. Will the miner be able to generate a piece inclusion proof for this piece if the miner hasn't yet started the sealing process?

miner.Sign(resp)
miner.SetDealState(resp)
}
```

Once the deal makes it to this state, the client should be able to query and get the `PieceConfirmation` that they need to verify that the miner is indeed storing their data.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm Lovin' It.

Copy link
Contributor

Choose a reason for hiding this comment

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

@whyrusleeping Although this should be obvious, I want to make explicit that if we do this in the simplest way, PieceConfirmations will take some time to generate because we also have to generate commD. So the likely flow is:

  • sector is completely packed.
  • commD and PieceConfirmations are generated.
  • OnSectorPacked is called.
  • Sealing begins/continues.

We could also incrementally generate commD as pieces are packed, but that's probably not the effort, at least up-front. Like I said, should be obvious, but there's likely to be a delay between when the sector is completely packed and when OnSectorPacked can be called. I can't think of a reason why this would matter.

@whyrusleeping whyrusleeping merged commit 49ed979 into master Apr 1, 2019
@whyrusleeping whyrusleeping deleted the feat/storage-deal-work branch April 1, 2019 23:47
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.

None yet

3 participants