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

Replace miner state seal proof type with PoSt proof type #1329

Closed
anorth opened this issue Dec 13, 2020 · 2 comments · Fixed by #1345
Closed

Replace miner state seal proof type with PoSt proof type #1329

anorth opened this issue Dec 13, 2020 · 2 comments · Fixed by #1345
Assignees
Labels
change-state Changes state schema, necessitating major version upgrade/migration cleanup Technical debt recovery and other cleanup work
Milestone

Comments

@anorth
Copy link
Member

anorth commented Dec 13, 2020

After we upgraded seal proof type with network versions 7 and 8 it became clear that the seal proof type isn't the right thing to store in miner actor state. The seal proof type is now only used to look-up Window PoSt proof type. We should store that directly instead. This will reduce friction for any similar future proof upgrades.

This would require a small migration, which is probably happening anyway.

@anorth anorth added cleanup Technical debt recovery and other cleanup work change-state Changes state schema, necessitating major version upgrade/migration labels Dec 13, 2020
@anorth
Copy link
Member Author

anorth commented Jan 4, 2021

@Stebalien @dirkmc @magik6k I did some investigation into uses of this before removing it. Many are simple, just using the seal proof type to get to the window/winning PoSt proof type, which we can store in state directly instead.

Lotus locally overrides the seal proof type stored in state if it's an old one, which makes some things below "work". We'll be able to remove this.
https://github.com/filecoin-project/lotus/blob/239e180683055746c29fe3e75ecb39c76309d270/node/impl/full/state.go#L142-L150

Some harder cases in Lotus:

  • The sealer inspects miner state to choose seal proof type. I think this should instead be inferred from the Window PoSt proof type we store in state. That PoSt -> Seal mapping will need to be in Lotus rather than actors, since it's not 1:1 and depends on epoch
  • The storage provider adaptor for go-fil-markets inspects state to get the seal proof type to create piece commitments. This will have to get it from the node API some other way (possibly using the PoSt -> Seal mapping)
  • The storage client similarly inspects state to choose a seal proof type to put in the deal proposal. It'll need to select it differently (maybe using that mapping again).

@anorth anorth self-assigned this Jan 4, 2021
@Stebalien
Copy link
Member

Yeah, some form of PoStProofType -> PreferredSealProofType mapping should make this pretty easy.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
change-state Changes state schema, necessitating major version upgrade/migration cleanup Technical debt recovery and other cleanup work
Projects
None yet
2 participants