Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/impl/ltc/auto_ratchet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,11 @@ class AutoRatchet
// source of truth for the version-switch gate is now share_check step 2,
// which calls ShareTracker::get_desired_version_weights and matches
// p2pool check() (data.py:1396-1414) exactly. The VOTING tail guard above
// stays inline and count-based (finding #1).
// is ALSO work-weighted: it calls ShareTracker::get_desired_version_weights
// over the oldest 10% of the window and couples activation to that same
// check()-phase 60% accept gate (mint<->accept coupling). It is NOT
// count-based -- a flat-count tail guard would let a 95%-by-count activation
// outrun the 60%-by-work accept gate and wedge the crossing.

private:
std::string state_file_;
Expand Down
5 changes: 3 additions & 2 deletions src/impl/ltc/share_check.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1748,8 +1748,9 @@ bool share_check(const ShareT& share,
// The weight is target_to_average_attempts per share — get_desired_version_weights,
// matching canonical get_desired_version_counts (data.py:2651) — NOT a flat count.
// F10/(b): the prior non-canonical 95%-obsolescence punish is removed; the
// canonical 60% switch rule is now the ONLY version gate. AutoRatchet stays
// count-based and does not gate peer shares here.
// canonical 60% switch rule is now the ONLY version gate. AutoRatchet's
// VOTING tail guard is work-weighted (get_desired_version_weights) and does
// not gate peer shares here.
{
auto chain_length = static_cast<int32_t>(params.chain_length);
if (!share.m_prev_hash.IsNull() && tracker.chain.contains(share.m_prev_hash))
Expand Down
9 changes: 5 additions & 4 deletions src/impl/ltc/share_tracker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2152,10 +2152,11 @@ class ShareTracker
// Canonical p2pool get_desired_version_counts (data.py:2651) weights each
// share by target_to_average_attempts(share.target) — NOT a flat count.
// The check()-phase 60% switch rule (share_check step 2) is a consensus gate
// and MUST use these weights to stay byte-identical with p2pool. AutoRatchet
// and its tail guard deliberately keep the FLAT-COUNT variant above
// (count-based per F10 finding #1 — weighting them would shift activation
// timing across the soak). Weight = ShareIndex::work (share.hpp).
// and MUST use these weights to stay byte-identical with p2pool. The
// AutoRatchet VOTING tail guard ALSO uses these work-weights (auto_ratchet.hpp
// calls get_desired_version_weights), coupling activation to the check()-phase
// 60% accept gate so a minted boundary share can never be rejected. There is
// no flat-count tail-guard codepath. Weight = ShareIndex::work (share.hpp).
std::map<uint64_t, uint288> get_desired_version_weights(const uint256& share_hash, int32_t lookbehind)
{
std::map<uint64_t, uint288> weights;
Expand Down
Loading