Skip to content

Commit 115e4f0

Browse files
committed
ltc: rename DensePPLNSRing -> DensePPLNSWindow (SAFE-COSMETIC)
The class is a std::deque sliding window, not a ring buffer; the name was a misnomer. Pure symbol+comment rename, zero behavior change. The actual ring buffer is the V37 work on v37-dev.
1 parent f532429 commit 115e4f0

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/impl/ltc/node.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
#include <iomanip>
1313
#include <random>
1414

15-
// Static members for DensePPLNSRing precomputed decay table
16-
std::vector<uint64_t> ltc::DensePPLNSRing::s_decay_table;
17-
uint64_t ltc::DensePPLNSRing::s_decay_per = 0;
18-
bool ltc::DensePPLNSRing::s_table_initialized = false;
15+
// Static members for DensePPLNSWindow precomputed decay table
16+
std::vector<uint64_t> ltc::DensePPLNSWindow::s_decay_table;
17+
uint64_t ltc::DensePPLNSWindow::s_decay_per = 0;
18+
bool ltc::DensePPLNSWindow::s_table_initialized = false;
1919

2020
// Helper: read current RSS from /proc/self/status (Linux only)
2121
static long get_rss_mb() {

src/impl/ltc/share_tracker.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ struct PPLNSEntry {
145145
std::vector<unsigned char> script; // payout script (variable-length)
146146
};
147147

148-
class DensePPLNSRing {
148+
class DensePPLNSWindow {
149149
public:
150150
static constexpr uint64_t DECAY_PRECISION = 40;
151151
static constexpr uint64_t DECAY_SCALE = uint64_t(1) << DECAY_PRECISION;
@@ -244,15 +244,15 @@ class DensePPLNSRing {
244244
};
245245

246246
// ── Head-Level Incremental PPLNS ─────────────────────────────────────────
247-
// Maintains a DensePPLNSRing + cached CumulativeWeights per active head.
247+
// Maintains a DensePPLNSWindow + cached CumulativeWeights per active head.
248248
// When verifying consecutive shares along a chain:
249249
// 1. rebuild() at first share's parent: O(chain_len) — one hash map walk
250250
// 2. extend() for each subsequent share: O(1) ring push + O(chain_len) dense recompute
251251
// Total for N shares: O(chain_len + N × chain_len) sequential ops
252252
// vs current: O(N × chain_len) random hash map ops — ~10x faster per op.
253253

254254
class HeadPPLNS {
255-
DensePPLNSRing m_ring;
255+
DensePPLNSWindow m_ring;
256256
CumulativeWeights m_cached;
257257
bool m_dirty{true};
258258

@@ -306,7 +306,7 @@ class HeadPPLNS {
306306

307307
bool valid() const { return !m_ring.empty(); }
308308
int32_t window_size() const { return m_ring.size(); }
309-
const DensePPLNSRing& ring() const { return m_ring; }
309+
const DensePPLNSWindow& ring() const { return m_ring; }
310310
};
311311

312312
// --- ShareTracker ---

0 commit comments

Comments
 (0)