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(pallet-proofs): verify PoSt #461

Merged
merged 22 commits into from
Oct 23, 2024
Merged

Conversation

th7nder
Copy link
Contributor

@th7nder th7nder commented Oct 17, 2024

Description

This PR introduces PoSt Verification on-chain, so it can be called later via ProofVerification trait by pallet-storage-provider.
Fixes #439.

➜  polka-storage git:(feat/439/verify-post-onchain) ✗ RUST_LOG=error ./target/debug/polka-storage-provider-client utils po-rep --proof-parameters-path 2KiB.porep.params --cache-directory /tmp/psp-cache test-data-big.car baga6ea4seaqbfhdvmk5qygevit25ztjwl7voyikb5k2fqcl2lsuefhaqtukuiii
Creating sector...
Precommitting...
Proving...
CommR: "4afb35f82a95a10187a913bc14520d9a1d173328265b301b5dcf440ef2583950"
CommD: "129c7562bb0c189544f5dccd365feaec2141eab458097a5ca8429c109d154421"
Proof: [Proof { a: G1Affine { x: Fp(0x0712731fdf37045b9bd4af625795bcaa9f7b072f16387da51e53233924b5faf04dc4ee8d882f9e4eefcb10665d653dd9), y: Fp(0x025f7e365a57ade5069e8cbf4e4b37b7af99544cafa1cd67187d2a3c7ce39c5944cd6c4404953878e190ac96108317fe), infinity: false }, b: G2Affine { x: Fp2 { c0: Fp(0x192ddbd3ff1616342f7c78fbd0a23c8f7aadcf5af3f0183ad5bbf4bd807ff964c89b9343bc2f8823e58159553628593b), c1: Fp(0x091605d5ce1441c2ed3ea6cf1752c0828af0d39410d523253df8aaba230d48f712302d20c2373446b0b457f0e0ea8710) }, y: Fp2 { c0: Fp(0x0e71d70728a1bbd3595b03d9f8a77909f99e9f7a3c4f1bc9526b0d8a4d420bbdb5737e8dfa60f7b67664985af8fc2586), c1: Fp(0x14db99f814ca5f0ac7c1ca6fb6d5862afe7833471f81c057292251cedc29928126402afc70e9b5acd832512d48aa5301) }, infinity: false }, c: G1Affine { x: Fp(0x01c83fddbd1840ffcc1be570f6e1a95a670722b4ae156b75ec7bdd38af8097a0afb52290e3b538414e977f3e6d16698d), y: Fp(0x0e659c1a9e7e328012d8b849e0056b88fa5374a0952141a98e8870e10a57734c9d37efe38ce0639a715b2e433831f430), infinity: false } }]
Wrote proof to /home/th7nder/workspace/eiger/polka-storage/77.sector.proof.porep.scale
➜  polka-storage git:(feat/439/verify-post-onchain) ✗ RUST_LOG=ERROR ./target/debug/polka-storage-provider-client utils po-st --proof-parameters-path 2KiB.post.params --cache-directory /tmp/psp-cache 77.sector.sealed 4afb35f82a95a10187a913bc14520d9a1d173328265b301b5dcf440ef2583950   
Loading parameters...
Proving...
Wrote proof to /home/th7nder/workspace/eiger/polka-storage/77.sector.proof.post.scale

Important points for reviewers

This is a showcase with test running in mocks.
This should be integrated later with Storage Provider Pallet #449.

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?
  • Have you tested this solution?
  • Were there any alternative implementations considered?
  • Did you document new (or modified) APIs?

@th7nder th7nder added this to the Phase 2 milestone Oct 17, 2024
@th7nder th7nder self-assigned this Oct 17, 2024
@th7nder th7nder mentioned this pull request Oct 17, 2024
38 tasks
@th7nder th7nder force-pushed the feat/439/verify-post-onchain branch 3 times, most recently from 3ceff66 to 9c884d4 Compare October 21, 2024 13:05
@th7nder th7nder marked this pull request as ready for review October 21, 2024 13:32
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.

Mostly looks good to me, but would appreciate some docs on this API. I know there's little to go off of from FC, but let's try 🥹

pallets/proofs/src/lib.rs Show resolved Hide resolved
primitives/proofs/src/traits.rs Show resolved Hide resolved
pallets/proofs/src/tests.rs Outdated Show resolved Hide resolved
pallets/proofs/src/post/config.rs Show resolved Hide resolved
pallets/proofs/src/post/config.rs Outdated Show resolved Hide resolved
pallets/proofs/src/post/mod.rs Show resolved Hide resolved
@th7nder th7nder added the ready for review Review is needed label Oct 22, 2024
@th7nder th7nder force-pushed the feat/439/verify-post-onchain branch from ab84e3d to 05a3732 Compare October 22, 2024 11:33
@th7nder th7nder added ready for review Review is needed and removed ready for review Review is needed labels Oct 22, 2024
@th7nder th7nder force-pushed the feat/439/verify-post-onchain branch from a926ff9 to aaacac6 Compare October 22, 2024 12:28
@th7nder th7nder added ready for review Review is needed and removed ready for review Review is needed labels Oct 22, 2024
@th7nder th7nder added ready for review Review is needed and removed ready for review Review is needed labels Oct 22, 2024
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.

GJ Komrad

@jmg-duarte jmg-duarte enabled auto-merge (squash) October 22, 2024 18:17
@th7nder th7nder requested a review from neutrinoks October 22, 2024 20:01
@jmg-duarte jmg-duarte merged commit 31108c1 into develop Oct 23, 2024
5 checks passed
@jmg-duarte jmg-duarte deleted the feat/439/verify-post-onchain branch October 23, 2024 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Verify PoSt
3 participants