Skip to content

Commit

Permalink
address some feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed Jul 26, 2019
1 parent bcdc808 commit b208982
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions proof-of-spacetime.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func GeneratePoSt(sectorSize BytesAmount, sectors []commR) (PoStProof, FaultSet)

for n in 0..POST_CHALLENGES_COUNT {
attempt := 0
'inner: for {
while inclusionProof[n] == nil {
challenge := DerivePoStChallenge(seed, n, faults, attempt)
sector := challenge % sectorSize
// check if we landed in a previously marked faulty sector
Expand All @@ -71,7 +71,6 @@ func GeneratePoSt(sectorSize BytesAmount, sectors []commR) (PoStProof, FaultSet)
} else {
// no fault, move on to the next challenge
inclusionProofs[n] = inclusionProof
break 'inner
}
}
}
Expand Down Expand Up @@ -119,15 +118,14 @@ func DerivePoStChallenges(sectorSize BytesAmount, seed []byte, faults FaultSet)

for n in 0..POST_CHALLENGES_COUNT {
attempt := 0
'inner: for {
while challenges[n] == nil {
challenge := DerivePoStChallenge(seed, n, faults, attempt)

// check if we landed in a faulty sector
sector := challenge % sectorSize
if !faults.Contains(sector) {
// Valid challenge
challenges[n] = challenge
break 'inner
}
// invalid challenge, regenerate
attempt += 1
Expand Down Expand Up @@ -197,4 +195,3 @@ for c in range POST_CHALLENGES_COUNT {
#### Verification of PoSt proof

- SNARK proof check: **Check** that given the SNARK proof and the public inputs, the SNARK verification outputs true
- Challenges check: rederive the challenges, based on the seed, and check that they are equal.

0 comments on commit b208982

Please sign in to comment.