From b208982e11c167a012516092c91b334714fb68be Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Mon, 15 Jul 2019 14:41:26 +0200 Subject: [PATCH] address some feedback --- proof-of-spacetime.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/proof-of-spacetime.md b/proof-of-spacetime.md index 61a2cb248..de01da6f9 100644 --- a/proof-of-spacetime.md +++ b/proof-of-spacetime.md @@ -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 @@ -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 } } } @@ -119,7 +118,7 @@ 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 @@ -127,7 +126,6 @@ func DerivePoStChallenges(sectorSize BytesAmount, seed []byte, faults FaultSet) if !faults.Contains(sector) { // Valid challenge challenges[n] = challenge - break 'inner } // invalid challenge, regenerate attempt += 1 @@ -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.