mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 10:44:38 +00:00
test: split CreateNewBlock_validity into independent test cases #36852
No reviewers
Labels
No labels
Android
Backport
Block storage
Brainstorming
Bug
Build system
CI failed
Consensus
Data corruption
Descriptors
Docs
DrahtBot Guix build requested
Feature
Fuzzing
GUI
Good First Review
IPC
Insufficient Review
Kernel
Linux/Unix
Mempool
Mining
Needs Backport (31.x)
Needs Backport (32.x)
Needs Benchmark
Needs Conceptual Review
Needs backport (30.x)
Needs rebase
Needs release note
Net
P2P
PSBT
Privacy
Private Broadcast
Questions and Help
RPC/REST/ZMQ
Refactoring
Resource usage
Review club
Scripts and tools
Settings
TX fees and policy
Tests
Tracking Issue
UTXO Db and Indexes
Up for grabs
Upstream
Utils/log/libs
Validation
Waiting for author
Wallet
Windows
good first issue
interfaces
macOS
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin/bitcoin!36852
Loading…
Reference in a new issue
No description provided.
Delete branch "test-declarative-miner-basic"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
CreateNewBlock_validitymines a 110-block chain and then runs four subtests on it as member functions. The subtests share one chain, so each starts from whatever the previous one left behind, and the caller has to patchTip()->nHeightbetween them. InsideTestBasicMininga singleCMutableTransactionis reused across all sections, with each section overwriting some of its fields, so the transaction a section actually tests depends on every section before it.This PR removes both kinds of hidden state.
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.
A summary of reviews will appear here.
Conflicts
Reviewers, this pull request conflicts with the following ones:
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.
🔵 Suggestion · Redundant chain mining remains in
CreateNewBlock_validityAfter the split,
CreateNewBlock_validitystill mines the 110-block chain without consuming it, while all four extracted cases already execute the same assertion-bearing helper.Location:
src/test/miner_tests.cpp:981(head).🔵 Suggestion ·
basic_miningstill inherits parent IDs and entry metadata between sectionsAlthough behavior matches base, the declarative transactions still depend on a repeatedly overwritten
hashand persistent entry-helper settings, leaving some test inputs implicit.Location:
src/test/miner_tests.cpp:595(head).Review coverage was incomplete.
Reviewed:
13847d55430b· Review report · Previous reportspermalink
ralph review:
Split the helper extraction into its own commit (
71204c4b34). It's move-only.Addressed the LLM linter comment:
submitSolutionOld7is now checked withBOOST_CHECK_EXCEPTION(..., HasReason{"Old submitSolution (@7) not supported"}) instead ofBOOST_CHECK_THROW.