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

Sync gaps fix #4090

Merged
merged 4 commits into from
Sep 19, 2022
Merged

Sync gaps fix #4090

merged 4 commits into from
Sep 19, 2022

Conversation

cheatfate
Copy link
Contributor

No description provided.

@github-actions
Copy link

github-actions bot commented Sep 7, 2022

Unit Test Results

       9 files  ±0     660 suites  ±0   21m 14s ⏱️ -1s
1 982 tests ±0  1 835 ✔️ ±0  147 💤 ±0  0 ±0 
8 060 runs  ±0  7 889 ✔️ ±0  171 💤 ±0  0 ±0 

Results for commit 56930cf. ± Comparison against base commit 4b3768c.

♻️ This comment has been updated with latest results.

@@ -385,6 +391,47 @@ proc getLastNonEmptySlot*[T](sr: SyncResult[T]): Slot {.inline.} =
else:
sr.data[^1][].slot

proc processGap[T](sq: SyncQueue[T], sr: SyncResult[T]) =
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need a check for sq.kind == SyncQueueKind.Forward?

Comment on lines +418 to +431
# Every empty response increases penalty by 25%, but not more than 200%.
let
emptyCount = gap.item.getStats(SyncResponseKind.Empty)
goodCount = gap.item.getStats(SyncResponseKind.Good)

if emptyCount <= goodCount:
gap.item.updateScore(score)
else:
let
weight = int(min(emptyCount - goodCount, 8'u64))
newScore = score + score * weight div 4
gap.item.updateScore(newScore)
debug "Peer received gap penalty", peer = gap.item,
penalty = newScore
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure how well it works with a simpler logic of just applying gap.item.updateScore(score) in any case. Eventually, peers should still be dropped without the extra scaling (after 10x PeerScoreNoBlocks in a row, a peer is considered useless and disconnected without scaling).

@zah
Copy link
Member

zah commented Sep 17, 2022

@cheatfate, can you file a separate issue for the fact that some of the fleet servers haven't backfilled all blocks? I guess it should be possible to confirm this also through the REST API or through direct database examination. The issue should indicate the affected hosts and service names (e.g. beacon-node-testing vs beacon-node-unstable, etc).

I'm also looking forward to merge this PR for the upcoming release, but it needs to be rebased at the moment.

@zah zah merged commit 174292b into unstable Sep 19, 2022
@zah zah deleted the sync-gaps-fix branch September 19, 2022 09:37
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.

None yet

3 participants