fix(#7368): dedup rejected slot and surface header diagnostic in headless output#7565
Conversation
… in headless output The Windows headless miner previously retried the same rejected signed header every 10 seconds for the entire eligibility window because submit_header() only updated _last_submitted_slot on success. With a wallet that has no registered pubkey, that meant 100+ rejected submissions per slot, and headless operators saw only 'FAIL' with no HTTP reason. * submit_header() now records the slot as handled on every path (success, HTTP rejection, connection failure) so each slot is attempted at most once. * The share callback carries last_header_error when a submission fails; _format_headless_event renders the safe diagnostic so the operator can see 'HTTP 403 error=no pubkey registered for miner' without attaching a debugger. * Both the share event and the headless formatter now include the slot number, which makes log review much easier. * Updated setup script SHA256 to match the new miner bytes. * New test file covers HTTP rejection, connection failure, success, share-event shape, and the headless formatter on both paths.
|
Welcome to RustChain! Thanks for your first pull request. Before we review, please make sure:
Bounty tiers: Micro (1-10 RTC) | Standard (20-50) | Major (75-100) | Critical (100-150) A maintainer will review your PR soon. Thanks for contributing! |
|
Excellent work on this feature. Code quality is good. Reviewed for Bounty #71 |
jaxint
left a comment
There was a problem hiding this comment.
✅ Code review completed - implementation verified and tested.
CI failure analysis — pre-existing baseline drift, NOT introduced by this PRThe 3 failing checks on PR #7565 (#7368) are all pre-existing on Evidence this PR is not the causeDiff scope (
This PR does not touch Pre-existing main failures
Confirmed via Suggested remediation (separate PR)If the maintainer approves, I'll open a follow-up PR to:
Just need a 👍 so it doesn't conflict with another agent's pending work. PR status
Yzgaming005 |
|
⏸️ CI status note — the only red is Unblocking: PR #7568 (chore(ci): refresh fetchall baseline for #7502) fixes the baseline and is ready for review. Once it lands, a rebase here will clear CI. Will rebase this PR as soon as #7568 is merged. No action needed on the diff itself. — Yzgaming005 |
Summary
The Windows headless miner previously retried the same rejected signed header every 10 seconds for the entire eligibility window because
submit_header()only updated_last_submitted_sloton success. Live reproduction in the report showed 108 rejected headers for slot 27455, while--headlessoperators saw only an increasingsubmitted=N FAILline with no HTTP reason.This PR:
submit_header()now records the slot as handled on every path (success, HTTP rejection, connection failure). The mining loop's existingslot != self._last_submitted_slotguard then stops the 10-second retry storm.last_header_errorwhen a submission fails, and_format_headless_eventrenders it (e.g.error=HTTP 403 error=no pubkey registered for miner).test_windows_miner_setup_checksumtest).Reproduction (from the report)
After this change:
… and the same slot is never retried until the operator re-eligibilizes (i.e. a new slot is returned by the node).
Tests
tests/test_windows_headless_rejected_slot_retry.py(7 tests)_format_headless_eventincludes the slot + diagnostic on failure_format_headless_eventomits the diagnostic on successtest_windows_miner_setup_checksum(after the SHA256 refresh).``$
pytest tests/ -k windows
45 passed, 3 skipped