Skip to content

LNWL: Neutrino rescan ended with error: unable to register block subscription #8460

Open

Description

@yyforyongyu

A unit test failed, as seen in this build,

--- FAIL: TestLightningWallet (74.51s)
    --- FAIL: TestLightningWallet/btcwallet/neutrino:reorg_wallet_balance (14.20s)
        test_interface.go:2214: unable to sync wallet: timeout after 30s
FAIL
FAIL	github.com/lightningnetwork/lnd/lnwallet/test/neutrino	74.541s
FAIL

I noticed from the logs there's a new error popped up,

2024-02-05 07:46:41.973 [INF] NTFN: Missed blocks, attempting to catch up
2024-02-05 07:46:41.974 [INF] NTFN: Block disconnected from main chain: height=545, sha=2200a3cba8f7b66fe9d41c708625201328938b63fe6f5352a57bc11627e4f501
2024-02-05 07:46:41.975 [ERR] LNWL: Neutrino rescan ended with error: unable to register block subscription: unable to retrieve blocks since height=544: EOF
...

Which is generated here in neutrino: https://github.com/lightninglabs/neutrino/blob/43f5a588eb4a53cb36d118420e186629154086da/rescan.go#L727-L734

Due to the test setup, it's difficult to tell whether this is a flake, a bug in the test or a bug in the rescan logic, need more investigation.

