Skip to content

dgb(phase-b): pin sharechain bits encoding to oracle-literal goldens - #554

Merged
frstrtr merged 1 commit into
masterfrom
dgb/phase-b-share-bits-oracle-pin
Jun 26, 2026
Merged

dgb(phase-b): pin sharechain bits encoding to oracle-literal goldens#554
frstrtr merged 1 commit into
masterfrom
dgb/phase-b-share-bits-oracle-pin

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 26, 2026

Copy link
Copy Markdown
Owner

FENCED Phase-B conformance KAT — no production code touched (dgb/test + CI allowlist only).

Pins the DGB sharechain share-difficulty bits (compact FloatingInteger) field against LITERAL goldens from the oracle reference encoder frstrtr/p2pool-dgb-scrypt bitcoin/data.py from_target_upper_bound, at the canonical retarget anchors:

  • MAX_TARGET (2^236-1) -> 0x1e0fffff
  • MAX_TARGET/30 (genesis bits floor) -> 0x1e008888
  • MAX_TARGET/2 -> 0x1e07ffff
  • MIN_TARGET (0) -> 0x00000000

Removes the SUT-vs-SUT circularity in dgb_share_target_genesis_test (which only asserts compute_share_target == target_to_bits_upper_bound of the same target) by pinning the absolute on-wire compact value. Registered in this-dir CMakeLists.txt + both build.yml --target allowlists (#143). 8/8 pass locally. GPG-signed.

Per-coin isolation: fenced to src/impl/dgb/. No self-merge.

FENCED Phase-B conformance KAT (no production code touched). Pins the DGB
sharechain share-difficulty bits (compact FloatingInteger) field against
LITERAL goldens produced by the oracle reference encoder
frstrtr/p2pool-dgb-scrypt bitcoin/data.py from_target_upper_bound, at the
canonical retarget anchors: MAX_TARGET -> 0x1e0fffff, MAX_TARGET/30 ->
0x1e008888, MAX_TARGET/2 -> 0x1e07ffff, MIN_TARGET -> 0x00000000.

Removes the SUT-vs-SUT circularity in dgb_share_target_genesis_test (which
asserts compute_share_target == target_to_bits_upper_bound of the same
target) by pinning the absolute on-wire compact value. Registered in this
dir CMakeLists.txt and both build.yml --target allowlists (#143). 8/8 pass.
@frstrtr
frstrtr merged commit 0a83b6e into master Jun 26, 2026
32 checks passed
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.

1 participant