Implement transaction::Verifier
rejection tests for Sapling
#2426
Labels
C-enhancement
Category: This is an improvement
Motivation
PR #2419 added some
transaction::Verifier
tests that check if a transaction with Sapling spends and outputs is accepted. However, no tests that check if the verifier is rejecting transactions was implemented. This prevents detection of consensus regression bugs that cause invalid transactions to be erroneously accepted.Specifications
Sapling spend consensus rules:
Sapling output consensus rules:
Designs
An initial idea for testing would be to add the following test cases:
cv
rk
PI_ZKSpend
cv
wpk
(epk
?)PI_ZKOutput
One important thing to consider is if signing or generating ZK proofs for the test cases take too long to run. If that is the case, it might be best to write the code to generate the transactions to be rejected and store them serialized in the repository, and just load and deserialize them during testing. However, it will probably be good to keep the code to generate the serialized transactions some place where it can be periodically executed to regenerate the transactions and guarantee that the generation code doesn't break as well.
The text was updated successfully, but these errors were encountered: