Repository navigation
Conversation
rkuester
left a comment
There was a problem hiding this comment.
Good catch. The fix is right, but the test uses the wrong kind of error.
The extranonce2 size is fixed per connection by mining.subscribe. Under #113, a bad size should fail the session at subscribe, so it will never reach the job-gap watchdog. The case this PR really fixes is a bad job on an otherwise good connection. One such job already exists. A job whose version has any of bits 13--28 set fails conversion.
Please:
- Test with a bad version, such as
20002000, the wayfresh_job_defers_recyclingtests a good one: one job at three quarters of the gap, then expectClearJobsafter the original deadline. That needs no second connection and no change to the handshake helpers. - Reword the description and commit messages to match.
- Rebase onto main.
…cling Add a test that sends one job three quarters of the way through the job gap, with a version that sets general-purpose bits, so the job fails conversion and never reaches the scheduler. Past the original deadline, the test expects the source to have recycled the connection, as it would with no job at all. The job-gap watchdog restarts on every mining.notify, including one that fails conversion, so the connection survives. Mark the test should_panic until the fix lands. Part of 256foundation#113. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Restart the job gap only when a job converts and reaches the scheduler. A job that fails conversion, such as one whose version sets general-purpose bits, gives the scheduler nothing to work on, so it should not keep the connection alive. A pool that sends only such jobs now has its connection recycled after MAX_JOB_GAP, as a silent pool does. Part of 256foundation#113. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
336ac98 to
a284138
Compare
|
Thanks, that makes sense. The test now sends one job with version |
Part of #113.
The job-gap watchdog resets on every
mining.notify, even when the job fails conversion and never reaches the scheduler. So a pool that only sends unusable jobs keeps the connection open forever with no work.This resets the gap only when a job converts, so that connection gets recycled after
MAX_JOB_GAP, the same as a silent pool. It doesn't do the latching part of #113.The first commit adds a regression test (marked
should_panic), the second fixes it. The test works likefresh_job_defers_recycling: one job three quarters of the way to the deadline, but with version20002000, which sets general-purpose bits and fails conversion. It then expectsClearJobsafter the original deadline.Tested with
just checkson each commit, and by running the daemon against a small test pool that only sends unusable jobs: without the fix it never reconnects, with it, it reconnects every 2 min.