diff options
| author | bitflash-maintainer <noreply@bitflash.invalid> | 2026-09-02 05:46:57 +0000 |
|---|---|---|
| committer | bitflash-maintainer <noreply@bitflash.invalid> | 2026-09-02 05:46:57 +0000 |
| commit | 2bca62a6a9984297633af42d9e19d1f328d2f7f2 (patch) | |
| tree | 4c0907cb08dca81d17e0eacac171ba120cb3b6ef /src/main.cpp | |
| parent | a3666bded1553b101b631d87e99961bf3ccd0a3e (diff) | |
pool: decay a miner's hashrate estimate when its shares stop arriving
m->hashRate is an EWMA re-sampled only on the valid-share path, with no
time-based term: a miner that stops hashing keeps its last estimate for
as long as the connection stays open, and RefreshStats sums every such
stale estimate into gStats.totalHashRate, which is what the pool status
and the nostr announcement publish. The announced pool hashrate ran
several times over ground truth because miners that had gone quiet were
still contributing their last sample.
Decay on time in the event loop's miner sweep. Per miner, compute the
expected share interval -- ExpectedHashesForDifficulty(m->difficulty)
divided by its current rate estimate -- and give it a grace of four such
intervals with no share (at the vardiff target of one share per 15s
that is about a minute of silence). Past the grace, decay the estimate
with a half-life of one more expected interval, computed from absolute
time so the curve does not depend on the loop's tick rate. The interval
is clamped to [1s, 1h] so a fast miner at the vardiff floor, whose
expected interval is milliseconds, is not decayed for ordinary
share-delivery jitter, and a very slow miner's grace cannot stretch
past the point where its estimate means anything. Per-share crediting
and ExpectedHashesForDifficulty are untouched: this changes only what
is reported about a miner that has stopped reporting itself.
Closes #7
Diffstat (limited to 'src/main.cpp')
0 files changed, 0 insertions, 0 deletions