test: wait for the node to finish the last block in p2p_ping_ibd #36687

Manually merged
instagibbs merged 1 commit from 2026-10-ping-ibd-race into master 2026-10-31 17:19:58 +00:00 AGit
instagibbs commented 2026-10-28 18:08:31 +00:00 (Migrated from github.com)

ProcessBlock() stamps m_last_block_time only after ProcessNewBlock() returns, so getblockcount can show the new height, with nothing in flight, before the stamp is taken. A bumpmocktime in that gap stamps the block with the bumped time, and the final bump then leaves the ping timeout exactly at its boundary, where it never fires. Sync with a ping after the last block, so the node has finished processing it before the clock moves.

The race has been present since the test was added in #36080.

Faling job:
https://github.com/bitcoin/bitcoin/actions/runs/40589303246/job/122489039018

ProcessBlock() stamps m_last_block_time only after ProcessNewBlock() returns, so getblockcount can show the new height, with nothing in flight, before the stamp is taken. A bumpmocktime in that gap stamps the block with the bumped time, and the final bump then leaves the ping timeout exactly at its boundary, where it never fires. Sync with a ping after the last block, so the node has finished processing it before the clock moves. The race has been present since the test was added in #36080. Faling job: https://github.com/bitcoin/bitcoin/actions/runs/40589303246/job/122489039018
DrahtBot commented 2026-10-28 18:08:41 +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 mzumsande, sedited

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

<!--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/36687 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/36687.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/36687#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 | [mzumsande](https://github.com/bitcoin/bitcoin/pull/36687#pullrequestreview-5723678900), [sedited](https://github.com/bitcoin/bitcoin/pull/36687#pullrequestreview-5724013682) | 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. <!--5faf32d7da4f0f540f40219e4f7537a3-->
instagibbs commented 2026-10-28 18:08:47 +00:00 (Migrated from github.com)

@mzumsande

@mzumsande
First-time contributor

No verified findings are available from this review.

Review coverage was incomplete.


Reviewed: 9af82f9872ca · Full review report · Previous reports

permalink

<!-- forgejo-review-bot:bitcoin/bitcoin --> <!-- ralph-engine:current:242447a4cf2eea8cf36c662182c044a4a03c53913b7033d9c612118a365b2d2c:1e657457416e20a18d8d2d136919c48e28e1bfed7a76c26939ab1ca10a232c6a --> <!-- ralph-base:ab7e668cc6af5d716ad40166d1f88235a2f6d25d --> <!-- ralph-head:9af82f9872ca1a9e8d4645c537b23af4bc861ed2 --> <!-- ralph-case:5deaf77dd408f79741f01737ff7f5d7dc59b46d0658329a26376ac3bdf1535f1 --> No verified findings are available from this review. Review coverage was incomplete. <!-- Review tier: routine --> --- Reviewed: [`9af82f9872ca`](<https://git.fish.foo/bitcoin/bitcoin/commit/9af82f9872ca1a9e8d4645c537b23af4bc861ed2>) · [Full review report](<https://review.fish.foo/traces/36687-9af82f9872ca1a9e8d4645c537b23af4bc861ed2-1912-2.html>) · [Previous reports](<https://review.fish.foo/traces/36687/>) [permalink](<https://review.fish.foo/traces/36687-9af82f9872ca1a9e8d4645c537b23af4bc861ed2-1912-2.html>)
mzumsande (Migrated from github.com) reviewed 2026-10-31 16:01:31 +00:00
mzumsande (Migrated from github.com) left a comment

Code Review ACK 9af82f9872

Code Review ACK 9af82f9872ca1a9e8d4645c537b23af4bc861ed2
sedited (Migrated from github.com) approved these changes 2026-10-31 17:15:24 +00:00
sedited (Migrated from github.com) left a comment
ACK 9af82f9872ca1a9e8d4645c537b23af4bc861ed2
Sign in to join this conversation.
No reviewers
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!36687
No description provided.