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

fix: add rpc error metrics #412

Merged
merged 4 commits into from
Mar 23, 2023
Merged

fix: add rpc error metrics #412

merged 4 commits into from
Mar 23, 2023

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Mar 7, 2023

Motivation

Description

  • Add more logs for rpc message
  • Add metrics when handling errors

part of #411

It shows that we really have rpc errors when deploying this branch to a lodestar node
Screen Shot 2023-03-07 at 10 10 16

@twoeths twoeths requested a review from a team as a code owner March 7, 2023 03:11
@what-the-diff
Copy link

what-the-diff bot commented Mar 7, 2023

  • Add error handling for peer read stream
  • Add error handling for rpc data and recv errors
  • Logging improvements to include more information about the RPC message received from a peer (subscriptions, messages, ihave/iwant/graft/prune)

@codecov-commenter
Copy link

codecov-commenter commented Mar 7, 2023

Codecov Report

Patch coverage: 32.25% and project coverage change: -0.27 ⚠️

Comparison is base (1e1cf5a) 83.31% compared to head (219d2a1) 83.04%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #412      +/-   ##
==========================================
- Coverage   83.31%   83.04%   -0.27%     
==========================================
  Files          48       48              
  Lines       11800    11858      +58     
  Branches     1271     1279       +8     
==========================================
+ Hits         9831     9848      +17     
- Misses       1969     2010      +41     
Impacted Files Coverage Δ
src/metrics.ts 20.39% <0.00%> (-0.87%) ⬇️
src/index.ts 70.39% <64.51%> (-0.07%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

src/index.ts Outdated
let graft = 0
let prune = 0
if (rpc.control) {
ihave = rpc.control.ihave ? rpc.control.ihave.length : 0
Copy link
Contributor

@dapplion dapplion Mar 7, 2023

Choose a reason for hiding this comment

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

No need to re-assign

Suggested change
ihave = rpc.control.ihave ? rpc.control.ihave.length : 0
if (rpc.control.ihave) ihave = rpc.control.ihave.length

@wemeetagain wemeetagain merged commit 5cd8b07 into master Mar 23, 2023
@wemeetagain wemeetagain deleted the tuyen/debug_rpc_error branch March 23, 2023 13:58
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.

4 participants