Skip to content

test: feature_bip68_sequence.py can time out a block download by advancing mocktime with a block in flight #430

Closed

Description

@kiwidream

Summary

feature_bip68_sequence.py failed once because node1 disconnected node0 with "Timeout downloading block". The test advances mocktime by 600 s on every node without waiting for the previous block to arrive, and qbit's block download timeout is one minute.

Observed

  • Job 127046266399, "Windows native, VS 2022", PR run 41966967448 at 767563fb7f, 2026-11-05. The test failed in sync_blocks with AssertionError at assert (all([len(x.getpeerinfo()) for x in rpc_connections])).
  • test_sequence_lock_unconfirmed_inputs (test/functional/feature_bip68_sequence.py:275-279) runs ten times:
for node in self.nodes:
    node.setmocktime(cur_time + 600)
self.generate(self.wallet, 1, sync_fun=self.no_op)
cur_time += 600

Nothing waits for node1 to receive a block before the next bump.

  • The combined log shows a block still in flight on node1 across two bumps:
node1 04:36:11.111603Z (mocktime: 04:56:11Z) Saw new cmpctblock header hash=550f397f… height=1107 peer=0
node1 04:36:11.115274Z (mocktime: 04:56:11Z) ThreadRPCServer method=setmocktime
node1 04:36:11.136160Z (mocktime: 05:06:11Z) ThreadRPCServer method=setmocktime
node1 04:36:11.170115Z (mocktime: 05:16:11Z) Timeout downloading block 550f397f…, disconnecting peer=0
node0 04:36:11.178683Z (mocktime: 05:26:11Z) socket closed, disconnecting peer=0
  • The timeout is max(nPowTargetSpacing, 1min) * (BLOCK_DOWNLOAD_TIMEOUT_BASE + …) (src/net_processing.cpp:6555). With qbit's 60 s spacing that is 60 s for a single peer, so one 600 s bump with a block in flight exceeds it.

Impact

An intermittent failure of a required job on unrelated changes. One occurrence so far.

Suggested fix

Wait for every node to have the tip before each setmocktime in that loop (self.sync_blocks()), so no block is in flight when mocktime moves. Other functional tests that bump mocktime by a minute or more right after an unsynced generate may have the same hazard and are worth a search.

Found while triaging failed CI jobs on 1.x.x (2026-11-13). Code references are to 1.x.x at a7a70660ad.

Activity

  1. added
    bug
    on Nov 13, 2026
  2. added a commit that references this issue on Nov 16, 2026
    0a00d44
  3. kiwidream commented on Nov 16, 2026

    @kiwidream
    MemberAuthor

    Fixed on 1.x.x by #431, merged as 0a00d44. Closing by hand because 1.x.x is not the default branch.

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions