Skip to content

logging every sent receive onion message #2642

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

Merged
merged 1 commit into from
Dec 5, 2023

Conversation

Sharmalm
Copy link
Contributor

@Sharmalm Sharmalm commented Oct 3, 2023

This Pr solves issue #2346

@codecov-commenter
Copy link

codecov-commenter commented Oct 4, 2023

Codecov Report

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

Comparison is base (6b43153) 88.64% compared to head (ff5e522) 88.62%.

Files Patch % Lines
lightning/src/onion_message/offers.rs 0.00% 10 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2642      +/-   ##
==========================================
- Coverage   88.64%   88.62%   -0.03%     
==========================================
  Files         115      115              
  Lines       90257    90270      +13     
  Branches    90257    90270      +13     
==========================================
- Hits        80009    79999      -10     
- Misses       7842     7866      +24     
+ Partials     2406     2405       -1     

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

@jkczyz jkczyz self-requested a review October 12, 2023 14:31
@TheBlueMatt
Copy link
Collaborator

Looks like this doesn't build currently.

@Sharmalm
Copy link
Contributor Author

In my device it build successfully.
image

@jkczyz
Copy link
Contributor

jkczyz commented Oct 16, 2023

In my device it build successfully. image

See the "Checks" tab on this PR:

error[E0592]: duplicate definitions with name `as_tlv_stream`
   --> lightning/src/offers/invoice.rs:712:2
    |
681 |     pub(crate) fn as_tlv_stream(&$self) -> PartialInvoiceTlvStreamRef {
    |     ----------------------------------------------------------------- other definition for `as_tlv_stream`
...
712 |     pub(super) fn as_tlv_stream(&self) -> FullInvoiceTlvStreamRef {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ duplicate definitions for `as_tlv_stream`

error[E0592]: duplicate definitions with name `as_tlv_stream`
   --> lightning/src/offers/invoice_request.rs:608:2
    |
515 |     pub(crate) fn as_tlv_stream(&$self) -> PartialInvoiceRequestTlvStreamRef {
    |     ------------------------------------------------------------------------ other definition for `as_tlv_stream`
...
608 |     fn as_tlv_stream(&self) -> FullInvoiceRequestTlvStreamRef {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ duplicate definitions for `as_tlv_stream`

@jkczyz
Copy link
Contributor

jkczyz commented Oct 16, 2023

Specifically, as_tlv_stream is already defined elsewhere with #[cfg(test)], so you are duplicating the definition. Be sure to run cargo test locally, too.

@valentinewallace
Copy link
Contributor

Could you update/squash your commit history per https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#committing-patches? I think this is close

@TheBlueMatt
Copy link
Collaborator

Looks like this is failing (doc)tests.

@Sharmalm
Copy link
Contributor Author

Looks like this is failing (doc)tests.

I am very confused about the error here , error is not specific here.

@jkczyz
Copy link
Contributor

jkczyz commented Oct 18, 2023

I am very confused about the error here , error is not specific here.

CI shows:

stderr:
thread 'main' panicked at lightning/src/onion_message/messenger.rs:18:38:
not implemented
stack backtrace:
   0: rust_begin_unwind
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/panicking.rs:595:5
   1: core::panicking::panic_fmt
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/panicking.rs:67:14
   2: core::panicking::panic
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/panicking.rs:117:5
   3: <rust_out::main::_doctest_main_lightning_src_onion_message_messenger_rs_44_0::FakeLogger as lightning::util::logger::Logger>::log
   4: lightning::onion_message::messenger::OnionMessenger<ES,NS,L,MR,OMH,CMH>::send_onion_message
   5: rust_out::main::_doctest_main_lightning_src_onion_message_messenger_rs_44_0
   6: rust_out::main
   7: core::ops::function::FnOnce::call_once
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Here line 18 refers to the 18th line within the example. So test is panicking because FakeLogger is not implemented but is now being called.

@TheBlueMatt
Copy link
Collaborator

Looks like this needs a rebase when you next push, sorry about that.

@Sharmalm Sharmalm force-pushed the 2346 branch 2 times, most recently from f1abd13 to 84067e0 Compare November 1, 2023 14:13
@Sharmalm Sharmalm force-pushed the 2346 branch 3 times, most recently from 4fa24ec to 2ad1969 Compare December 1, 2023 11:11
@jkczyz jkczyz marked this pull request as ready for review December 2, 2023 16:12
@jkczyz
Copy link
Contributor

jkczyz commented Dec 2, 2023

LGTM. Please squash your commits down to one.

@Sharmalm Sharmalm force-pushed the 2346 branch 2 times, most recently from ed6ea03 to b7d38fb Compare December 2, 2023 18:25
Logs every sent + receive for P2P messages
solves lightningdevkit#2346
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.

LGTM. Patch could be a bit cleaner in a few places but its not a big deal. @jkczyz'd already acked the same patch which was only rather trivially rebased.

@TheBlueMatt TheBlueMatt merged commit 242e6ae into lightningdevkit:main Dec 5, 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.

6 participants