Fix Windows packaging follow-ups and harden GET_BLOCK dedup guard#699
Closed
Copilot wants to merge 4 commits into
Closed
Fix Windows packaging follow-ups and harden GET_BLOCK dedup guard#699Copilot wants to merge 4 commits into
Copilot wants to merge 4 commits into
Conversation
Agent-Logs-Url: https://github.com/NamecoinGithub/NexusMiner/sessions/bb5f7dae-62e3-42fe-bb7c-d0e96a5e0f6f Co-authored-by: NamecoinGithub <130555019+NamecoinGithub@users.noreply.github.com>
…o 256 Agent-Logs-Url: https://github.com/NamecoinGithub/NexusMiner/sessions/bb5f7dae-62e3-42fe-bb7c-d0e96a5e0f6f Co-authored-by: NamecoinGithub <130555019+NamecoinGithub@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix Windows release packaging follow-ups from PR #697
Fix Windows packaging follow-ups and harden GET_BLOCK in-flight guard
May 17, 2026
Owner
|
@copilot resolve the merge conflicts in this pull request |
Co-authored-by: NamecoinGithub <130555019+NamecoinGithub@users.noreply.github.com>
Author
Resolved in 4823f27. The MINER branch had reverted PR #698 (replacing the 2-second cooldown design with a 100ms rapid-burst guard), causing conflicts in 4 files. Key resolutions:
All 44 tests pass. |
Copilot
AI
changed the title
Fix Windows packaging follow-ups and harden GET_BLOCK in-flight guard
Fix Windows packaging follow-ups and harden GET_BLOCK dedup guard
May 17, 2026
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.
Follow-up fixes for merged PRs #697 (Windows release pipeline) and the reverted/redesigned PR #698 (GET_BLOCK burst-guard). Addresses GMPDIR hint breakage, inconsistent ZIP layout, config glob gaps, and dedup policy correctness for the 100ms rapid-burst guard design.
Windows packaging (
release-windows.yml,package-windows-prime-cpu-cross.sh)FindGMP.cmakereads$ENV{GMPDIR}, not a CMake cache var. Moved from-DGMPDIR=...to a step-levelenv:block so the hint actually reachesfind_path/find_library.Compress-Archive -Path "$stage\*"produced a flat archive. Changed toCompress-Archive -Path $stageso MSVC ZIPs have the same top-levelNexusMiner-windows/folder as MinGW cross-builds.package-windows-prime-cpu-cross.shpreviously copied only*.config. Updated to iterate both*.configand*.conf, silently skipping whichever glob is empty.GMPDIRenvironment variable" instead of the ambiguous "provide GMPDIR".GET_BLOCK dedup policy (
solo.cpp,get_block_reason.hpp)Updated dedup bypass policy to match the 100ms rapid-burst guard design on MINER:
HEALTH_NO_TEMPLATEadded toshould_bypass_all_dedup(): When there is genuinely no valid template, the rapid-burst guard is counterproductive — the health timer must always make progress.HEALTH_NO_TEMPLATEnow bypasses all dedup guards alongsideRECOVERY_FORCED,RECOVERY_TIMER, andBLOCK_ACCEPTED.!should_bypass_all_dedup(reason) &&kept insolo.cppso bypass_all reasons (RECOVERY_FORCED, RECOVERY_TIMER, BLOCK_ACCEPTED, HEALTH_NO_TEMPLATE) are exempt from the in-flight guard, allowing degraded-mode retries to always make progress.New helper and tests
should_bypass_height_state_after_cooldown()as an explicitly-named alias forshould_bypass_all_dedup()to clarify scope. Includes aTODOfor future divergence whenget_block_interval_msis wired to runtime guards.get_block_interval_msdocumented as parsed-but-not-wired to runtime burst guard constants.debug→info.GetBlockReasonvalues.Original prompt
Context
PR #697 (
Add Windows release pipeline and MinGW cross-compilation path with PRIME backend/toolchain fixes) and PR #698 (Throttle miner GET_BLOCK recovery storms) have both merged intoMINER.PR #698 correctly introduced a universal 2-second miner-side GET_BLOCK cooldown, made
HEALTH_NO_TEMPLATEstop bypassing all dedup, preserved cooldown across template-state resets, deferred malformed/empty template recovery through Worker_manager, and added PUSH→NEW_ROUND suppression when recent PUSH implies BLOCK_DATA is in transit.The remaining follow-up work should harden correctness and operator ergonomics without undoing the storm fix. Favor correctness over convenience. Avoid broad rewrites; make targeted, testable improvements.
Relevant production screenshots/logs that motivated this work:
Goals
1. Fix Windows release packaging follow-ups from merged PR #697
Address the review comments left on PR #697:
.github/workflows/release-windows.ymlpasses-DGMPDIR=..., butcmake/modules/FindGMP.cmakeconsumesGMPDIRas an environment variable ($ENV{GMPDIR}), not as a CMake cache variable. Fix the workflow so the fallback hint actually works.GMPDIRin the Configure step environment or PowerShell beforecmakeruns.-DGMP_INCLUDES=... -DGMP_LIBRARIES=...if that is more consistent with the existing FindGMP module.CMakeLists.txtwarning that currently says “provide GMPDIR” so it explicitly says to set theGMPDIRenvironment variable or pass the actual include/library cache variables.Align Windows ZIP layout between MSVC and MinGW cross-packaging.
NexusMiner-windows/folder.$stage\*, producing a flat ZIP.NexusMiner-windows/directory.Packaging config completeness.
*.confand*.configduring migration.configs/*.config.scripts/package-windows-prime-cpu-cross.shto include both*.configand*.confwhen present, without failing if one glob has no matches.2. Harden PR #698 GET_BLOCK cooldown / in-flight correctness
PR #698 intentionally fixed storms, but it still has a follow-up risk: forced reasons can bypass pending in-flight state after the 2-second cooldown even if the pending request has not timed out yet.
Current behavior to inspect:
GetBlockDedupGuardenforces 2s cooldown.should_bypass_all_dedup()currently returns true forRECOVERY_FORCED,RECOVERY_TIMER, andBLOCK_ACCEPTED.Solo::get_work()skips the pending in-flight guard for reasons whereshould_bypass_all_dedup(reason)is true.RECOVERY_TIMER/RECOVERY_FORCEDcan potentially send a second GET_BLOCK between cooldown expiry and pending timeout.Implement a more precise policy:
HEALTH_NO_TEMPLATEmust continue to respect cooldown and pending in-flight suppression.RECOVERY_TIMERshould normally respect pending in-flight suppression until the pending request times out.RECOVERY_FORCEDshould not blindly bypass pending in-flight if the existing pending request is still healthy and for the same-or-higher height.BLOCK_ACCEPTEDis special: the previous template is spent, but it still should not hammer AutoCoolDown. Keep the 2s cooldown, and only bypass stale height state after cooldown. If a pending GET_BLOCK already exists for the replacement height, suppress duplicate unless it has timed out.A good implementation approach is to introduce a clearer policy helper instead of overloading
should_bypass_all_dedup()for both height-state and in-flight behavior. For example:should_bypass_height_dedup(reason)for height guard bypass.should_bypass_all_dedup()with more explicit helpers such as:should_bypass_height_state_after_cooldown(reason)should_bypass_pending_inflight(reason)only when the existing pending request has timed out or is known stale.Do not break existing semantics accidentally. Add tests for:
RECOVERY_TIMERafter cooldown but before pending timeout is suppressed by pending in-flight.RECOVERY_TIMERafter pending timeout is allowed.RECOVERY_FORCEDdoes not duplicate a healthy pending request for the same-or-higher height.HEALTH_NO_TEMPLATErespects pending in-flight and cooldown.BLOCK_ACCEPTEDrespects cooldown and does not duplicate a healthy pending replacement request.3. Wire or clarify
get_block_interval_msPR #698 changed config defaults and parser minimum for
get_block_interval_ms, but runtime cooldowns are hard-coded in:This pull request was created from Copilot chat.