-
Notifications
You must be signed in to change notification settings - Fork 314
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
Window PoSt challenge generation should not depend on sector order #1270
Labels
Comments
porcuquine
changed the title
Window PoSt challenge generation
Window PoSt challenge generation should not depend on sector order
Sep 1, 2020
@cryptonemo I think this is the one we considered as a good candidate for a proofs-upgrade test. Will obviously have to think about branching strategy so we don't introduce a breaking change elsewhere until ready to actually upgrade. |
cryptonemo
added a commit
that referenced
this issue
Mar 8, 2023
* feat: minimal changes to fix the open 'grindability issue' Some more details here: #1270 * feat: simplify some tests in filecoin-proofs * fix: apply review feedback and re-factor * feat(storage-proofs-post): add grindability tests (#1663) * fix: apply review feedback and refactor * style: clippy update * fix: apply review feedback --------- Co-authored-by: DrPeterVanNostrand <jnz@riseup.net>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Window PoSt challenge generation currently depends on the ordering of provided sectors.
This is considered to be a 'protocol bug' in that this is the behavior which has been specified and audited. However, it allows for miners to influence challenges by shuffling their sectors. One possible (and probably cleanest) solution is to make challenge-generation independent of sector ordering — at the cost of a breaking change (so extant Window PoSts would not verify with the new code, requiring a network reset or proofs upgrade).
In the current code, the function
generate_leaf_challenges
appears to do the right thing, but this function is only called from Election PoSt so is not actually used.rust-fil-proofs/storage-proofs/post/src/fallback/vanilla.rs
Lines 192 to 211 in 4a07a86
Notice, however, that in
generate_public_input
for Fallback PoSt,challenge_index
depends oni
(the sector's index within the submitted partition). This must not be the case.rust-fil-proofs/storage-proofs/post/src/fallback/compound.rs
Lines 68 to 76 in 4a07a86
challenge_index
can just ben
. Each sector's challenge indexes should range from 0 tochallenge_count
.The same can be seen in the vanilla proof:
rust-fil-proofs/storage-proofs/post/src/fallback/vanilla.rs
Lines 324 to 333 in 4a07a86
Acceptance criteria
Window PoSt challenge generation does not depend on the ordering of provided sectors.
Risks + pitfalls
This will be a breaking change to proofs: a proof generated with the previous Window PoSt will not verify. Therefore, we will either:
This decision must be made at the project level, and we can support either path. If the proofs upgrade is selected, a new issue should be created; and both that new issue and the current should be addressed in the PR realizing this work.
Note that because Winning PoSt uses only a single partition, this change should not affect Winning PoSt challenge generation. Therefore, we don't technically need a new RegisteredProof. We should at least verify that this is true if we opt for a proofs upgrade.
In that case, we must either actually upgrade Winning PoSt also (which may be simplest) — or else explicitly verify that old Winning PoSt proofs still pass (and that challenge generation is unaffected).
Where to begin
rust-fil-proofs/storage-proofs/post/src/fallback/vanilla.rs
Lines 324 to 333 in 4a07a86
rust-fil-proofs/storage-proofs/post/src/fallback/compound.rs
Lines 68 to 76 in 4a07a86
The text was updated successfully, but these errors were encountered: