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(sync): unify ban logic in all sync processes #5713

Merged
merged 7 commits into from
Sep 1, 2023

Conversation

mrnaveira
Copy link
Contributor

Description

  • New common PeerManager struct that handles peer bans. All synchronizers reuse this manager to perform the bans.
  • Each synchornizer error definition (HorizonSyncError, BlockHeaderSyncError, etc.) now encapsulates the relationship (and duration) of the bans.
  • Fixed logic of peer removal on long bans
  • All synchronizers now handle single peer errors the same way
  • All synchronizers now handle latency the same way

Motivation and Context

All sync processes (header_sync, block_sync and horizon_sync) handle bans differently., but the recommended approach is the recent block sync refactor (#5691).

The purpose of this PR is for all syncs to behave the same and ensure:

  • All errors that should be banned do result in bans
  • Peers are not banned for unrelated errors (database, async, etc.)
  • Long bans remove the peers from the peer sync list

How Has This Been Tested?

Tests pass

What process can a PR reviewer use to test or verify this change?

Code review

Breaking Changes

  • None
  • Requires data directory on base node to be deleted
  • Requires hard fork
  • Other - Please specify

@github-actions
Copy link

github-actions bot commented Sep 1, 2023

Test Results (CI)

1 196 tests   1 196 ✔️  10m 29s ⏱️
     38 suites         0 💤
       1 files           0

Results for commit 40c2099.

♻️ This comment has been updated with latest results.

@ghpbot-tari-project ghpbot-tari-project added P-acks_required Process - Requires more ACKs or utACKs P-reviews_required Process - Requires a review from a lead maintainer to be merged labels Sep 1, 2023
stringhandler
stringhandler previously approved these changes Sep 1, 2023
Copy link
Collaborator

@stringhandler stringhandler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@ghpbot-tari-project ghpbot-tari-project removed the P-reviews_required Process - Requires a review from a lead maintainer to be merged label Sep 1, 2023
SWvheerden
SWvheerden previously approved these changes Sep 1, 2023
Copy link
Collaborator

@SWvheerden SWvheerden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pending clippy

@mrnaveira mrnaveira dismissed stale reviews from SWvheerden and stringhandler via e9421da September 1, 2023 12:03
@ghpbot-tari-project ghpbot-tari-project added the P-reviews_required Process - Requires a review from a lead maintainer to be merged label Sep 1, 2023
@SWvheerden SWvheerden merged commit 4b2b28b into tari-project:development Sep 1, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P-acks_required Process - Requires more ACKs or utACKs P-reviews_required Process - Requires a review from a lead maintainer to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants