This implement the suggested followups from #33966. Each commit links to the original comment.
The most important change is the extra asserts added in miner: ensure block_max_weight is flattened before limit checks.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--006a51241073e994b41acfe9ec718e94-->
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35403.
<!--021abf342d371248e50ceaed478a90ca-->
See the guideline for information on the review process. A summary of reviews will appear here.
<!--174a7506f384e20aa4161008e828411d-->
Reviewers, this pull request conflicts with the following ones:
BlockTemplateCache by ismaelsadeeq)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-->
Possible places where comparison-specific test macros should replace generic comparisons:
assert template7 is None -> assert_equal(template7, None)<sup>2026-05-29 07:52:25</sup>
The Alpine CI failure log is 278 MB, is that sane? https://github.com/bitcoin/bitcoin/actions/runs/26592252276/job/78354332966?pr=35403
It hit feature_dbcrash.py, so that's probably #35379. (I asked about the log size there)
CI ran on the new warp drive (since #35378).
This commit does not change behavior.
Suggested in https://github.com/bitcoin/bitcoin/pull/33966#discussion_r3303357712
The option defaults to true, so describe the intended exceptional use
case as disabling validation for tests and benchmarks.
Suggested in https://github.com/bitcoin/bitcoin/pull/33966#discussion_r3303387586
Suggested in https://github.com/bitcoin/bitcoin/pull/33966#discussion_r3303462087
See https://github.com/bitcoin/bitcoin/pull/33966#discussion_r3317409504
575 | @@ -577,9 +576,11 @@ async def async_routine(): 576 | 577 | def run_test(self): 578 | self.miniwallet = MiniWallet(self.nodes[0]) 579 | + # Amount of time the test is allowed to wait or be idle before it should fail. 580 | + self.default_ipc_timeout = 1000.0 * self.options.timeout_factor
Why are you removing the comment that says the type is milliseconds?
Added unit to the new variable.
It would be nice if Python had something like std::chrono so we wouldn't need comments to substitute a type system :-)
It would be nice if Python had something like
std::chronoso we wouldn't need comments to substitute a type system :-)
Welcome to Python :)
llm nit: Looks like the latest push itched the llm:
[test/functional/interface_ipc_mining.py] assert template7 is None -> assert_equal(template7, None)
It keeps bringing that up, but it's not a line we're touching. I'm also not sure if it's actually better.
The benefit is only visible on a failure: Instead of just knowing that template7 is not None, the value of template7 will also be printed. If that isn't better, then assert_equal should just be removed from the utils.
assert_equal is useful when you care about the actual result. That's often the case, but not here. Anything other than None is a bug.
assert_equalis useful when you care about the actual result. That's often the case, but not here.
Why not? In other mining contexts we also compare that the result is None, because if it wasn't None and the test fails intermittently, it is useful to know why exactly it failed (was it a duplicate block, or an intermittently invalid one, or a bug in the test code itself [return False vs return None], etc ...)
E.g.:
test/functional/p2p_segwit.py: assert_equal(None, self.nodes[0].submitblock(block.serialize().hex()))
Generally I think, if a pattern makes sense, it should be used consistently.