mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 10:47:36 +00:00
test: cover feeThreshold = MAX_MONEY in interface_ipc_mining.py #35598
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!35598
Loading…
Reference in a new issue
No description provided.
Delete branch "2026/06/max-money"
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?
This adds coverage for when BlockWaitOptions's
feeThresholdis set toMAX_MONEY. In other words, when the IPC client is only interested in tip updates, not in fee increases.This tested ended up in #33922 at some point https://github.com/bitcoin/bitcoin/pull/33922#issuecomment-3674495132, but doesn't really belong there.
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.
If your review is incorrectly listed, please copy-paste
<!--meta-tag:bot-skip-->into the comment that the bot should ignore.Conflicts
No conflicts as of last run.
LLM Linter (✨ experimental)
Possible places where comparison-specific test macros should replace generic comparisons:
test/functional/interface_ipc_mining.py:assert template3 is None→ Preferassert_equal(template3, None).2026-10-15 04:12:45
ACK 4f74b73
Mostly reviewing this in isolation, as I have not looked at #33922 in depth, it makes sense that this should be a PR on its own
The change updates the functional test to explicitly ignore mempool fee increases while waiting for a tip update, then restores the lower fee threshold for subsequent checks.
These changes look good to me. Left a minor non-blocking suggestion below,
In 4f74b73 (test: cover feeThreshold = MAX_MONEY)
Would be nice if there were a comment explaining the assertion here. Something like
Added the suggested comment.
It's unrelated. That PR is about memory tracking and management, this test is about adding coverages to pre-existing
waitNext()behavior. The PR touches the same test file, so it was easy to add. But now that I'm considering alternative approaches for #33922, the test becomes a distraction - and it might be a long time before it lands.https://github.com/bitcoin/bitcoin/pull/35598/changes/bd1771fc0cd248438e87b028b096f59ffc976d18 (test: cover feeThreshold = MAX_MONEY)
The test still passes with
waitoptions.feeThreshold = 1That is because
WaitAndCreateNewBlock()checks for a tip update immediately and then goes to sleep waiting for a tip update, only waking up 1 second after being called or at the timeout deadline before checking for a fee-based update:github.com/bitcoin/bitcoin@a8823c0996/src/node/miner.cpp (L452-L460)and
wait_and_doonly sleeps for 0.1s:github.com/bitcoin/bitcoin@a8823c0996/test/functional/test_framework/ipc_util.py (L59-L67)so the fee check never even has a chance, since
WaitAndCreateNewBlock()is still asleep waiting for a new tip whenwait_and_doproduces one, returns, and the fee check has never even had a chance..To fix it, easier shown than explained I think:
and adding an arg to
wait_and_do:https://github.com/bitcoin/bitcoin/pull/35598/changes/bd1771fc0cd248438e87b028b096f59ffc976d18 (test: cover feeThreshold = MAX_MONEY)
(see comment above: https://github.com/bitcoin/bitcoin/pull/35598/changes/bd1771fc0cd248438e87b028b096f59ffc976d18#r3509745119)
Should probably add a transaction here to check in another way that MAX_MONEY works to prevent fee-based template updates:
Ah oops. The counter intuitive thing here is that
waitNext()will ignore fee changes in the first second. This might change with cluster mempool when we get rid of the internal tick mechanism, see https://github.com/bitcoin/bitcoin/pull/35581. But the adjusted test should continue to work.Took your suggestion with some adjustments.
Also taken
Turns out it was a a good idea to make this a separate PR. Fixed https://github.com/bitcoin/bitcoin/pull/35598#discussion_r3509745119
Approach ACK
Left two comments.
Nit, feel free to ignore. With
feeThresholdat MAX_MONEY the fee block inWaitAndCreateNewBlockis skipped, so nothing is checked at the deadline either. The assert is right, the comment isn't.mining_types.hdescribes MAX_MONEY as an optimization, and no fee delta can reach it, so the MAX_MONEY half of that guard only exists to skip building the template. Dropping it, and theAssumeit makes true, leaves the test green in both release and debug builds. With the wrap below it fails. What do you think about covering that here too?reACK https://github.com/bitcoin/bitcoin/pull/35598/changes/0de7c2bf7912d5632c33195b7764e06c46e5f7b0
Changes look good to me. It is useful to have this coverage, and it makes sense as a standalone pr. Left non-blocking comment
In https://github.com/bitcoin/bitcoin/pull/35598/changes/0de7c2bf7912d5632c33195b7764e06c46e5f7b0: test: cover feeThreshold = MAX_MONEY
non_blocking nit
Looking at this again, my understanding is that the transaction added above is intentionally kept in the mempool to verify that
feeThreshold = MAX_MONEYignores a fee increase and still times out. That part makes sense.After the timeout, however, that transaction remains in the mempool and is not included in
template2. Therefore, oncefeeThresholdis changed to 1, it already satisfies the threshold before this second wait starts.waitNextis allowed to return without waiting for the transaction added by this lambda.Verified this by delaying the lambda
The test fails when asserting the transaction count because it only contains 2 transactions. Would it be clearer to consume the existing fee increase directly here?
Later on
template6would still test adding a transaction whilewaitNextis active, verifying that a new template is returnedRebased just in case, and addressed feedback from @jeanpablojp and @enirox001.
Base:
649bc0a645eb127a9b1e6d078f8d129be6380c87Head:
7dfc7ef17ca33d01b854f63789cd357fee84f22dI found no actionable issues in this static review.
Full review report
reACK https://github.com/bitcoin/bitcoin/pull/35598/changes/8fb2dbc0d6e788da43c8e471b6e8027b03b8b6ec
Previous feedback has been addressed, Changes LGTM.
🐙 This pull request conflicts with the target branch and needs rebase.
Rebased after #36446.
crACK
github.com/bitcoin/bitcoin@7dfc7ef17c(apologies for the delay)
ACK
7dfc7ef17creACK https://github.com/bitcoin/bitcoin/pull/35598/changes/7dfc7ef17ca33d01b854f63789cd357fee84f22d