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

Add a log message during an epoch transition #6470

Draft
wants to merge 1 commit into
base: v0.37
Choose a base branch
from

Conversation

Kay-Zee
Copy link
Member

@Kay-Zee Kay-Zee commented Sep 17, 2024

Example log if we want one line per epoch transition.

@codecov-commenter
Copy link

codecov-commenter commented Sep 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 41.50%. Comparing base (5be1172) to head (ffd69a5).

Additional details and impacted files
@@            Coverage Diff             @@
##            v0.37    #6470      +/-   ##
==========================================
- Coverage   41.51%   41.50%   -0.01%     
==========================================
  Files        2017     2017              
  Lines      144007   144013       +6     
==========================================
- Hits        59778    59771       -7     
- Misses      78028    78039      +11     
- Partials     6201     6203       +2     
Flag Coverage Δ
unittests 41.50% <100.00%> (-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.

Copy link
Member

@jordanschalm jordanschalm left a comment

Choose a reason for hiding this comment

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

Looks good, depending on what we want. Some notes:

  • This will not log the first height for epochs beginning after a spork
    • if people are using these height values primarily to check the reward payout events, then the height we record for post-spork epochs in this way would not contain the reward payouts anyway
    • for post-spork epochs, the height for getting rewards would be the height of the resetEpoch transaction
  • We actually do have a metric tracking the first height of the current epoch: consensus_compliance_last_epoch_transition_height. It's a gauge that increases at every epoch transition (it also doesn't seem to handle post-spork epochs properly, though...).

@@ -884,6 +884,12 @@ func (m *FollowerState) epochMetricsAndEventsOnBlockFinalized(parentEpochState,
m.metrics.CurrentDKGPhaseViews(childEpochSetup.DKGPhase1FinalView, childEpochSetup.DKGPhase2FinalView, childEpochSetup.DKGPhase3FinalView)
},
)
m.logger.Info().
Uint64("new_epoch_counter", childEpochSetup.Counter).
Uint64("new_epoch_height", finalized.Height).
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Uint64("new_epoch_height", finalized.Height).
Uint64("new_epoch_first_height", finalized.Height).

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.

3 participants