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

Log epoch height view #6095

Merged
merged 2 commits into from
Jun 19, 2024
Merged

Log epoch height view #6095

merged 2 commits into from
Jun 19, 2024

Conversation

zhangchiqing
Copy link
Member

This PR adds some height and view to the logs when epoch events happen.

@codecov-commenter
Copy link

codecov-commenter commented Jun 13, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 8 lines in your changes missing coverage. Please review.

Project coverage is 41.75%. Comparing base (d32b10e) to head (19417cd).

Files Patch % Lines
network/p2p/cache/protocol_state_provider.go 33.33% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6095      +/-   ##
==========================================
- Coverage   41.75%   41.75%   -0.01%     
==========================================
  Files        1971     1971              
  Lines      138619   138628       +9     
==========================================
+ Hits        57877    57878       +1     
- Misses      74733    74749      +16     
+ Partials     6009     6001       -8     
Flag Coverage Δ
unittests 41.75% <33.33%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zhangchiqing zhangchiqing requested a review from kc1116 June 18, 2024 16:37
@AlexHentschel
Copy link
Member

@zhangchiqing I am curious if this code is actually related to the networking layer?

It seems like a general-purpose logging of epoch-related changes. If that is the case, I would recommend a proper separation of concerns:

  • you can implement a simple consumer for the protocol events, and subscribe it to the pub-sub events.Distributor:
    ProtocolEvents *events.Distributor
    I think this would be a good example:
    heightEvents := gadgets.NewHeights()
    node.ProtocolEvents.AddConsumer(heightEvents)

@zhangchiqing
Copy link
Member Author

@AlexHentschel I moved the logging to a events logger module

@zhangchiqing zhangchiqing added this pull request to the merge queue Jun 19, 2024
Merged via the queue into master with commit d0d7029 Jun 19, 2024
55 checks passed
@zhangchiqing zhangchiqing deleted the leo/log-epoch-height-view branch June 19, 2024 00:39
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

4 participants