Skip to content

Use PrintableString for displaying errors in PeerManager #2342

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

Conversation

vladimirfomene
Copy link
Contributor

We currently just print "with non-ASCII error message" to log when we see non-ASCII chars, but should instead use our fancy UntrustedString wrapper to display the untrusted string and ignore control chars.

Fixes #2291

@vladimirfomene vladimirfomene force-pushed the 2023-06-use-untrustedstring-in-error-logs branch 2 times, most recently from ba70a73 to eebdfaf Compare June 7, 2023 05:34
@vladimirfomene vladimirfomene force-pushed the 2023-06-use-untrustedstring-in-error-logs branch from eebdfaf to 86da719 Compare June 7, 2023 06:37
dunxen
dunxen previously approved these changes Jun 7, 2023
Copy link
Contributor

@dunxen dunxen left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks, Vlad!

@codecov-commenter
Copy link

codecov-commenter commented Jun 7, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.05 🎉

Comparison is base (fb140b5) 90.34% compared to head (b5c89cc) 90.40%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2342      +/-   ##
==========================================
+ Coverage   90.34%   90.40%   +0.05%     
==========================================
  Files         104      104              
  Lines       53392    53771     +379     
  Branches    53392    53771     +379     
==========================================
+ Hits        48237    48609     +372     
- Misses       5155     5162       +7     
Impacted Files Coverage Δ
lightning/src/ln/peer_handler.rs 61.82% <100.00%> (+1.49%) ⬆️

... and 22 files with indirect coverage changes

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

We currently just print "with non-ASCII error message"
to log when we see non-ASCII chars, but should instead
use our fancy PrintableString type to display the
untrusted string and ignore control chars.
@vladimirfomene vladimirfomene force-pushed the 2023-06-use-untrustedstring-in-error-logs branch from 86da719 to b5c89cc Compare June 7, 2023 18:41
@jkczyz jkczyz changed the title Use UntrustedString for displaying errors in PeerManager Use PrintableString for displaying errors in PeerManager Jun 7, 2023
Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

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

Thanks!

@TheBlueMatt TheBlueMatt merged commit f09c370 into lightningdevkit:main Jun 7, 2023
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.

Move PeerManager ErrorMessage logging to UnsafeString
4 participants