Skip to content

fix JD chain tip race - #365

Merged
GitGab19 merged 3 commits into
stratum-mining:mainfrom
plebhash:2026-03-23-jd-chain-tip-race
Mar 24, 2026
Merged

GitGab19 merged 3 commits into
stratum-mining:mainfrom
plebhash:2026-03-23-jd-chain-tip-race

Conversation

@plebhash

Copy link
Copy Markdown
Member

close #364

@plebhash
plebhash force-pushed the 2026-03-23-jd-chain-tip-race branch 2 times, most recently from 2c0dec6 to 73cefe2 Compare March 23, 2026 20:12
@plebhash
plebhash marked this pull request as draft March 23, 2026 21:03
@plebhash
plebhash marked this pull request as ready for review March 23, 2026 21:17
@plebhash
plebhash marked this pull request as draft March 23, 2026 21:17
@plebhash
plebhash marked this pull request as ready for review March 23, 2026 21:27
Comment thread bitcoin-core-sv2/src/job_declaration_protocol/io.rs
Comment thread pool-apps/jd-server/Cargo.toml
Comment thread bitcoin-core-sv2/src/job_declaration_protocol/io.rs
@plebhash
plebhash force-pushed the 2026-03-23-jd-chain-tip-race branch 2 times, most recently from 0652ead to 2373ced Compare March 24, 2026 02:31
@GitGab19

Copy link
Copy Markdown
Member

What about adding an integration test for simulating this scenario?

@plebhash

Copy link
Copy Markdown
Member Author

What about adding an integration test for simulating this scenario?

I contemplated the possibility

but I wonder if and how we can really reproduce this deterministically via integration tests, given that JDC and JDS run on the same machine

please note that a primary factor for this race condition is the travel time of messages between JDC and JDS (which explains why @lucasbalieiro didn't reproduce it on his round of signet tests)

@GitGab19

Copy link
Copy Markdown
Member

Yeah it's not an easy thing for sure, not a blocker.

Maybe we can keep thinking about it and add a test in the future.

@plebhash
plebhash force-pushed the 2026-03-23-jd-chain-tip-race branch from 2373ced to 0ce34ad Compare March 24, 2026 14:51
@GitGab19
GitGab19 merged commit 698e419 into stratum-mining:main Mar 24, 2026
12 checks passed
@plebhash

Copy link
Copy Markdown
Member Author

please note that a primary factor for this race condition is the travel time of messages between JDC and JDS (which explains why @lucasbalieiro didn't reproduce it on his round of signet tests)

correction: @lucasbalieiro did reproduce this on his round of signet tests: #299 (comment)

however the main point around integration tests remains... I cannot think of a way to reproduce this deterministically there

@plebhash
plebhash deleted the 2026-03-23-jd-chain-tip-race branch March 24, 2026 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JDC+JDS race condition on chain tip updates triggers fallback unnecessarily

3 participants