test: Fix race condition in IPC interface block propagation test
What changed, and why it matters
This commit fixes a test-only race condition in a Bitcoin Core functional test. It changes which node is checked first when verifying that a newly submitted block has propagated, so the test waits for the local node to update its own chain before checking that all nodes agree. There is no change to production code, no user-facing behavior change, and no security vulnerability in the Bitcoin Core software itself.
No security action required. Treat as a normal test reliability improvement.
Security signals we found
No production code modified
Test-only synchronization fix
No input validation, cryptography, or consensus code touched
Evidence from the diff
In test/functional/interface_ipc.py, the test previously asserted that nodes[1] had the new block height before confirming nodes[0] had updated. The patch reverses the logic: it first asserts nodes[0] (the IPC node that submitted the block) has reached current_block_height + 1, then calls sync_all(), and finally asserts both nodes share the same chain tip. This eliminates a race where the assertion on nodes[1] could run before nodes[0] had finished processing the submitted block. The change is purely within a Python functional test.
Changed components
test/functional/interface_ipc.pyInspect captured patch +3 / −1
diff --git a/test/functional/interface_ipc.py b/test/functional/interface_ipc.py
index 23036649..75d340d5 100755
--- a/test/functional/interface_ipc.py
+++ b/test/functional/interface_ipc.py
@@ -256,9 +256,11 @@ class IPCInterfaceTest(BitcoinTestFramework):
assert_equal(res.result, True)
self.log.debug("Block should propagate")
- assert_equal(self.nodes[1].getchaintips()[0]["height"], current_block_height + 1)
+ # Check that the IPC node actually updates its own chain
+ assert_equal(self.nodes[0].getchaintips()[0]["height"], current_block_height + 1)
# Stalls if a regression causes submitBlock() to accept an invalid block:
self.sync_all()
+ # Check that the other node accepts the block
assert_equal(self.nodes[0].getchaintips()[0], self.nodes[1].getchaintips()[0])
miniwallet.rescan_utxos()
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.