tighten up bitcoin_core_sv2 JDP ValidationContext - #617
Draft
plebhash wants to merge 5 commits into
Draft
Conversation
bitcoin_core_sv2 JDP ValidationContext
plebhash
force-pushed
the
2026-07-14-tighter-validation-context
branch
9 times, most recently
from
July 15, 2026 21:20
3d638df to
f9465c7
Compare
2 tasks
…idation context Restrict DeclareMiningJob stale-chain-tip classification to actual prev_hash drift and simplify related context state. - classify stale-tip strictly by prev_hash drift (v30x + v31x) - remove redundant min_ntime from ValidationContext - make jd-server drift checks prev_hash-only - prune now-unused BIP34 mempool plumbing/logging - remove unused timestamp from JdResponse::Success - keep timestamp handling local to handler checkBlock assembly - rename remaining timestamp references to ntime for clarity
…mempool_mirror_prev_hash Replace the expensive createNewBlock call (which assembles a full block template with mempool transactions) with a lightweight getTip query. Only the prev_hash is needed for stale-tip detection, so updating just the mirror's prev_hash via getTip is sufficient when the tip changed. Rename force_update_mempool_mirror to force_update_mempool_mirror_prev_hash to make the narrowed scope explicit.
…in-tip When a declared job is already stale at arrival (coinbase built from an old tip), checkBlock returns bad-cb-height but prev_hash may not have drifted during validation. Treat this rejection as stale-chain-tip so that JDC's non-fatal stale path is exercised instead of triggering a fallback.
BIP34 mismatch is no longer detectable on `BitcoinCoreSv2JDP`, which now solely relies on `prev_hash` to detect chain tip drifts that is fine, because if BIP34 drifted, `prev_hash` will be inevitably different that's why we're changing the shape of `assert_jdp_stale_chain_tip_scenario`
Cover the path where a declared job uses a coinbase built from a previous tip that is no longer the current tip at validation time. In this scenario checkBlock rejects with bad-cb-height while no in-handler prev_hash drift occurs, so the handler must map the rejection to stale-chain-tip.
plebhash
force-pushed
the
2026-07-14-tighter-validation-context
branch
from
July 16, 2026 17:16
f9465c7 to
1253474
Compare
This was referenced Jul 17, 2026
plebhash
marked this pull request as draft
July 21, 2026 16:29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
close #597 #595
pre-requisite for #268