dgb/doge DC: single-fire broadcast-path proof (election + idempotent ledger) - #502
Merged
Conversation
…ledger)
Fenced phase-DC proof artifact satisfying the integrator HARD precondition
for any DC live-wire: the submitauxblock RPC fallback cannot double-fire the
same DOGE block hash alongside the embedded submit path.
coin/aux_broadcast_path_election.hpp (pure, links only core/uint256 + <set>):
- elect_aux_broadcast_path(): total fn, returns exactly ONE carrier per won
block. Embedded submit_block PRIMARY; RPC submitauxblock FALLBACK only when
no embedded relay. Mirrors aux_chain_embedded.hpp documented method roles.
Structurally cannot return "both".
- AuxBroadcastLedger::try_fire(): idempotent guard keyed on DOGE block hash;
true exactly once per distinct hash, every later attempt suppressed
regardless of path -> single broadcast across retries / both-paths race.
- elect_and_claim(): election + ledger composed; single-fire end to end.
dgb_aux_broadcast_path_election_test (10/10): exhaustive 2x2x2 election truth
table (never both, embedded-primary), ledger first-fresh/second-suppressed +
distinct-hash independence, and the integrator scenario both-paths-same-hash
fires once (order-independent) + no-win does not burn the hash.
Consumes nothing in src/impl/doge; touches no node seam (live DC wiring stays
parked). Registered in test/CMakeLists.txt AND both build.yml --target
allowlist lines (#143 NOT_BUILT guard).
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.
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.
Fenced phase-DC proof artifact for the integrator HARD precondition (UID2478): the submitauxblock RPC fallback cannot double-fire the same DOGE block hash alongside the embedded submit path.
coin/aux_broadcast_path_election.hpp (pure; links only core/uint256 + ; consumes nothing in src/impl/doge; no node seam touched):
dgb_aux_broadcast_path_election_test — 10/10 green: exhaustive 2x2x2 election truth table (never both / embedded-primary), ledger fresh-then-suppressed + distinct-hash independence, and the integrator both-paths-same-hash scenario fires once (order-independent) + no-win does not burn the hash.
Registered in test/CMakeLists.txt AND both build.yml --target allowlist lines (#143 NOT_BUILT guard). FENCED, no consensus surface. NO self-merge.