-
Notifications
You must be signed in to change notification settings - Fork 991
chore: fix incorrect logging in updateHead
#4191
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
base: main
Are you sure you want to change the base?
Conversation
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.
Nice
Could you run |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4191 +/- ##
=========================================
Coverage 44.83% 44.83%
=========================================
Files 265 311 +46
Lines 14620 22901 +8281
=========================================
+ Hits 6555 10268 +3713
- Misses 7313 11525 +4212
- Partials 752 1108 +356 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
cristaloleg done. |
You've added lots of dots? why? |
This is a logical conclusion to the sentence. |
Please revert these dots. 1) that's not the scope of PR, 2) that's adds additional changes in git history for not a big reason. Thanks. |
cristaloleg, np! updated. |
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.
Nice find! Would appreciate if you can do small good to haves before we merge
oldHead := s.networkHead | ||
s.networkHead = newHead | ||
log.Debugw("updated head", "from_height", s.networkHead, "to_height", newHead) | ||
|
||
log.Debugw("updated head", "from_height", oldHead, "to_height", newHead) |
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.
How about just swap order of lines instead of introducing new var?
oldHead := s.networkHead | ||
s.networkHead = newHead | ||
log.Debugw("updated head", "from_height", s.networkHead, "to_height", newHead) | ||
|
||
log.Debugw("updated head", "from_height", oldHead, "to_height", newHead) |
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.
Also looks like keys for values in the log are a bit off. Do you mind to update them for something better while we are on it? Like "old_head" and "new_head" or similar.
I noticed that
s.networkHead
was being updated after the log statement, causing"from_height"
to always match"to_height"
.Now, the old value is stored before updating, ensuring the log accurately reflects the height change.