Skip to content

dgb: DGB+DOGE phase-DC dual-target SELECTION scaffold (fenced KAT) - #490

Merged
frstrtr merged 1 commit into
masterfrom
dgb/doge-dc-dual-target-select
Jun 25, 2026
Merged

dgb: DGB+DOGE phase-DC dual-target SELECTION scaffold (fenced KAT)#490
frstrtr merged 1 commit into
masterfrom
dgb/doge-dc-dual-target-select

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 25, 2026

Copy link
Copy Markdown
Owner

DGB+DOGE phase-DC — dual-target SELECTION scaffold (fenced KAT)

Pure, header-only DC decision contract the eventual DC run-loop wiring (AUX_DOGE node seam + submit) must satisfy. Landed BEFORE the seam is touched — the AUX_DOGE seam (node.hpp:57 bind + CMakeLists.txt:10 un-stub) stays parked on #82 broadcaster + ltc-doge written concurrence per integrator greenlight (2026-06-25). This PR has zero seam surface.

coin/aux_dual_target_select.hpp (not rewired)

test/aux_dual_target_select_test.cpp — 5/5 green

Non-circular goldens: fabe6d6d tag, mint embed truth table, independent threshold table, no-job suppression, and the impossible DOGE-win-without-mint state the guard rejects. Registered in test/CMakeLists.txt + both build.yml --target allowlists (#143 NOT_BUILT trap).

Fenced dgb/, consumes nothing in src/impl/doge, no node seam touch, zero consensus surface. GPG-signed. NO self-merge — integrator taps.

@frstrtr
frstrtr force-pushed the dgb/doge-dc-dual-target-select branch 2 times, most recently from d8774f1 to ef4e5ce Compare June 25, 2026 16:34
Pure, header-only DC decision contract the eventual DC run-loop wiring
(AUX_DOGE node seam + submit) must satisfy, landed BEFORE the seam is
touched (seam parked on #82 + ltc-doge written concurrence).

coin/aux_dual_target_select.hpp:
  - aux_mint_decision(aux_enabled, has_doge_job): embed the fabe6d6d MM
    commitment IFF aux MM enabled AND a DOGE job is present; else no-op
    (mirrors #486 embed-at-mint nullopt byte-identity).
  - select_submit(pow, dgb_target, has_doge_job, doge_target): independent
    per-path thresholds against one scrypt pow_hash (mirrors dc_proof
    DualTargetIndependentThresholds); DOGE-aux only fires when minted.
  - selection_is_consistent(): load-bearing DC<->DB guard,
    fire_doge_aux ==> embed_commitment, coupling submit back to #475/#486.

test/aux_dual_target_select_test.cpp: 5/5 KATs, non-circular goldens
(fabe6d6d tag, embed truth table, independent threshold table, no-job
suppression, the impossible DOGE-win-without-mint state). Registered in
test/CMakeLists.txt + both build.yml --target allowlists (#143 trap).

Fenced dgb/, not rewired, consumes nothing in src/impl/doge, no node
seam touch, zero consensus surface.
@frstrtr
frstrtr force-pushed the dgb/doge-dc-dual-target-select branch from ef4e5ce to a54d168 Compare June 25, 2026 18:02
@frstrtr
frstrtr merged commit f63f20e into master Jun 25, 2026
33 checks passed
frstrtr pushed a commit that referenced this pull request Jul 14, 2026
…n hardening)

Clears the 8 real CodeQL security alerts on frstrtr/c2pool. Triaged +
independently re-reviewed: 1 CRITICAL is a genuine fix, 2 HIGH get
defense-in-depth, 5 HIGH are getenv-rooted false positives (dismissed
separately with justification).

- #490 CRITICAL cpp/potentially-dangerous-function (src/core/log.cpp:163):
  std::gmtime returns a pointer into a shared static tm and is not
  reentrant. Replace with gmtime_r (POSIX) / gmtime_s (MSVC) into a local
  tm. Only gmtime/localtime call in src/.

- #502/#503 HIGH cpp/path-injection (coin_peer_manager.hpp db_path()):
  m_symbol is a hardcoded ticker literal at every production ctor site
  (traced through all callers; no network->filename path exists), but
  add an alphanumeric-only guard so a future caller cannot inject a path
  component. Legitimate tickers (LTC/DOGE/DGB/DASH/BTC/NMC/...) are all
  alnum -> no on-disk filename change.

- Rider: core::filesystem::config_path() dereferenced getenv() without a
  null check -> std::filesystem::path(nullptr) is UB if HOME/APPDATA is
  unset. Fall back to '.'.

The other 5 path-injection alerts (#507 node.cpp:2199, #506/#505/#504
payout_manager.cpp:224/261/284, #501 auto_ratchet.hpp:309) all build a
path from config_path() (getenv HOME/APPDATA) + a hardcoded basename,
never from network/peer/miner input -> dismissed as false positive.
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