Skip to content

bug: QRInfo masternode sync fails with missing rotated chain lock sig at tip after retries #470

Closed

Description

@lklimek

Summary

During SPV initial sync, the masternodes sync manager fails permanently with:

ERROR dash_spv::sync::masternodes::sync_manager: QRInfo failed after 4 retries: Required rotated chain lock sig at h - 0 not present for masternode diff block hash: 0000000ad913ed94a9a64e95a51c82d40c49807a207894e83ebe466f589399f4
ERROR dash_spv::sync::sync_manager: Masternode error handling message: Masternode sync failed: Required rotated chain lock sig at h - 0 not present for masternode diff block hash: 0000000ad913ed94a9a64e95a51c82d40c49807a207894e83ebe466f589399f4

The h - 0 variant means the chain lock signature for the current tip block is missing from the QRInfo response. The retry logic (3 retries × 5s delay = ~15s total) is exhausted without recovery.

Error Origin

dash/src/sml/masternode_list_engine/mod.rs ~line 660:

let sigmtip = maybe_sigmtip.ok_or(
    QuorumValidationError::RequiredRotatedChainLockSigNotPresent(
        0, mn_list_diff_tip_block_hash,
    ),
)?;

This fires when apply_diff() for the tip block's MnListDiff doesn't yield a chain lock signature, which happens when the QRInfo response references a tip block whose chain lock hasn't propagated yet.

Retry Logic

dash-spv/src/sync/masternodes/sync_manager.rs lines 268–303:

The retry logic specifically handles RequiredRotatedChainLockSigNotPresent(0, _) (tip only) with:

  • MAX_RETRY_ATTEMPTS = 3
  • CHAINLOCK_RETRY_DELAY_SECS = 5
  • Fixed delay between retries (not exponential backoff)
  • Re-requests QRInfo from peers on each retry via tick() (lines 509–518)

Potential Issues

  1. Fixed retry delay may be insufficient. Chain locks typically propagate within a few seconds, but under network congestion or with stale peers, 15 seconds total may not be enough. Exponential backoff (e.g., 5s, 10s, 20s) would be more resilient.

  2. Retries may hit the same stale peer. If the QRInfo re-request goes to the same peer that returned incomplete data, all retries will fail identically. Requesting from a different peer on retry would improve success rate.

  3. Tip may advance during retries. If a new block is mined during the 15-second retry window, the original tip's chain lock may never appear in QRInfo responses because peers have moved on to the new tip. The retry should potentially re-request with updated block locators rather than repeating the same request.

  4. Failure is permanent. Once MAX_RETRY_ATTEMPTS is exceeded, MasternodeSyncFailed is returned and the sync manager transitions to SyncState::Error with no automatic recovery. The user must manually restart the SPV client.

Observed Context

  • Network: Dash Testnet
  • Client: Dash Evo Tool using dash-spv via dash-sdk
  • Scenario: Initial SPV sync; headers/filters sync completed successfully, masternode sync fails during QRInfo processing
  • rust-dashcore revision: a05d256f59743c69df912462dd77dd487e1ff5b2

Suggested Improvements

  • Increase MAX_RETRY_ATTEMPTS or use exponential backoff
  • Rotate to a different peer on retry
  • Consider re-initiating QRInfo request with fresh block locators on retry (in case the tip advanced)
  • Optionally allow automatic recovery by restarting the masternode sync stage instead of failing the entire sync permanently

🤖 Co-authored by Claudius the Magnificent AI Agent

Activity

  1. Claudius-Maginificent commented on May 5, 2026

    @Claudius-Maginificent

    Reproduced on testnet against v0.42-platform-nightly

    We hit this on a cold-cache rs-platform-wallet e2e run while testnet's tip was 31 blocks past a DKG cycle boundary. Confirmed against four independent peers — not a single-bad-peer artifact.

    Versions / pin

    • rust-dashcore: rev fe2476611fcf72d6f36f1154a39a2f9af3b6a248 on v0.42-platform-nightly
    • dashpay/platform: PR #3586, branch feat/rs-platform-wallet-id-007-stub, post-merge of v3.1-dev at 32ee2cd6be
    • network: testnet, DKG interval 288

    Reproducer

    PLATFORM_WALLET_E2E_BANK_CORE_GATE=110000 RUST_LOG=info,dash_spv=trace cargo test --test e2e -- --ignored --test-threads=1 --nocapture id_007_identity_auth_addresses_not_monitored
    
    • Tip: 000000604acd01b5bbbaed7236a2e9d6620e1a933885fb993c24e7d9c1fe537d at height 1471135
    • Cycle boundary: 1471104 (31 blocks into a fresh rotation cycle)

    Verbatim error

    QRInfo failed after 4 retries: Required rotated chain lock sig at h - 0 not present for masternode diff block hash: 000000604acd01b5bbbaed7236a2e9d6620e1a933885fb993c24e7d9c1fe537d
    

    Peer-agreement (rules out single-bad-peer)

    4 connected peers from the default DNS seed testnet-seed.dashdot.io:19999:

    • 212.47.68.199:19999
    • 68.67.122.1:19999
    • 68.67.122.8:19999
    • 68.67.122.18:19999

    All reported identical tip height. All four QRInfo round-trips (across 4 retry rounds, ~22s end-to-end) returned identical responses missing the same H-slot CL sig. So the data is genuinely not yet on the network at the moment dash-spv asks; it isn't a peer divergence.

    "h - 0" is a slot index, not arithmetic

    This format string cost us several hours of misdirected diagnosis. "h - {0}" reads like a height offset but the u8 is the slot index of RotationChainLockSignatureSlot (dash/src/sml/masternode_list_engine/mod.rs:82-93): 0=H, 1=HMinusC, 2=HMinus2c, 3=HMinus3c, 4=Tip. So "h - 0" = "the H slot". The newer MissingRotationSignatures { missing: Vec<...> } variant at lines 110–114 is the right shape; the legacy u8 constructor at dash/src/sml/quorum_validation_error.rs:30-33 is the one firing here. Worth fixing the format string regardless of the underlying retry behavior — zero-risk freebie.

    Related upstream PRs

    Downstream workaround

    dashpay/platform PR #3586 adds an event-driven early-bail that surfaces this error in ~24s instead of the framework's 600s timeout, by subscribing to SyncEvent::ManagerError filtered by ManagerIdentifier::Masternode. It only reduces operator-feedback latency — does not fix the underlying issue.

    Suggested fixes

    1. Cherry-pick / port PR fix(dash): classify missing infrastructure errors as Skipped #721's Skipped classification onto v0.42-platform-nightly so fresh-cycle missing-CL-sig stops being terminal.
    2. Add the PR fix(spv): fall back to h-3c signatures when tip chainlock is missing in QRInfo validation #203-style fallback to slot HMinusC when slot H has no CL sig — accept "one cycle behind live tip" rather than "no mn-list at all".
    3. Fix the format string at dash/src/sml/quorum_validation_error.rs:30-33 to render the slot enum (or take the enum directly in the constructor). Independently useful regardless of which retry behavior lands.

    Full trace log (4646 lines) available on request; key lines are startup ChainLock at 1471098 (L26), peer mode (L51), first QRInfo (L428), retries (L2317 / L2569 / L3611), terminal error (L4623).

    🤖 Co-authored by Claudius the Magnificent AI Agent

  2. xdustinface commented on May 9, 2026

    @xdustinface
    Collaborator

    Should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions