Repository navigation
Conversation
The coins view fuzz target called CCoinsViewCache::Cursor() only to assert that it throws. That path is an unsupported API contract and is independent of fuzz input, so it does not add useful fuzz coverage. Keep the remaining cache/view checks and DB-backed cursor coverage, where cursor iteration is supported.
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35562. ReviewsSee the guideline for information on the review process. |
|
This is cheap check, do we really need to remove this? |
Isn't it just fake coverage? Why would we fuzz test a deterministic throw? |
|
I think it is fine to pin behaviour here. We could do the same with a unit test I guess, but not sure if that is worth a pull request. Do you remember why this was an error and not just a hard assert? EDIT: Was curious why this is even a virtual method, and seems like it doesn't need to be. The few users can get it from the |
Indeed, pushed it as a new PR, added you as coauthor: #35572 |
72db4ac coins: drop stale cursor null checks (Lőrinc) 3d2f2d8 coins: pass UTXO stats view by reference (Lőrinc) 35aedb2 coins: drop cursor from base view (Lőrinc) c6fbe2f coins: pass DB view to cursor users (Lőrinc) Pull request description: **Problem:** `CCoinsView::Cursor()` makes cursor iteration look like a generic coins view operation, but cursor iteration is only supported by the DB-backed coins view. The cache override only threw, and the `coins_view` fuzz target only asserted that deterministic unsupported throw path. **Fix:** Make cursor iteration a `CCoinsViewDB` operation. Cursor users now take the DB-backed view directly, `CCoinsView` no longer exposes `Cursor()`, and the fuzz target keeps DB-backed cursor coverage while dropping the unsupported cache throw probe. The UTXO stats path is also tightened to pass the non-null DB view by reference, and stale null handling for DB cursors is removed. This was extracted from review discussion in #35295 (comment) and extended based on #35562 (comment). ACKs for top commit: achow101: ACK 72db4ac sedited: Re-ACK 72db4ac w0xlt: ACK 72db4ac andrewtoth: ACK 72db4ac Tree-SHA512: 12a81330a6ec1b91a7e4393f3761ea9ed4702ecb24312f1defa5a9a079a396ce921fc52f74fe296e5ac7ab20d5b5a8a84e858c96847f333c58b7fa9de9e8143e
9fdde8e coins: drop stale cursor null checks (Lőrinc) c42bfb3 coins: pass UTXO stats view by reference (Lőrinc) 18dab78 coins: drop cursor from base view (Lőrinc) fffcc01 coins: pass DB view to cursor users (Lőrinc) Pull request description: **Problem:** `CCoinsView::Cursor()` makes cursor iteration look like a generic coins view operation, but cursor iteration is only supported by the DB-backed coins view. The cache override only threw, and the `coins_view` fuzz target only asserted that deterministic unsupported throw path. **Fix:** Make cursor iteration a `CCoinsViewDB` operation. Cursor users now take the DB-backed view directly, `CCoinsView` no longer exposes `Cursor()`, and the fuzz target keeps DB-backed cursor coverage while dropping the unsupported cache throw probe. The UTXO stats path is also tightened to pass the non-null DB view by reference, and stale null handling for DB cursors is removed. This was extracted from review discussion in bitcoin/bitcoin#35295 (comment) and extended based on bitcoin/bitcoin#35562 (comment). ACKs for top commit: achow101: ACK 9fdde8e sedited: Re-ACK 9fdde8e w0xlt: ACK 9fdde8e andrewtoth: ACK 9fdde8e Tree-SHA512: 12a81330a6ec1b91a7e4393f3761ea9ed4702ecb24312f1defa5a9a079a396ce921fc52f74fe296e5ac7ab20d5b5a8a84e858c96847f333c58b7fa9de9e8143e
72db4accbf5bae74d061db1aeee9e0688c0da2f5 coins: drop stale cursor null checks (Lőrinc) 3d2f2d8de09d162863f7b8e7e48e347d7d87c648 coins: pass UTXO stats view by reference (Lőrinc) 35aedb2823692756dbe958b08f415c2b3e0be4ea coins: drop cursor from base view (Lőrinc) c6fbe2f66cff3846068795b3e2c459242b7be56b coins: pass DB view to cursor users (Lőrinc) Pull request description: **Problem:** `CCoinsView::Cursor()` makes cursor iteration look like a generic coins view operation, but cursor iteration is only supported by the DB-backed coins view. The cache override only threw, and the `coins_view` fuzz target only asserted that deterministic unsupported throw path. **Fix:** Make cursor iteration a `CCoinsViewDB` operation. Cursor users now take the DB-backed view directly, `CCoinsView` no longer exposes `Cursor()`, and the fuzz target keeps DB-backed cursor coverage while dropping the unsupported cache throw probe. The UTXO stats path is also tightened to pass the non-null DB view by reference, and stale null handling for DB cursors is removed. This was extracted from review discussion in bitcoin/bitcoin#35295 (comment) and extended based on bitcoin/bitcoin#35562 (comment). ACKs for top commit: achow101: ACK 72db4accbf5bae74d061db1aeee9e0688c0da2f5 sedited: Re-ACK 72db4accbf5bae74d061db1aeee9e0688c0da2f5 w0xlt: ACK 72db4accbf5bae74d061db1aeee9e0688c0da2f5 andrewtoth: ACK 72db4accbf5bae74d061db1aeee9e0688c0da2f5 Tree-SHA512: 12a81330a6ec1b91a7e4393f3761ea9ed4702ecb24312f1defa5a9a079a396ce921fc52f74fe296e5ac7ab20d5b5a8a84e858c96847f333c58b7fa9de9e8143e
Problem: The
coins_viewfuzz target checked thatCCoinsViewCache::Cursor()throws, but that method is intentionally unsupported and always throws: https://github.com/bitcoin/bitcoin/blob/93c6ea147422199777ddbc5f6d04134b82420b76/src/coins.h#L450-L452Fix: Remove the input-independent throw check from the fuzz target. The target still exercises the useful cache/view behavior, and keeps DB-backed cursor coverage where cursor iteration is supported.
Some leftover scope-guards were also removed.
This was extracted from review discussion in #35295 (comment).