-
Notifications
You must be signed in to change notification settings - Fork 140
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
feat: FIP-0061: Add new PoSt proof types #1727
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #1727 +/- ##
==========================================
- Coverage 55.62% 55.52% -0.10%
==========================================
Files 146 146
Lines 14016 14037 +21
==========================================
- Hits 7796 7794 -2
- Misses 6220 6243 +23
|
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.
You'll probably want someone who knows ref-fvm a little better but once the typo is fixed this LGTM.
If you have time please explore removing registered_seal_proof
or updating it to use current seal proofs. It would also be helpful to get an explanation for why we need nv20 specified here.
--edit--
I was a bad person who didn't review tests and now I see why we need nv20
@@ -130,19 +145,19 @@ impl RegisteredPoStProof { | |||
pub fn registered_seal_proof(self) -> Result<RegisteredSealProof, String> { | |||
use RegisteredPoStProof::*; | |||
match self { | |||
StackedDRGWindow64GiBV1 | StackedDRGWinning64GiBV1 => { | |||
StackedDRGWindow64GiBV1P1 | StackedDRGWindow64GiBV1 | StackedDRGWinning64GiBV1 => { |
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.
Not sure what's going on here but it seems off that we're not returning V1P1 seal proofs
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.
Can't find any callers in builtin actors, is it possible we can just kill this function?
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.
Opened #1728 for this
Ok(RegisteredPoStProof::StackedDRGWindow32GiBV1) | ||
} | ||
RegisteredPoStProof::StackedDRGWindow64GiBV1P1 => { | ||
Ok(RegisteredPoStProof::StackedDRGWindow64GiBV1P1) |
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.
Typo StackedDRGWindow64GiBV1
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.
E A G L E E Y E S
Self::StackedDRG32GiBV1 | Self::StackedDRG32GiBV1P1 => Ok(StackedDRGWindow32GiBV1P1), | ||
Self::StackedDRG2KiBV1 | Self::StackedDRG2KiBV1P1 => Ok(StackedDRGWindow2KiBV1P1), | ||
Self::StackedDRG8MiBV1 | Self::StackedDRG8MiBV1P1 => Ok(StackedDRGWindow8MiBV1P1), | ||
Self::StackedDRG512MiBV1 | Self::StackedDRG512MiBV1P1 => Ok(StackedDRGWindow512MiBV1P1), |
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.
✅
96e7365
to
6471127
Compare
@@ -31,7 +31,7 @@ lazy_static = "1.4.0" | |||
derive-getters = "0.2.0" | |||
derive_more = "0.99.17" | |||
replace_with = "0.1.7" | |||
filecoin-proofs-api = { version = "13", default-features = false } | |||
filecoin-proofs-api = { version = "14", default-features = false } |
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.
Is this network breaking? I.e., will updating to version 14 cause a hard-fork?
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.
The answer should be no, but I will let @cryptonemo confirm.
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.
The answer is yes, this is nv19
scope and beyond.
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.
To clarify, it's yes once the new PoSt Proof types are used/accepted. If you continue using the old PoSt proof types in the new version of proofs, it's compatible.
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.
Ok, that's all we care about. Adding support for new types is backwards compatible.
@@ -108,6 +108,11 @@ pub enum RegisteredPoStProof { | |||
StackedDRGWindow512MiBV1, | |||
StackedDRGWindow32GiBV1, | |||
StackedDRGWindow64GiBV1, | |||
StackedDRGWindow2KiBV1P1, |
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.
Nit but... can't we just call these V2?
Invalid(i) => Err(format!("unsupported proof type: {}", i)), | ||
} | ||
} | ||
} | ||
|
||
/// Convert the v1_1 PoSt Proof type to the older v1 types (used in nv18 and below) | ||
pub fn convert_window_post_proof_v1p1_to_v1( |
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.
Is there any reason to put this here rather in, e.g., the builtin actors? I'd like to shrink the amount of proofs logic in this crate in general.
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.
We can, and honestly we should -- I was following the pattern we have the versioned seal proofs above (hence the V1P1 name too), but I'm quite happy to break the pattern instead.
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.
Ah... Well, if we already have the pattern of versions and are using them in the crypto code... it's probably not worth it?
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 gonna keep the naming pattern for now, because I think diverging there will be confusing. But I will move the helpers to actors code, because they're only used there, and I don't want anything else depending on it.
} | ||
|
||
/// Convert the v1_1 PoSt Proof type to the older v1 types (used in nv18 and below) | ||
pub fn is_window_post_proof_v1p1(rpp: RegisteredPoStProof) -> bool { |
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.
Ditto above.
6471127
to
5936cc5
Compare
5936cc5
to
4ca30aa
Compare
StackedDRGWindow2KiBV1P1 => Ok(Self::StackedDrgWindow2KiBV1), | ||
StackedDRGWindow8MiBV1P1 => Ok(Self::StackedDrgWindow8MiBV1), | ||
StackedDRGWindow512MiBV1P1 => Ok(Self::StackedDrgWindow512MiBV1), | ||
StackedDRGWindow32GiBV1P1 => Ok(Self::StackedDrgWindow32GiBV1), | ||
StackedDRGWindow64GiBV1P1 => Ok(Self::StackedDrgWindow64GiBV1), |
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.
StackedDRGWindow2KiBV1P1 => Ok(Self::StackedDrgWindow2KiBV1), | |
StackedDRGWindow8MiBV1P1 => Ok(Self::StackedDrgWindow8MiBV1), | |
StackedDRGWindow512MiBV1P1 => Ok(Self::StackedDrgWindow512MiBV1), | |
StackedDRGWindow32GiBV1P1 => Ok(Self::StackedDrgWindow32GiBV1), | |
StackedDRGWindow64GiBV1P1 => Ok(Self::StackedDrgWindow64GiBV1), | |
StackedDRGWindow2KiBV1P1 => Ok(Self::StackedDrgWindow2KiBV1_2), | |
StackedDRGWindow8MiBV1P1 => Ok(Self::StackedDrgWindow8MiBV1_2), | |
StackedDRGWindow512MiBV1P1 => Ok(Self::StackedDrgWindow512MiBV1_2), | |
StackedDRGWindow32GiBV1P1 => Ok(Self::StackedDrgWindow32GiBV1_2), | |
StackedDRGWindow64GiBV1P1 => Ok(Self::StackedDrgWindow64GiBV1_2), |
typo?
Needs #1726 and #1728