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: integrate submit_windowed_post with pallet proofs #593

Merged
merged 25 commits into from
Nov 27, 2024

Conversation

th7nder
Copy link
Contributor

@th7nder th7nder commented Nov 19, 2024

Description

Fixes #449.

  1. It implements the logic in submit_windowed_post of Pallet Storage Provider, so it calls Pallet Proofs to verify PoSt.
  2. Exposes Runtime API to fetch the current deadline, so current_deadline.challenge will be able to be called in the pipeline Submit Windowed PoSt in the Pipeline #596.

I tested it by running:

  1. examples/rpc_publish.sh examples/test-data-big.car
  2. export CACHE=<directory outputed in rpc_publish>
  3. export COMMR=<commr outputed by rpc publish>
  4. export CHALLENGE_BLOCK=<runtime api query call for current_deadline>
  5. ./target/release/polka-storage-provider-client proofs post --sr25519-key "//Charlie" --cache-directory $CACHE --proof-parameters-path 2KiB.post.params --sector-number 1 $CACHE/../sealed/1 --challenge_block $CHALLENGE_BLOCK $COMMR
  6. submit_windowed_post via polkadot.js.org with the file 1.sector.proof.post.scale.

image+

CACHE_FOLDER="/tmp/F8JAt9d/deals_storage/cache"

PROVIDER="//Charlie"
CAR_FILE="../examples/test-data-big.car"
SECTOR_ID=1

COMMR="bagboea4b5abcauws63b3gksuxld4zxk7jlzx776kmh66rokcngcvhtwsuksxpklm"
CHALLENGE_BLOCK="108"
POST_PARAMS_PATH="../2KiB.post.params"

polka-storage-provider-client proofs post \
--sr25519-key "$PROVIDER" \
--proof-parameters-path "$POST_PARAMS_PATH" \
--cache-directory "$CACHE_FOLDER" \
--sector-number "$SECTOR_ID" \
--challenge-block "$CHALLENGE_BLOCK" \
"$CACHE_FOLDER/../sealed/$SECTOR_ID" \
"$COMMR"

Important things

  • maat test is broken! I need to fix it, but it's out of the scope as I'm planning bigger changes to it.

Checklist

@th7nder th7nder changed the title feat: submit_windowed_post feat: integrate submit_windowed_post with pallet proofs Nov 19, 2024
@jmg-duarte jmg-duarte added the ready for review Review is needed label Nov 22, 2024
@th7nder th7nder force-pushed the feat/449/verify-post branch 2 times, most recently from c8e197b to dbb0316 Compare November 25, 2024 20:29
@th7nder th7nder self-assigned this Nov 25, 2024
@th7nder th7nder marked this pull request as ready for review November 25, 2024 20:29
@th7nder th7nder requested a review from a team November 25, 2024 20:30
@th7nder th7nder added this to the Phase 3 milestone Nov 25, 2024
@th7nder th7nder mentioned this pull request Nov 26, 2024
9 tasks
@th7nder th7nder removed the ready for review Review is needed label Nov 26, 2024
@th7nder th7nder added the ready for review Review is needed label Nov 26, 2024
@th7nder th7nder added ready for review Review is needed and removed ready for review Review is needed labels Nov 26, 2024
@th7nder th7nder added ready for review Review is needed and removed ready for review Review is needed labels Nov 26, 2024
@th7nder th7nder added ready for review Review is needed and removed ready for review Review is needed labels Nov 26, 2024
@th7nder th7nder added ready for review Review is needed and removed ready for review Review is needed labels Nov 26, 2024
@th7nder th7nder requested a review from cernicc November 27, 2024 10:32
@th7nder th7nder added ready for review Review is needed and removed ready for review Review is needed labels Nov 27, 2024
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.

Good job 💪

@th7nder th7nder merged commit d4705c4 into develop Nov 27, 2024
5 checks passed
@th7nder th7nder deleted the feat/449/verify-post branch November 27, 2024 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review Review is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate verify_submit_windowed_post with pallet-proofs verify PoSt
4 participants