aboutsummaryrefslogtreecommitdiff
path: root/src/test/fuzz/coins_view.cpp
AgeCommit message (Collapse)Author
2022-05-20fuzz: Remove useless GetUTXOStats fuzz caseCarl Dong
In the GetUTXOStats fuzz case, GetUTXOStats is always called with a CCoinsViewCache. Which is guaranteed to throw a std::logic_error when its ::Cursor() method is called on the first line of GetUTXOStats. In the fuzz case, we basically catch this logic error and declare victory if we caught it. There is no point to fuzzing this deterministic logic. Confirmed with IWYU that the node/coinstats.h #include is no longer necessary.
2022-02-02test: Avoid testing negative block heightsMarcoFalke
2022-01-11Remove cs_main lock annotation from ChainstateManager.m_blockmanRyan Ofsky
BlockManager is a large data structure, and cs_main is not required to take its address or access every part of it. Individual BlockManager fields and methods which do require cs_main like m_block_index and LookupBlockIndex are already annotated separately, and these other annotations describe locking requirements more accurately and do a better job enforcing thread safety. Since cs_main is not needed to access the address of the m_block object, this commit drops cs_main LOCK calls which were added pointlessly to satisfy this annotation in the past. Co-authored-by: Carl Dong <contact@carldong.me>
2022-01-06Add src/node/* code to node:: namespaceRussell Yanofsky
2021-11-16policy: Treat taproot as always activeMarcoFalke
2021-11-12fuzz: replace every fuzzer-controlled loop with a LIMITED_WHILE loopAndrew Poelstra
Blindly chose a cap of 10000 iterations for every loop, except for the two in script_ops.cpp and scriptnum_ops.cpp which appeared to (sometimes) be deserializing individual bytes; capped those to one million to ensure that sometimes we try working with massive scripts. There was also one fuzzer-controlled loop in timedata.cpp which was already capped, so I left that alone. git grep 'while (fuzz' should now run clean except for timedata.cpp
2021-09-30[MOVEONLY] consensus: move amount.h into consensusfanquake
Move amount.h to consensus/amount.h. Renames, adds missing and removes uneeded includes.
2021-07-20Merge bitcoin/bitcoin#22232: refactor: Pass interpreter flags as uint32_t ↵MarcoFalke
instead of signed int fa621ededdfe31a200b77a8787de7e3d2e667aec refactor: Pass script verify flags as uint32_t (MarcoFalke) Pull request description: The flags are cast to unsigned in the interpreter anyway, so avoid the confusion (and fuzz crashes) by just passing them as unsigned from the beginning. Also, the flags are often inverted bit-wise with the `~` operator, which also works on signed integers, but might cause confusion as the sign bit is flipped. Fixes #22233 ACKs for top commit: theStack: Concept and code review ACK fa621ededdfe31a200b77a8787de7e3d2e667aec kristapsk: ACK fa621ededdfe31a200b77a8787de7e3d2e667aec jonatack: ACK fa621ededdfe31a200b77a8787de7e3d2e667aec Tree-SHA512: ea0720f32f823fa7f075309978672aa39773c6019d12b6c1c9d611fc1983a76115b7fe2a28d50814673bb6415c311ccc05b99d6e871575fb6900faf75ed17769
2021-06-17refactor: wrap CCoinsViewCursor in unique_ptrJames O'Beirne
Specifically with CCoinsViewDB, if a raw cursor is allocated and not freed, a cryptic leveldb assertion failure occurs on CCoinsViewDB destruction. See: https://github.com/google/leveldb/issues/142#issuecomment-414418135
2021-06-14refactor: Pass script verify flags as uint32_tMarcoFalke
They are cast to unsigned anyway when calling VerifyScript, bitcoinconsensus_verify_script*, or CountWitnessSigOps.
2021-06-10fuzz: Initialize a TestingSetup for test_one_inputCarl Dong
For fuzz tests that need it.
2021-05-25Mark `CheckTxInputs` `[[nodiscard]]` (out-param `txfee` only set if call is ↵practicalswift
successful). Avoid UUM in fuzzing harness `coins_view`.
2021-05-17fuzz: Add missing CheckTransaction before CheckTxInputsMarcoFalke
2021-04-19refactor: Pass hash_type to CoinsStats in stats objectFabian Jahr
2021-03-30fuzz: Removed unused try-catch in coins_viewMarcoFalke
2021-03-08node/coinstats: Pass in BlockManager to GetUTXOStatsCarl Dong
2021-03-03Move MakeNoLogFileContext to common libtest_util, and use it in benchMarcoFalke
Can be reviewed with --color-moved=dimmed-zebra
2021-02-22scripted-diff: Rename MakeFuzzingContext to MakeNoLogFileContextMarcoFalke
-BEGIN VERIFY SCRIPT- # Rename sed -i -e 's/MakeFuzzingContext/MakeNoLogFileContext/g' $(git grep -l MakeFuzzingContext) # Bump the copyright of touched files in this scripted diff to avoid touching them again later ./contrib/devtools/copyright_header.py update ./src/test/fuzz/ -END VERIFY SCRIPT-
2021-01-21fuzz: Initialize a full TestingSetup where appropriateCarl Dong
A full TestingSetup is required for both coins_view and load_external_block_file as they interact with the active chainstate.
2021-01-11fuzz: Introduce CallOneOf helper to replace switch-caseMarcoFalke
Can be reviewed with --ignore-all-space
2020-12-10fuzz: Link all targets onceMarcoFalke
2020-10-30Only relay Taproot spends if next block has it activePieter Wuille
2020-06-22rpc: gettxoutsetinfo can specify hash_type (only legacy option for now)Fabian Jahr
2020-05-25tests: Add fuzzing harness for CCoinsViewCachepracticalswift