dgb: tip_hash() accessor + previousblockhash wire (Stage 4c) - #216
Merged
Conversation
This was referenced Jun 19, 2026
…rk template (Stage 4c) HeaderSample gains a sha256d block-id slot (block_hash, u256; 0 == not populated here, the same sentinel pow_hash uses) and HeaderChain gains a tip_hash() accessor returning the newest header's id or nullopt when the chain is empty / the tip carries no hash. get_current_work_template emits previousblockhash as GBT-conventional big-endian display hex ONLY when tip_hash() is present -- a truthful conditional, never a fabricated hash. The embedded P2P header-download -> validate_and_append ingest that populates block_hash lands in a following slice; until then tip_hash() is nullopt and previousblockhash is held back exactly as before. bits stays HELD BACK: the only embedded next-target source is the DigiShield damped multiply, which DGB Core runs as MultiShield V4 (a global window across all 5 algos == V37); a Scrypt-only walk cannot reconstruct it, so the ingest path demotes that gate to a no-op. Emitting a digishield-derived bits would be a known-wrong value. The authoritative bits is the external-daemon GBT value, not plumbed into this embedded path yet -- surfaced as [decision-needed]. Fenced to src/impl/dgb (4 files); test cases added to existing targets header_chain_test (31 -> 35) and dgb_work_source_test (15 -> 16), no new gtest target so the build.yml allowlist is unchanged. Both green.
frstrtr
force-pushed
the
dgb/stage-4c-prevhash-accessor
branch
from
June 19, 2026 16:47
fb8f91b to
30a6d78
Compare
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.
Stacked on #212. Stage 4c continuation: wire previousblockhash into the work template via a new HeaderChain tip_hash() accessor; bits stays HELD (V37 MultiShield-V4 wall) — surfaced as [decision-needed].
What lands
What is HELD
Scope / safety
HOLD merge.