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

app: fix tracker delay to capture inclusion #2424

Merged
merged 2 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -645,13 +645,16 @@
return nil, err
}

// Add InclMissedLag slots and InclCheckLag delay to analyser to capture missed inclusion errors.
trackerDelay := tracker.InclMissedLag + tracker.InclCheckLag

Check warning on line 650 in app/app.go

View check run for this annotation

Codecov / codecov/patch

app/app.go#L649-L650

Added lines #L649 - L650 were not covered by tests
analyser := core.NewDeadliner(ctx, "tracker_analyser", func(duty core.Duty) (time.Time, bool) {
d, ok := deadlineFunc(duty)
return d.Add(tracker.InclMissedLag * slotDuration), ok // Add InclMissedLag slots delay to analyser to capture missed inclusion errors.
return d.Add(time.Duration(trackerDelay) * slotDuration), ok

Check warning on line 653 in app/app.go

View check run for this annotation

Codecov / codecov/patch

app/app.go#L653

Added line #L653 was not covered by tests
})
deleter := core.NewDeadliner(ctx, "tracker_deleter", func(duty core.Duty) (time.Time, bool) {
d, ok := deadlineFunc(duty)
return d.Add(tracker.InclMissedLag * slotDuration).Add(time.Minute), ok // Delete duties after analyser_deadline+1min.
return d.Add(time.Duration(trackerDelay) * slotDuration).Add(time.Minute), ok // Delete duties after analyser_deadline+1min.

Check warning on line 657 in app/app.go

View check run for this annotation

Codecov / codecov/patch

app/app.go#L657

Added line #L657 was not covered by tests
})

trackFrom, err := calculateTrackerDelay(ctx, eth2Cl, time.Now())
Expand Down
5 changes: 3 additions & 2 deletions core/tracker/inclusion.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ import (

const (
// InclCheckLag is the number of slots to lag before checking inclusion.
// Half an epoch is good compromise between finality and responsiveness.
InclCheckLag = 16
// We wait for 4 slots to mitigate against reorgs as it should cover almost all reorg scenarios.
// Reorgs of more than 4 slots are very rare in ethereum PoS.
InclCheckLag = 4
// InclMissedLag is the number of slots after which we assume the duty was not included and we
// delete cached submissions.
InclMissedLag = 32
Expand Down
Loading