dgb: wire runtime min-protocol 95%-ratchet into per-best-share loop (#602 follow-on) - #604
Merged
Merged
Conversation
…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).
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.
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 (underm_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.m_runtime_min_protocol_version;handle_versionreads it lock-free, compute thread publishes via store.apply_min_protocol_ratchet_decisionenforces 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
Fenced to
src/impl/dgb/. Consensus-bearing accept-floor -> operator merge-tap; no self-merge.