Skip to content

cuprated: get_info, syncer improvements - #653

Merged
Boog900 merged 3 commits into
Cuprate:mainfrom
redsh4de:fix/syncer-status
Jul 20, 2026
Merged

cuprated: get_info, syncer improvements#653
Boog900 merged 3 commits into
Cuprate:mainfrom
redsh4de:fix/syncer-status

Conversation

@redsh4de

@redsh4de redsh4de commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

What

Improves sync-status updates and fixes a race in get_info

Why

The previous implementation had a couple shortcomings:

  1. get_info read the target height separately for busy_syncing and target_height, so an update between those reads could produce a conflicting response.
  2. When an invalid block caused the blockchain manager to stop the downloader, the syncer returned to waiting instead of rechecking immediately.
  3. Disconnecting the peer with the highest cumulative difficulty could leave the sync status stuck on an old target height.

monerod also performs separate sync-state reads in get_info (race prone), so we avoid it by reading target_height once at the top, then derive busy_syncing and synchronized from it.

Where

cuprated, p2p-core

How

  1. Re-notify the syncer immediately after a stop signal is received
  2. Read target_height once at the top, busy_syncing and synchronized become derivatives of it
  3. Add a peer disconnect callback, that notifies the syncer and re-checks state if a peer disconnects

@github-actions github-actions Bot added A-p2p Area: Related to P2P. A-binaries Area: Related to binaries. labels Jul 12, 2026
@redsh4de
redsh4de force-pushed the fix/syncer-status branch 2 times, most recently from 21bcb81 to 27955cc Compare July 13, 2026 07:22
@redsh4de
redsh4de marked this pull request as ready for review July 13, 2026 09:02
@redsh4de
redsh4de force-pushed the fix/syncer-status branch 2 times, most recently from b9f8a89 to 02f0cb9 Compare July 14, 2026 20:05
@redsh4de redsh4de changed the title cuprated: improve status and peer disconnect handling for syncer cuprated: get_info, syncer improvements Jul 19, 2026
@redsh4de
redsh4de force-pushed the fix/syncer-status branch from 8b6da96 to ee0ea20 Compare July 19, 2026 22:07
@Boog900
Boog900 merged commit d57d59d into Cuprate:main Jul 20, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-binaries Area: Related to binaries. A-p2p Area: Related to P2P.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants