-
Notifications
You must be signed in to change notification settings - Fork 211
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
PoET validation #781
Conversation
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 |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log as well
There was a problem hiding this 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
poet-ref
&merkle-tree
.