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

fix(polka-storage-proofs): add sector padding #434

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

th7nder
Copy link
Contributor

@th7nder th7nder commented Oct 8, 2024

Description

Fixes #420.
Sector file is always full-sized one, no matter how many pieces are inside.
To generate a valid CommD from pieces, so a proof can be generated, we need to pad the sector with 'dummy' pieces so the CommD calculation from pieces is the same as the one from raw disk data.

This PR allows to create a Sector via create_sector function from pieces which do not take the entire space of the sector.

Important points for reviewers

When implementing #360 (or merging #423), the interface will probably need to be changed a bit so it accomodates use cases outside the PoRep Demo.
I didn't want to make it now, cause i don't know the shape of a client yet.

Checklist

  • Are there important points that reviewers should know?
    • If yes, which ones?
  • Make sure that you described what this change does.
  • If there are follow-ups, have you created issues for them?
    • If yes, which ones? / List them here
  • Have you tested this solution?
  • Were there any alternative implementations considered?
  • Did you document new (or modified) APIs?

@th7nder th7nder added the bug Something isn't working label Oct 8, 2024
@th7nder th7nder added this to the Phase 2 milestone Oct 8, 2024
@th7nder th7nder force-pushed the fix/420/multiple-pieces branch 2 times, most recently from 94fb211 to dc44944 Compare October 8, 2024 12:49
@th7nder th7nder self-assigned this Oct 8, 2024
@th7nder th7nder marked this pull request as ready for review October 8, 2024 12:54
Copy link
Collaborator

@jmg-duarte jmg-duarte left a comment

Choose a reason for hiding this comment

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

Some questions, overall looks good. Nice job 🚀

lib/polka-storage-proofs/src/porep/sealer.rs Show resolved Hide resolved
lib/polka-storage-proofs/src/porep/sealer.rs Show resolved Hide resolved
lib/polka-storage-proofs/src/porep/sealer.rs Outdated Show resolved Hide resolved
lib/polka-storage-proofs/src/porep/sealer.rs Outdated Show resolved Hide resolved
lib/polka-storage-proofs/src/porep/sealer.rs Outdated Show resolved Hide resolved
lib/polka-storage-proofs/src/porep/sealer.rs Outdated Show resolved Hide resolved
lib/polka-storage-proofs/src/porep/sealer.rs Outdated Show resolved Hide resolved
jmg-duarte
jmg-duarte previously approved these changes Oct 8, 2024
@th7nder th7nder added ready for review Review is needed and removed ready for review Review is needed labels Oct 9, 2024
@th7nder th7nder mentioned this pull request Oct 9, 2024
38 tasks
Copy link
Member

@cernicc cernicc left a comment

Choose a reason for hiding this comment

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

Nice 👍

@jmg-duarte jmg-duarte merged commit bf798b4 into develop Oct 9, 2024
5 checks passed
@jmg-duarte jmg-duarte deleted the fix/420/multiple-pieces branch October 9, 2024 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready for review Review is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

allow to create sectors with multiple pieces
3 participants