Skip to content

dgb: wire runtime min-protocol 95%-ratchet into per-best-share loop (#602 follow-on) - #604

Merged
frstrtr merged 1 commit into
masterfrom
dgb/min-proto-ratchet-runtime-wire
Jul 1, 2026
Merged

dgb: wire runtime min-protocol 95%-ratchet into per-best-share loop (#602 follow-on)#604
frstrtr merged 1 commit into
masterfrom
dgb/min-proto-ratchet-runtime-wire

Conversation

@frstrtr

@frstrtr frstrtr commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Runtime wiring of the pure accept-floor ratchet #602 landed. SUT equivalent of oracle p2pool-dgb-scrypt main.py:213-216 + data.py:857 update_min_protocol_version.

What

  • NodeImpl::apply_min_protocol_ratchet() called at the 3 best-share update sites (under m_tracker_mutex); samples the work-weighted desired-version tally over the SAME window the 60% version-switch gate reads ([CHAIN_LENGTH*9/10, CHAIN_LENGTH] behind the best-share PARENT) and lifts the P2P accept-floor 1400 -> 3500 once the best-share VERSION holds >=95% of that work.
  • Floor moved from the immutable config value to a latching atomic m_runtime_min_protocol_version; handle_version reads it lock-free, compute thread publishes via store.
  • New call-site guard apply_min_protocol_ratchet_decision enforces oracle main.py:212 (len(shares) > CHAIN_LENGTH): a fresh node with a partial/empty window never spuriously locks the floor to 3500 and rejects every peer.

Verify

  • KAT dgb_min_protocol_ratchet_test: 14/14 green (+5 wiring-guard cases).
  • c2pool-dgb links clean, incl -DAUX_DOGE=ON.

Fenced to src/impl/dgb/. Consensus-bearing accept-floor -> operator merge-tap; no self-merge.

…op (#602 follow-on)

Wires the pure ratchet dgb::ratchet_min_protocol_version (#602) into the node
runtime, the SUT equivalent of oracle p2pool-dgb-scrypt main.py:213-216 +
data.py:857 update_min_protocol_version. On each best-share advance (the three
m_best_share_hash update sites under m_tracker_mutex) NodeImpl::apply_min_protocol_ratchet
samples the work-weighted desired-version tally over the SAME window the 60%
version-switch gate reads (share_check step 2: [CHAIN_LENGTH*9/10, CHAIN_LENGTH]
behind the best share PARENT) and lifts the inbound P2P accept-floor 1400 -> 3500
once the best share VERSION holds >=95% of that work.

The floor moves from the immutable config value to a latching atomic
m_runtime_min_protocol_version (seeded from PoolConfig::MINIMUM_PROTOCOL_VERSION);
handle_version reads it lock-free, the compute thread publishes via store. Adds
the call-site guard the pure ratchet omits: apply_min_protocol_ratchet_decision
enforces oracle main.py:212 (len(shares) > CHAIN_LENGTH) so a fresh node with a
partial/empty window never spuriously locks the floor to 3500 and rejects every
peer -- the pure fn ratchets on an empty window (dict-branch), the wired decision
must not.

KAT dgb_min_protocol_ratchet_test +5 wiring cases (14 total, all green): short-chain
never-lifts (vs pure-fn ratchets on same weights), short-chain empty-window no-lift,
full-window unanimous lifts, full-window below-95 stays cold, already-at-target
short-circuits. Fenced to src/impl/dgb/; c2pool-dgb links clean (incl -DAUX_DOGE=ON).
@frstrtr
frstrtr merged commit c75b3b2 into master Jul 1, 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