Skip to content

Solo: suppress NEW_ROUND recovery GET_BLOCK at timer fire when PUSH is in transit#705

Merged
NamecoinGithub merged 1 commit into
MINERfrom
copilot/research-push-cancellation-logic
May 25, 2026
Merged

Solo: suppress NEW_ROUND recovery GET_BLOCK at timer fire when PUSH is in transit#705
NamecoinGithub merged 1 commit into
MINERfrom
copilot/research-push-cancellation-logic

Conversation

Copilot AI commented May 25, 2026

Copy link
Copy Markdown

The "Cancelling pending NEW_ROUND recovery GET_BLOCK" log was firing but the deferred GET_BLOCK still went out, producing duplicate BLOCK_DATA that only the miner-side 10s same-unified-height feed guard was eating. Root cause: when a PUSH arrives within ~1ms of timer expiry, asio::steady_timer::cancel() returns 0 because the wait is already queued on the io_context — the cancel log fires from elsewhere, but the queued callback still runs and sends.

Change

  • Solo::schedule_recovery_get_block (src/protocol/src/protocol/solo.cpp): capture unified_height in the async_wait lambda and re-evaluate push_implies_block_data_in_transit(snap, unified_height, push_in_transit_guard_for_channel()) immediately before the GET_BLOCK send, after the existing has_valid_template short-circuit. If a PUSH ≥ unified_height landed within the channel-aware in-transit window (Prime 6000ms / Hash 3000ms), clear m_recovery_deferred_at, log [NEW_ROUND] Recovery GET_BLOCK suppressed at fire time: ..., and return.

Scope

  • Confined to the NEW_ROUND deferred-recovery path. PUSH-response, BLOCK_ACCEPTED/REJECTED, health-monitor, startup, and worker_manager recovery GET_BLOCK paths are untouched.
  • No constants tuning (handled in Tune NEW_ROUND recovery debounce and GET_ROUND polling cadence to reduce duplicate template churn #704).
  • Reuses the same in-transit predicate already applied at scheduling time (Phase C1) and at the other GET_ROUND / BLOCK_AVAILABLE call sites, so behavior is consistent across the three guard tiers (schedule-time, cancel-on-PUSH, fire-time).

…e time

Agent-Logs-Url: https://github.com/NamecoinGithub/NexusMiner/sessions/0201af9c-d4ec-4229-b8b8-2f4c23158ea5

Co-authored-by: NamecoinGithub <130555019+NamecoinGithub@users.noreply.github.com>
@NamecoinGithub NamecoinGithub marked this pull request as ready for review May 25, 2026 07:22
Copilot AI review requested due to automatic review settings May 25, 2026 07:22
@NamecoinGithub NamecoinGithub merged commit 1113b21 into MINER May 25, 2026
1 check failed
Copilot AI removed the request for review from Copilot May 25, 2026 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants