Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add decision step between header sync and pruned/archival #3546

Conversation

sdbondi
Copy link
Member

@sdbondi sdbondi commented Nov 8, 2021

Description

  • removes pruned metadata sync logic from listening state
  • adds DecideNextSync step that is responsible for finding a suitable peer for block/pruned sync
  • chain metadata service includes peer latency
  • DRY'd up chain metadata service ping/pong event handling
  • take latency into account when selecting a sync peer
  • header sync orders the peers in ascending latency order

Motivation and Context

When transitioning to header sync, the listening state would filter out peers that have a suitable horizon height.
However any peer regardless of pruned height can provide headers for header sync.

How Has This Been Tested?

Sync tests
Manually

@sdbondi sdbondi force-pushed the core-sync-peer-selection-after-header-sync branch from 53e622b to 3a002ba Compare November 8, 2021 15:25
@sdbondi sdbondi force-pushed the core-sync-peer-selection-after-header-sync branch from 3a002ba to 5ab0342 Compare November 8, 2021 16:22
@aviator-app aviator-app bot merged commit 23e868a into tari-project:development Nov 9, 2021
@sdbondi sdbondi deleted the core-sync-peer-selection-after-header-sync branch November 9, 2021 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants