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

PoET validation #781

Merged
merged 5 commits into from Apr 4, 2019
Merged

PoET validation #781

merged 5 commits into from Apr 4, 2019

Conversation

moshababo
Copy link
Contributor

  • Upgraded poet-ref & merkle-tree.
  • Added validations for membership, poet, poetMembership to be used now in the NIPST constructions, and later in other places as well.

nipst/poet.go Outdated
@@ -142,32 +184,17 @@ func (c *RPCPoetClient) subscribeProof(r *poetRound,
return nil, err
}

labels, err := wireLabelsToNative(res.Proof.L)
labels, err := rpc.WireLabelsToNative(res.Proof.L)
if err != nil {
return nil, err
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

print error here as well

@@ -115,7 +150,7 @@ func (c *RPCPoetClient) subscribeMembershipProof(r *poetRound,
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()

req := api.GetMembershipProofRequest{RoundId: int32(r.id), Commitment: challenge[:], Wait: true}
req := api.GetMembershipProofRequest{RoundId: int32(r.id), Challenge: challenge[:], Wait: true}
res, err := c.client.GetMembershipProof(ctx, &req)
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log errors here

}

res, err := v.VerifyNIP(*p.proof)
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log error

func (p *poetProof) valid() bool {
// TODO(moshababo): implement
return true
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log

nipst/nipst.go Outdated

if !nb.verifyPoetMembership(nb.nipst.poetMembershipProof, proof) {
nb.errChan <- fmt.Errorf("received an invalid PoET proof due to "+
"commitment value, found: %x, expected: %x",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log as well

Copy link
Contributor

@antonlerner antonlerner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please log errors and merge

@moshababo moshababo merged commit 2ae176e into develop Apr 4, 2019
@moshababo moshababo deleted the verify_poet branch April 4, 2019 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants