apps: pass max_past_jobs to channel constructors - #735
Draft
gimballock wants to merge 2 commits into
Draft
Conversation
gimballock
marked this pull request as draft
August 19, 2026 02:32
plebhash
reviewed
Aug 20, 2026
plebhash
reviewed
Aug 20, 2026
Member
|
I'm confused with the approaches taken by Pool vs tProxy/JDC why does only Pool get the optional config parameter? |
gimballock
force-pushed
the
feat/configurable-max-past-jobs
branch
from
August 21, 2026 12:13
a8ffeba to
7a6cac5
Compare
Contributor
Author
oversight, I was running the test off of the pool and focusing on that. fixed now |
gimballock
force-pushed
the
feat/configurable-max-past-jobs
branch
from
August 21, 2026 12:40
7a6cac5 to
00b679c
Compare
DO NOT MERGE. Temporary commit so CI can build against the companion stratum branch before it lands on stratum-mining/stratum. Repoints the stratum-core git dependency from stratum-mining/stratum#main to marafoundation/stratum#feat/configurable-max-past-jobs (which carries the max_past_jobs constructor parameter these changes depend on) in stratum-apps and bitcoin-core-sv2, and regenerates the committed lockfiles so the --locked CI builds resolve the fork. Revert this commit once stratum-mining/stratum#2307 is merged and the stratum-core pin is bumped to the merged rev. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Companion to stratum-mining/stratum#2307, which adds `max_past_jobs: Option<usize>` to the server and client `ExtendedChannel`/`StandardChannel` constructors. `None` and `Some(0)` both select the crate default `MAX_PAST_JOBS`. Threads the parameter through all channel constructors in the three roles and makes it settable from each role's config. Every shipped config example documents the setting commented out, so the library default stays in force unless an operator opts in, and each role has a test asserting exactly that. The cap is a retention window -- `cap / template rate` -- and the template rate is a deployment property the library cannot see: the same constant buys 50s of late-share tolerance at a 1s cadence and over 16 minutes at 20s. Sizing it also depends on what sits downstream, which differs per role -- a pool faces proxies or miners, a translator faces real SV1 firmware, a JDC faces a miner or another proxy -- so one value chosen for one role is not automatically right for another. Each role logs the cap actually in force at startup. When unset it comes from `channels_sv2`, so it otherwise appears nowhere in the application's own config and is not recoverable from a running process. Group channels are untouched: they replace the active job rather than retiring it into past jobs, so the cap is inert there and they take no parameter.
gimballock
force-pushed
the
feat/configurable-max-past-jobs
branch
from
August 21, 2026 12:45
00b679c to
52ad9a0
Compare
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.
Companion to stratum-mining/stratum#2307, which adds
max_past_jobs: Option<usize>to the server and clientExtendedChannel/StandardChannelconstructors.NoneandSome(0)both select the crate defaultMAX_PAST_JOBS, so nothing changes for callers that pass neither.Four commits:
apps: pass max_past_jobs to channel constructors— pure plumbing. Every one of the 10 call sites passesNone, so behaviour is unchanged. 2 in pool, 3 in jd-client, 5 in translator (one a test helper). Group channels are untouched — they take no such parameter.TMP: point stratum-core at ...— temporarily repoints thestratum-coredependency at the companion branch so CI can build, following Pool+JDC: handle newSeenSharesBudgetExhaustederror variant fromchannels_sv2share validation #733. Must be reverted once #2307 merges and the pin is bumped to the merged rev.pool: make the past-jobs cap settable from config— addsmax_past_jobsto the pool config, so two otherwise-identical deployments can differ by exactly one value.apps: expose max_past_jobs on tProxy and JDC too— the same setting in the other two roles, for symmetry (see the discussion below).Each role keeps its own local config idiom: pool and jd-client via a private field plus getter, translator via a public field. Every shipped config example documents the setting commented out, so the library default stays in force unless an operator opts in, and each role has a test asserting exactly that.
Each role also logs the cap actually in force at startup. When unset it comes from
channels_sv2, so it otherwise appears nowhere in the application's own config and is not recoverable from a running process.Why expose it at all
The cap is a retention window —
cap / template rate— and the template rate is a deployment property the library cannot see. The same constant buys 50 s of late-share tolerance at a 1 s template cadence and over 16 minutes at 20 s.Sizing it also depends on what sits downstream, which differs per role: a pool faces proxies or miners, a translator faces real SV1 firmware, a JDC faces a miner or another proxy. Each sees a different submission-latency distribution, so one value chosen for one role is not automatically right for another.