test: avoid reusing AssumeUTXO coin insertion method in test fixtures #36601

Manually merged
l0rinc merged 1 commit from l0rinc/coins-tests-without-snapshot-bypass into master 2026-11-04 19:58:37 +00:00 AGit
l0rinc commented 2026-10-22 07:36:05 +00:00 (Migrated from github.com)

Problem: Several coin-cache fixtures use EmplaceCoinInternalDANGER just to set up their coins, even though it is reserved for snapshot loading.

Fix: Use AddCoin and SpendCoin for fixture setup, keeping the entries dirty but not fresh, as before. Keep the simulation, fuzz and duplicate-insertion coverage that intentionally tests the bypass.

This is a small extraction from #36598 that can be reviewed and merged independently of the broader AssumeUTXO removal demo. The overlay fixture change also follows the earlier suggestion in #35295.

**Problem:** Several coin-cache fixtures use `EmplaceCoinInternalDANGER` just to set up their coins, even though it is reserved for snapshot loading. **Fix:** Use `AddCoin` and `SpendCoin` for fixture setup, keeping the entries dirty but not fresh, as before. Keep the [simulation](https://github.com/bitcoin/bitcoin/pull/33512), [fuzz and duplicate-insertion coverage](https://github.com/bitcoin/bitcoin/pull/32313) that intentionally tests the bypass. This is a small extraction from #36598 that can be reviewed and merged independently of the broader AssumeUTXO removal demo. The overlay fixture change also follows the earlier [suggestion in #35295](https://github.com/bitcoin/bitcoin/pull/35295#discussion_r3421846300).
DrahtBot commented 2026-10-22 07:36:13 +00:00 (Migrated from github.com)

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

External sites

Reviews

See the guideline and AI policy for information on the review process.

Type Reviewers
ACK Hamza1610

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #36603 (Improve loadtxoutset performance by ajtowns)
  • #35511 (RFC: consensus: Make CAmount a class by hodlinator)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

<!--e57a25ab6845829454e8d69fc972939a--> The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. <!--006a51241073e994b41acfe9ec718e94--> ### External sites * Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/36601 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/36601.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/36601#author-ralph <!--021abf342d371248e50ceaed478a90ca--> ### Reviews See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. | Type | Reviewers | | ---- | --------- | | ACK | [Hamza1610](https://github.com/bitcoin/bitcoin/pull/36601#issuecomment-6365340911) | If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore. <!--174a7506f384e20aa4161008e828411d--> ### Conflicts Reviewers, this pull request conflicts with the following ones: * [#36603](https://github.com/bitcoin/bitcoin/pull/36603) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36603.svg"></sub> (Improve loadtxoutset performance by ajtowns) * [#35511](https://github.com/bitcoin/bitcoin/pull/35511) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/35511.svg"></sub> (RFC: consensus: Make `CAmount` a class by hodlinator) If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. <!--5faf32d7da4f0f540f40219e4f7537a3-->
First-time contributor

No verified findings are available from this review.

Review coverage was incomplete.


Reviewed: 1c62336903cc · Full review report · Previous reports

permalink

<!-- forgejo-review-bot:bitcoin/bitcoin --> <!-- ralph-engine:current:7ba49ca38b129bc35f71e566efbd136b17ae87b582376d9eebd04f18959e8274:9b5e0237a3fe9e1d05225291551198f07780ddb92e41e55ade9e98c2687fc127 --> <!-- ralph-base:43a33e513c4044dc01d92e77da76f2e98faaedb5 --> <!-- ralph-head:1c62336903ccf5f7f2aa1217eaf8344dee4e197a --> <!-- ralph-case:89f661689582eebafa36e992ae31bbeace72b62a82097afa8ccaf901d5788de0 --> No verified findings are available from this review. Review coverage was incomplete. <!-- Review tier: routine --> --- Reviewed: [`1c62336903cc`](<https://git.fish.foo/bitcoin/bitcoin/commit/1c62336903ccf5f7f2aa1217eaf8344dee4e197a>) · [Full review report](<https://review.fish.foo/traces/36601-1c62336903ccf5f7f2aa1217eaf8344dee4e197a-1820-3.html>) · [Previous reports](<https://review.fish.foo/traces/36601/>) [permalink](<https://review.fish.foo/traces/36601-1c62336903ccf5f7f2aa1217eaf8344dee4e197a-1820-3.html>)
DrahtBot commented 2026-10-22 08:34:13 +00:00 (Migrated from github.com)

🚧 At least one of the CI tasks failed.
Task 32 bit ARM: https://github.com/bitcoin/bitcoin/actions/runs/39741631849/job/119699974970
LLM reason (✨ experimental): CTest failed because ARM-target test executables could not run on the host and were interpreted as shell scripts, producing syntax errors.

Hints

Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:

  • Possibly due to a silent merge conflict (the changes in this pull request being
    incompatible with the current code in the target branch). If so, make sure to rebase on the latest
    commit of the target branch.

  • A sanitizer issue, which can only be found by compiling with the sanitizer and running the
    affected test.

  • An intermittent issue.

Leave a comment here, if you need help tracking down a confusing failure.

<!--85328a0da195eb286784d51f73fa0af9--> 🚧 At least one of the CI tasks failed. <sub>Task `32 bit ARM`: https://github.com/bitcoin/bitcoin/actions/runs/39741631849/job/119699974970</sub> <sub>LLM reason (✨ experimental): CTest failed because ARM-target test executables could not run on the host and were interpreted as shell scripts, producing syntax errors.</sub> <details><summary>Hints</summary> Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example: * Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch. * A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test. * An intermittent issue. Leave a comment here, if you need help tracking down a confusing failure. </details>
Hamza1610 commented 2026-10-23 12:53:49 +00:00 (Migrated from github.com)

Tested ACK 1c62336903
Ran ./build/bin/test_bitcoin -t coins_tests,coinsviewoverlay_tests with, clean and structured changes.

*** No errors detected

Tested ACK 1c62336903 Ran `./build/bin/test_bitcoin -t coins_tests,coinsviewoverlay_tests` with, clean and structured changes. > *** No errors detected
sedited (Migrated from github.com) approved these changes 2026-11-04 19:54:43 +00:00
sedited (Migrated from github.com) left a comment
ACK 1c62336903ccf5f7f2aa1217eaf8344dee4e197a
andrewtoth (Migrated from github.com) approved these changes 2026-11-06 18:29:26 +00:00
andrewtoth (Migrated from github.com) left a comment

post-merge ACK 1c62336903

post-merge ACK 1c62336903ccf5f7f2aa1217eaf8344dee4e197a
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!36601
No description provided.