Better debug info for invalid spend proofs #341

Open
opened 7 months ago by duke · 0 comments
duke commented 7 months ago
Owner
2023-11-07 14:38:38 Build: Invalid sapling spend proof! note value=XXX

Sometimes when making a ztx, we can get an invalid sapling spend proof. This means for some reason the inputs (zutxos aka notes) of the ztx are not valid. Most often this is caused by a node thinking a zutxo is not spent, but it actually is spent. This can happen if a node crashes before it records that it spent a zutxo. A rescan usually fixes this situation, but it's possible that this happens for other reasons. Recently we added the value of the note causing the error, which gives a little bit more info, but it's still not ideal. For instance, we can have multiple notes of the same value and we don't know which is causing the error.

The actual reason the spend proof is invalid is buried in rust code which is not even told to the C++ code (there is no error code returned from librustzcash_sapling_spend_proof called from src/transaction_buider.cpp) so the C++ code can't report the exact reason. Maybe we can add a STDERR print inside the rust code.

``` 2023-11-07 14:38:38 Build: Invalid sapling spend proof! note value=XXX ``` Sometimes when making a ztx, we can get an invalid sapling spend proof. This means for some reason the inputs (zutxos aka notes) of the ztx are not valid. Most often this is caused by a node thinking a zutxo is not spent, but it actually is spent. This can happen if a node crashes before it records that it spent a zutxo. A rescan usually fixes this situation, but it's possible that this happens for other reasons. Recently we added the value of the note causing the error, which gives a little bit more info, but it's still not ideal. For instance, we can have multiple notes of the same value and we don't know which is causing the error. The actual reason the spend proof is invalid is buried in rust code which is not even told to the C++ code (there is no error code returned from `librustzcash_sapling_spend_proof` called from src/transaction_buider.cpp) so the C++ code can't report the exact reason. Maybe we can add a STDERR print inside the rust code.
duke added the
feature
label 7 months ago
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.