-
Notifications
You must be signed in to change notification settings - Fork 86
More verbose ledger_poc_v3:verify error #1343
base: master
Are you sure you want to change the base?
Conversation
0d43362
to
684c189
Compare
@@ -1202,8 +1202,8 @@ verify_poc_details(Txn, PoC, Keys) -> | |||
SigFun = libp2p_crypto:mk_sig_fun(PrivKey), | |||
SignedPayload = SigFun(OnionHash), | |||
case blockchain_ledger_poc_v3:verify(PoC, Challenger, BlockHash) of | |||
false -> {error, mismatched_poc}; | |||
true -> | |||
{error, R} -> {error, {mismatched_poc, R}}; |
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.
Need to update the spec of verify_poc_details/3
with this new error.
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.
Updated in 12860ea
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.
Did it slightly differently though and made the error return a tuple of tuples.
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.
Sensible. So close to a record!
Co-authored-by: Siraaj Khandkar <siraaj@khandkar.net>
9569a43
to
12860ea
Compare
@@ -1202,8 +1202,8 @@ verify_poc_details(Txn, PoC, Keys) -> | |||
SigFun = libp2p_crypto:mk_sig_fun(PrivKey), | |||
SignedPayload = SigFun(OnionHash), | |||
case blockchain_ledger_poc_v3:verify(PoC, Challenger, BlockHash) of | |||
false -> {error, mismatched_poc}; | |||
true -> | |||
{error, R} -> {error, {mismatched_poc, R}}; |
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.
Sensible. So close to a record!
Problem
When ledger POC verification fails we can't really tell whether it failed due to incorrect challenger or the block hash.
Solution
This switches the return type for
poc_v3:verify
to be anok | {error, ...}
and passes it down.