-
-
Notifications
You must be signed in to change notification settings - Fork 289
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: eth1 provider error logging #6863
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## unstable #6863 +/- ##
============================================
- Coverage 62.20% 62.19% -0.01%
============================================
Files 571 571
Lines 60021 60103 +82
Branches 1976 1976
============================================
+ Hits 37334 37380 +46
- Misses 22644 22680 +36
Partials 43 43 |
d0f0428
to
2a2aeee
Compare
Performance Report✔️ no performance regression detected Full benchmark results
|
2a2aeee
to
09819d8
Compare
09819d8
to
c339c6c
Compare
|
||
return msSinceLastCall > minElapsedTime; | ||
if (msSinceLastCall > minElapsedTime) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not in favor of this change in createElapsedTimeTracker
as it's just to track the total elapsed time without any frequency.
If there is no other usage then we can rename this to createTimeFrequencyTracker
or similar to make it clear.
Or I would better suggest to use the rateLimiter
here. We have few implementation that we can move to utils and reuse here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's really unintuitive based on current usage of createElapsedTimeTracker
that is would reset that timer if there are intermediate calls.
In the test cases, the function is even called callIfTimePassed
which suggests call code if time passed, e.g. like this
if (callIfTimePassed()) {
// run this code after time passed
}
The usage in eth1Provider
is the same, the name of the function is isOneMinutePassed
which suggest log the error if one minute is passed, irrespective of how many times it called isOneMinutePassed
in-between.
My suggestion is to either fix createElapsedTimeTracker
, or to remove it altogether has the only use case right now is in eth1Provider.ts
and it does not what it is supposed to do there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an improvement wrt the logging behavior.
no opinion on the naming
🎉 This PR is included in v1.20.0 🎉 |
Motivation
Currently, we will only log the error once if the eth1 provider throws continuous errors with a frequency of < 1min while the intended behavior should be to log at most an error every minute to not be silent about the issue but also not flood the logs with errors.
Description
Update
elapsedTimeTracker
to not reset timer if there are intermediate calls before time has passedPart of #6469