Activity

  1. added
    neutrino
    on Feb 5, 2024
  2. hsjoberg commented on Feb 7, 2024

    @hsjoberg
    Contributor

    Due to the test setup, it's difficult to tell whether this is a flake,

    FWIW, we haven't seen this one in the wild. So probably flake.

  3. litbot-9000 commented on Nov 25, 2026

    @litbot-9000
    Collaborator

    New occurrence (automated flake agent): merge_group run https://github.com/lightningnetwork/lnd/actions/runs/45438174642, job https://github.com/lightningnetwork/lnd/actions/runs/45438174642/job/138601839326 (2026-11-24 16:31 UTC).

    lnwallet/test/neutrino TestLightningWallet/btcwallet/neutrino:reorg_wallet_balance failed with wallet state sync timeout at lnwallet/test/test_interface.go:2268. Same assertion/signature as this issue; the line number on current master is 2268.

  4. litbot-9000 commented on Nov 25, 2026

    @litbot-9000
    Collaborator

    New occurrence (automated flake agent): merge_group run https://github.com/lightningnetwork/lnd/actions/runs/45557331723, job https://github.com/lightningnetwork/lnd/actions/runs/45557331723/job/139012499884 (2026-11-25 05:59 UTC).

    lnwallet/test/neutrino TestLightningWallet/btcwallet/neutrino:reorg_wallet_balance failed with wallet state sync timeout at lnwallet/test/test_interface.go:2268. Same assertion/signature as this issue.

  5. litbot-9000 commented on Nov 25, 2026

    @litbot-9000
    Collaborator

    New occurrence (automated flake agent): merge_group run https://github.com/lightningnetwork/lnd/actions/runs/45629661915, job https://github.com/lightningnetwork/lnd/actions/runs/45629661915/job/139261558435 (queued for PR #11094, 2026-11-25 14:02 UTC).

    lnwallet/test/neutrino TestLightningWallet/btcwallet/neutrino:reorg_wallet_balance failed with wallet state sync timeout at height=870 hash=600b09d99887655f6f18f1becb80c41e0b87c60d3464310ca564ebd8dcd18bd5 at lnwallet/test/test_interface.go:2268. Same assertion/signature as this issue.

  6. litbot-9000 commented on Nov 25, 2026

    @litbot-9000
    Collaborator

    Fix attempt (no reproduction). Branch flake/neutrino-reorg-wallet-balance from upstream/master 0cc5feb086eb4b03de0fc543279e8a824555eaf5.

    Preflight:
    GOMAXPROCS=2 go test -race -tags="dev test_db_postgres autopilotrpc chainrpc invoicesrpc neutrinorpc peersrpc signrpc switchrpc walletrpc watchtowerrpc nolog" -run 'TestLightningWallet/btcwallet/neutrino:reorg_wallet_balance' -count=1 -p 1 -parallel 2 ./lnwallet/test/neutrino
    Result: pass, 97.128s.

    Prescribed run:
    GOMAXPROCS=2 go test -race -test.timeout=30m -tags="dev test_db_postgres autopilotrpc chainrpc invoicesrpc neutrinorpc peersrpc signrpc switchrpc walletrpc watchtowerrpc nolog" -run 'TestLightningWallet/btcwallet/neutrino:reorg_wallet_balance' -count=200 -p 1 -parallel 2 ./lnwallet/test/neutrino
    Result: 20 completed subtest runs / 20 passes / 0 subtest failures, then the package hit the global 30m test timeout (panic: test timed out after 30m0s). At ~26s per run, 200 iterations cannot fit in the 30m window; no wallet state sync timeout reproduced locally.

  7. litbot-9000 commented on Nov 26, 2026

    @litbot-9000
    Collaborator

    Flake cop note: the three recent merge_queue occurrences of this failure mode (runs 45438174642, 45557331723, 45629661915 — all TestLightningWallet/btcwallet/neutrino:reorg_wallet_balance timing out in waitForWalletSync after the miner reorg) are addressed by open PR #11638 (lnwallet/test: neutrino filter queries under load — the test's neutrino.QueryTimeout of 500ms with a single retry against one on-demand filter peer stalls the synced stamp; raised to 3s with 3 retries).

    No new occurrences since 2026-11-25. My local -count=200 reproduction attempt on 2026-11-25 did not fail within the prescribed 30-minute window (20 completed runs, 20 passes, then the global timeout), so I could not independently verify the fix — leaving verification to CI on that PR.

  8. litbot-9000 commented on Nov 30, 2026

    @litbot-9000
    Collaborator

    New occurrence of lnwallet/test/neutrino TestLightningWallet/btcwallet/neutrino:reorg_wallet_balance (posted by the automated lnd flake agent).

  9. litbot-9000 commented on Nov 30, 2026

    @litbot-9000
    Collaborator

    New occurrence of lnwallet/test/neutrino TestLightningWallet/btcwallet/neutrino:reorg_wallet_balance (posted by the automated lnd flake agent).

    This merge-queue run was testing #11638 itself, which raised the test's neutrino.QueryTimeout to 3s and QueryNumRetries to 3. The stall still happened with that change in place. #11638 has since merged (f3a71c1), so this flake should be treated as still open on master; the query-timeout explanation alone does not account for it.

  10. litbot-9000 commented on Nov 30, 2026

    @litbot-9000
    Collaborator

    Repro attempt 2 by the automated lnd flake agent, on upstream master f3a71c1 (which includes #11638's 3s/3-retry neutrino query settings). Not reproduced.

    env GOMAXPROCS=2 timeout --kill-after=30s 35m go test -race -test.timeout=30m -tags="test_db_postgres" \
      -run 'TestLightningWallet/btcwallet/neutrino:reorg_wallet_balance' \
      -count=200 -p 1 -parallel 2 -json ./lnwallet/test/neutrino/
    

    Result from the -json subtest events: 19 runs started, 18 passed, 0 failed. The 19th run was still in progress when the package hit the 30m -test.timeout (panic: test timed out after 30m0s). That is the time cap, not this flake: there was no wallet state sync timeout. Each pass took about 36s, so the prescribed 200 runs cannot fit in 30m. Across both attempts, 38 local passes and 0 failures. The flake has appeared on CI 5 times, most recently with #11638 applied (run 46095501217), so it is still open, but it does not show up on this pod. No fix PR without a reproduction.

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

    neutrinopossible-bugtest flake

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions