Merge 94d56b9def into merged_master (Bitcoin PR bitcoin/bitcoin#30141)

Added FIXMEs to blind_tests. TODO: de-globalise range/surjection proof sig cache logic.
This commit is contained in:
Tom Trevethan 2026-03-05 12:23:49 +00:00
commit aacf403349
19 changed files with 278 additions and 222 deletions

View file

@ -1567,7 +1567,7 @@ static std::vector<unsigned int> AllConsensusFlags()
/** Precomputed list of all valid combinations of consensus-relevant script validation flags. */
static const std::vector<unsigned int> ALL_CONSENSUS_FLAGS = AllConsensusFlags();
static void AssetTest(const UniValue& test)
static void AssetTest(const UniValue& test, SignatureCache& signature_cache)
{
BOOST_CHECK(test.isObject());
@ -1587,7 +1587,7 @@ static void AssetTest(const UniValue& test)
CTransaction tx(mtx);
PrecomputedTransactionData txdata(hash_genesis_block);
txdata.Init(tx, std::vector<CTxOut>(prevouts));
CachingTransactionSignatureChecker txcheck(&tx, idx, prevouts[idx].nValue, true, txdata);
CachingTransactionSignatureChecker txcheck(&tx, idx, prevouts[idx].nValue, true, signature_cache, txdata);
for (const auto flags : ALL_CONSENSUS_FLAGS) {
// "final": true tests are valid for all flags. Others are only valid with flags that are
@ -1606,7 +1606,7 @@ static void AssetTest(const UniValue& test)
CTransaction tx(mtx);
PrecomputedTransactionData txdata(hash_genesis_block);
txdata.Init(tx, std::vector<CTxOut>(prevouts));
CachingTransactionSignatureChecker txcheck(&tx, idx, prevouts[idx].nValue, true, txdata);
CachingTransactionSignatureChecker txcheck(&tx, idx, prevouts[idx].nValue, true, signature_cache, txdata);
for (const auto flags : ALL_CONSENSUS_FLAGS) {
// If a test is supposed to fail with test_flags, it should also fail with any superset thereof.
@ -1625,6 +1625,7 @@ BOOST_AUTO_TEST_CASE(script_assets_test)
// the script_assets_test.json file used by this test.
// ELEMENTS: qa-assets repo can be cloned here https://github.com/ElementsProject/qa-assets
// then set DIR_UNIT_TEST_DATA env var to /path/to/qa-assets/unit_test_data when running this test
SignatureCache signature_cache{DEFAULT_SIGNATURE_CACHE_BYTES};
const char* dir = std::getenv("DIR_UNIT_TEST_DATA");
BOOST_WARN_MESSAGE(dir != nullptr, "Variable DIR_UNIT_TEST_DATA unset, skipping script_assets_test");
@ -1646,7 +1647,7 @@ BOOST_AUTO_TEST_CASE(script_assets_test)
g_con_elementsmode = true;
for (size_t i = 0; i < tests.size(); i++) {
AssetTest(tests[i]);
AssetTest(tests[i], signature_cache);
}
g_con_elementsmode = false;
file.close();