The Schnorr verification path of the signature cache is currently never hit in the unit tests, i.e. with the following patch they still pass:
diff --git a/src/script/sigcache.cpp b/src/script/sigcache.cpp
index c6fcc8f8eb..87688c1049 100644
--- a/src/script/sigcache.cpp
+++ b/src/script/sigcache.cpp
@@ -44,6 +44,7 @@ void SignatureCache::ComputeEntryECDSA(uint256& entry, const uint256& hash, cons
void SignatureCache::ComputeEntrySchnorr(uint256& entry, const uint256& hash, std::span<const unsigned char> sig, const XOnlyPubKey& pubkey) const
{
+ assert(false);
CSHA256 hasher = m_salted_hasher_schnorr;
hasher.Write(hash.begin(), 32).Write(pubkey.data(), pubkey.size()).Write(sig.data(), sig.size()).Finalize(entry.begin());
}
This PR adds missing coverage for that by adding a Taproot key-path spend to checkinputs_test in txvalidationcache_tests.cpp. Same as for the already-existing ECDSA spends, the caching is tested across a large number of flag combinations (using ValidateCheckInputsForAllFlags), both with an invalid Schnorr signature (-> should only fail if SCRIPT_VERIFY_TAPROOT is set) and a valid one (-> should pass for all flag combinations).