dgb: M3 §7b scrypt digest -> pow_hash little-endian conversion (u256::from_le_bytes) - #155
Closed
frstrtr wants to merge 2 commits into
Closed
dgb: M3 §7b scrypt digest -> pow_hash little-endian conversion (u256::from_le_bytes)#155frstrtr wants to merge 2 commits into
frstrtr wants to merge 2 commits into
Conversation
…:from_le_bytes) Add u256::from_le_bytes: builds a 256-bit value from a 32-byte little-endian digest (the scrypt_1024_1_1_256 PoW output), limb[0] = least-significant 8 bytes, mirroring bitcoin UintToArith256. This is the bytes->field half of dropping the embedded DigiByte Core Scrypt digest into HeaderSample::pow_hash at the ingest boundary; the scrypt CALL itself (btclibs) lands next slice. Header-only, depends only on <cstdint>/builtin unsigned char, so the standalone header_chain guard keeps linking with NO btclibs scrypt dependency. +1 vector folded INTO header_chain_test (no new gtest target; #143 NOT_BUILT trap avoided): pins LE limb mapping, zero/max boundaries, and proves a converted digest feeds the existing full-width PoW-satisfaction gate (not a low64 proxy). 22/22 PASS.
…024_1_1_256 Links the btclibs Scrypt PoW TU set (scrypt.cpp + SHA256 family) into header_chain_test and adds an end-to-end test that runs the real scrypt_1024_1_1_256 over an 80-byte header, converts the 32-byte LE digest via u256::from_le_bytes, pins it as a self-derived KAT, and feeds it through the live full-width satisfaction gate (accept vs pow_limit, reject vs a tiny target -> proves full-width ordering, not a low64 proxy). Compiles only the scrypt + SHA256 crypto TUs directly (not the full btclibs archive, whose siphash TU needs the removed base_uint<256> symbol, and not core/the dgb OBJECT lib) -- linking an existing scrypt.cpp, no shared source modified. Same target name, still in both build.yml --target allowlists. Proves the conversion primitive end-to-end against a genuine Scrypt digest; does NOT wire scrypt into the production node.cpp ingest path (that lands in embedded-daemon Phase A, scoped with an exe-smoke).
frstrtr
force-pushed
the
dgb/m3-scrypt-digest-conv
branch
from
June 18, 2026 13:58
58c80b8 to
f49a89e
Compare
This was referenced Jun 18, 2026
Owner
Author
|
Superseded by #158. Base branch dgb/m3-scrypt-window-walk predates the #153 squash-merge (81fef6a), so this PR diffed the whole already-merged §7b stack. #158 carries the same digest-conversion commits (04f1da6 + 4d62bbc) cherry-picked clean onto current master, plus the integrator-accepted retarget-no-op + MTP-guard tail. Branch preserved (no --delete-branch). |
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 #153 (held until #153 merges; merge order #151(done) -> #153 -> this).
Scope: src/impl/dgb/ ONLY. Header-only, -only, no btclibs link, no shared-base/bitcoin_family entanglement.
What it does:
Evidence (head b1e7bc7): header_chain_test 22/22 PASS, build EXIT=0.
NOTE: this lands the conversion primitive only. The actual scrypt() CALL at ingest (which needs scrypt.cpp linkage) is the SEPARATE pending slice flagged to integrator for (a) link scrypt.cpp into header_chain_test vs (b) call in node.cpp + exe-smoke — not in this PR.
HOLD merge — integrator clears in dependency order.