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

feat: FIP-0061: Add new PoSt proof types #1727

Merged
merged 2 commits into from
Mar 28, 2023
Merged

Conversation

arajasek
Copy link
Contributor

@arajasek arajasek commented Mar 24, 2023

Needs #1726 and #1728

@codecov-commenter
Copy link

codecov-commenter commented Mar 24, 2023

Codecov Report

Merging #1727 (96e7365) into master (37643fc) will decrease coverage by 0.10%.
The diff coverage is 4.65%.

Additional details and impacted files

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
shared/src/sector/registered_proof.rs 0.74% <0.00%> (-0.07%) ⬇️
shared/src/version/mod.rs 7.69% <ø> (ø)
fvm/src/gas/price_list.rs 32.93% <20.00%> (ø)
fvm/src/machine/default.rs 53.12% <100.00%> (ø)

... and 2 files with indirect coverage changes

Copy link

@ZenGround0 ZenGround0 left a 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 => {

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

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?

Copy link
Contributor Author

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)

Choose a reason for hiding this comment

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

Typo StackedDRGWindow64GiBV1

Copy link
Contributor Author

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),

Choose a reason for hiding this comment

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

shared/src/version/mod.rs Outdated Show resolved Hide resolved
@@ -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 }
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Member

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,
Copy link
Member

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(
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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?

Copy link
Contributor Author

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 {
Copy link
Member

Choose a reason for hiding this comment

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

Ditto above.

@arajasek arajasek force-pushed the feat/grindability branch from 6471127 to 5936cc5 Compare March 27, 2023 21:20
@arajasek arajasek force-pushed the feat/grindability branch from 5936cc5 to 4ca30aa Compare March 28, 2023 15:34
@Stebalien Stebalien merged commit 676142e into master Mar 28, 2023
@Stebalien Stebalien deleted the feat/grindability branch March 28, 2023 16:08
Comment on lines +405 to +409
StackedDRGWindow2KiBV1P1 => Ok(Self::StackedDrgWindow2KiBV1),
StackedDRGWindow8MiBV1P1 => Ok(Self::StackedDrgWindow8MiBV1),
StackedDRGWindow512MiBV1P1 => Ok(Self::StackedDrgWindow512MiBV1),
StackedDRGWindow32GiBV1P1 => Ok(Self::StackedDrgWindow32GiBV1),
StackedDRGWindow64GiBV1P1 => Ok(Self::StackedDrgWindow64GiBV1),
Copy link

@0x5459 0x5459 Apr 23, 2023

Choose a reason for hiding this comment

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

Suggested change
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?

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