Skip to content

feat(sync-v2): Improve overall logging#854

Merged
msbrogli merged 1 commit intomasterfrom
feat/sync-v2-improve-logs
Nov 9, 2023
Merged

feat(sync-v2): Improve overall logging#854
msbrogli merged 1 commit intomasterfrom
feat/sync-v2-improve-logs

Conversation

@msbrogli
Copy link
Member

@msbrogli msbrogli commented Nov 9, 2023

Motivation

After running our latest QA, we noticed that the sync-v2 logging can be improved in a way that we don't get too many duplicated log messages but got enough messages to debug an issue.

Acceptance Criteria

  1. Add _HeightInfo.__str__() because it is used by the log json serializer.
  2. Only log "blocks are synced" and "nothing to sync because peer is behind me at the same best blockchain" when we transition from not synced to synced. So it stops logging duplicated messages all the time.
  3. Improve other log levels and messages.

Checklist

  • If you are requesting a merge into master, confirm this code is production-ready and can be included in future releases as soon as it gets merged

@msbrogli msbrogli added the enhancement New feature or request label Nov 9, 2023
@msbrogli msbrogli requested a review from glevco November 9, 2023 15:38
@msbrogli msbrogli self-assigned this Nov 9, 2023
@msbrogli msbrogli requested a review from jansegre as a code owner November 9, 2023 15:38
@codecov
Copy link

codecov bot commented Nov 9, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (d0a1ff2) 85.50% compared to head (db38db4) 85.33%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #854      +/-   ##
==========================================
- Coverage   85.50%   85.33%   -0.18%     
==========================================
  Files         282      282              
  Lines       22242    22247       +5     
  Branches     3361     3363       +2     
==========================================
- Hits        19018    18984      -34     
- Misses       2562     2595      +33     
- Partials      662      668       +6     
Files Coverage Δ
hathor/p2p/sync_v2/blockchain_streaming_client.py 81.01% <100.00%> (ø)
hathor/p2p/sync_v2/streamers.py 90.86% <100.00%> (ø)
hathor/p2p/sync_v2/agent.py 78.21% <90.90%> (-2.07%) ⬇️
hathor/p2p/sync_v2/transaction_streaming_client.py 79.20% <50.00%> (-10.90%) ⬇️

... and 4 files with indirect coverage changes

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

@msbrogli msbrogli merged commit db38db4 into master Nov 9, 2023
@msbrogli msbrogli deleted the feat/sync-v2-improve-logs branch November 9, 2023 17:04
@jansegre jansegre mentioned this pull request Nov 13, 2023
2 tasks
This was referenced Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants