• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

btcsuite / btcd / 34637539728
54%
master: 54%

Build:
Build:
LAST BUILD BRANCH: fix/netsync-sync-peer-stall-2606
DEFAULT BRANCH: master
Ran 11 Sep 2026 07:13PM UTC
Jobs 9
Files 363
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

11 Sep 2026 07:12PM UTC coverage: 54.16% (+0.1%) from 54.025%
34637539728

Pull #2607

github

Roasbeef
netsync: add property-based tests for sync state recovery

In this commit, we add two rapid-based property tests that generalize the regression test for the lost-sync-peer stall.

TestPropertyLostSyncPeerRecovers covers the near-tip disconnect across arbitrary chain heights and remaining-peer height combinations: for any generated scenario, losing the sync peer with IBD enabled must either promote a strictly higher replacement peer (re-entering IBD through the header-first path, which the test drives to completion) or fully reset the sync state so that a new-block announcement from any remaining peer is requested.

TestPropertySyncStateTransition is a stateful property over the whole header-first sync state machine. A generated schedule of events (new peers at arbitrary heights, header and block delivery from the sync peer, stalls, and peer loss) is replayed against the manager, asserting after every event that the dead state (nil sync peer with IBD enabled) in which handleInvMsg discards announcements never holds.

generateTestBlocks now anchors timestamps to the current time rather than the 2011 regtest genesis timestamp. A chain built from the genesis timestamp is never IsCurrent, which keeps the near-tip paths where the stall occurs unreachable; starting from now keeps them reachable at any generated height, which is what lets the properties reproduce the bug. Both properties fail on the parent commit and pass with the fix.

Tests: go test ./netsync/ ./blockchain/ ./peer/ ./mempool/; go test ./...
Pull Request #2607: netsync: recover after losing sync peer near tip

4 of 4 new or added lines in 1 file covered. (100.0%)

771 existing lines in 8 files now uncovered.

38073 of 70297 relevant lines covered (54.16%)

369139.87 hits per line

Coverage Regressions

Lines Coverage ∆ File
680
6.51
0.03% rpcserver.go
27
79.0
-2.37% txscript/standard.go
22
0.0
-100.0% rpcclient/cookiefile.go
15
79.5
-2.16% btcec/v2/ellswift/ellswift.go
13
75.43
-3.17% psbt/finalizer.go
8
85.19
-2.47% psbt/utils.go
4
88.81
-0.93% database/ffldb/blockio.go
2
45.86
6.58% netsync/manager.go
Jobs
ID Job ID Ran Files Coverage
1 btcec - 34637539728.1 11 Sep 2026 07:14PM UTC 18
78.63
GitHub Action Run
2 wire - 34637539728.2 11 Sep 2026 07:14PM UTC 41
85.87
GitHub Action Run
3 address - 34637539728.3 11 Sep 2026 07:14PM UTC 56
17.24
GitHub Action Run
4 txscript - 34637539728.4 11 Sep 2026 07:14PM UTC 78
56.95
GitHub Action Run
5 psbt - 34637539728.5 11 Sep 2026 07:14PM UTC 99
22.46
GitHub Action Run
6 btcd - 34637539728.6 11 Sep 2026 07:13PM UTC 252
43.83
GitHub Action Run
7 chainhash - 34637539728.7 11 Sep 2026 07:14PM UTC 2
82.21
GitHub Action Run
8 chaincfg - 34637539728.8 11 Sep 2026 07:14PM UTC 43
8.88
GitHub Action Run
9 btcutil - 34637539728.9 11 Sep 2026 07:14PM UTC 93
23.38
GitHub Action Run
Source Files on build 34637539728
  • Tree
  • List 363
  • Changed 16
  • Source Changed 4
  • Coverage Changed 16
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #34637539728
  • Pull Request #2607
  • PR Base - master (#34550714985)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc