Fix notify flood memory growth #611
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
parasitepool/para!611
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "jobs-dos"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes this:
M4. Proxy: notify flood memory growth —
src/jobs.rs:35-48ckpool: ages out workbases older than 600 s, keeps at least 3, skips
in-use (
stratifier.c:1081-1093). No rate limit.Design:
Jobs.validat a constant (64 jobs). On insert, evict the oldestby
JobIdorder when the cap is exceeded. Evicted job -> share getsStratumError::Stale(already the unknown-job path atstratifier.rs:766; does not touch the bouncer).floor reintroduces unboundedness under flood; count is the correct
simple bound and serves as backpressure.
templates pile up per
--update-intervalwithin a block gap); the capfixes both.
JobIds (upstream IDs stored asupstream_job_idinJob) make eviction order = insertion order;latest(max ID) isnever evicted, so
assert_invariantsholds by construction.multiple_jobs_accumulation(5 jobsretained) and
assert_invariants(latestinvalid). Cap >= 5keeps all existing tests green; 64 is generous (~10.7 min of history
at default 10 s update interval, near ckpool's 600 s window).
seenunbounded perseen_never_evicts_within_job_group—growth is PoW-gated at 32 bytes per accepted share.
BTreeMap+pop_firsteviction (precedent:orphan_receipts: BTreeMap,router.rs:53); unit testcheck_evicts_oldest_beyond_capcovers both workbase types.