Skip to content

Conversation

@joostjager
Copy link
Contributor

@joostjager joostjager commented Dec 16, 2025

This is a stripped-down version of #4223 where only the spans are stored in thread local storage. Contrary to storing the logger instance itself as well, this code change is fully optional and not interfering with the dev ux for no std users.

Example log output:

std-spans.log

node 2 TRACE [lightning::chain::channelmonitor:4263]   ch:d9d065 [Reconnect nodes B and C->handle_new_monitor_update] Updating ChannelMonitor with latest holder commitment transaction info [p:0355f8]
node 2 DEBUG [lightning::chain::chainmonitor:1451]     ch:d9d065 [Reconnect nodes B and C->handle_new_monitor_update] Persistence of ChannelMonitorUpdate id 5 completed [p:0355f8]
node 2 DEBUG [lightning::ln::channelmanager:11589]     ch:d9d065 [Reconnect nodes B and C->handle_new_monitor_update] Channel is open and awaiting update, resuming it [p:0355f8]
node 2 DEBUG [lightning::ln::channel:9488]             ch:d9d065 [Reconnect nodes B and C->handle_new_monitor_update] Restored monitor updating in channel d9d065715d1cbe419a5cddaa8b1b749e00acc5a747c7d08165767d1225770bcd resulting in no commitment update and an RAA, with commitment first [p:0355f8]
node 2 TRACE [lightning::ln::channelmanager:9838]      ch:d9d065 [Reconnect nodes B and C->handle_new_monitor_update] Handling channel resumption with an RAA, no commitment update, 0 pending forwards, 0 pending update_add_htlcs, not broadcasting funding, without channel ready, without announcement, without tx_signatures, without tx_abort [p:0355f8]
node 1 TRACE [lightning::ln::channel:8670]             ch:d9d065 [Reconnect nodes B and C] Updating HTLCs on receipt of RAA... [p:02888f]
node 1 TRACE [lightning::ln::channel:8703]             ch:d9d065 [Reconnect nodes B and C]  ...removing outbound AwaitingRemovedRemoteRevoke 66687aadf862bd776c8fc18b8e9f8e20089714856ee233b3902a591d0d5f2925 [p:02888f]
node 1 DEBUG [lightning::ln::channel:8962]             ch:d9d065 [Reconnect nodes B and C] Received a valid revoke_and_ack with no reply necessary. Holding monitor update 5. [p:02888f]
node 1 TRACE [lightning::ln::channelmanager:10054]     ch:ae3367 [Complete blocked ChannelMonitorUpdate->get_and_clear_pending_events] ChannelMonitor updated to 5. 0 pending in-flight updates. [p:027f92]
node 1 TRACE [lightning::ln::channelmanager:10092]     ch:ae3367 [Complete blocked ChannelMonitorUpdate->get_and_clear_pending_events] Channel is closed, applying 2 post-update actions [p:027f92]
node 1 DEBUG [lightning::ln::channelmanager:13975]     ch:d9d065 [Complete blocked ChannelMonitorUpdate->get_and_clear_pending_events] Unlocking monitor updating and updating monitor [p:02888f]
node 1 TRACE [lightning::chain::chainmonitor:1407]     ch:d9d065 [Complete blocked ChannelMonitorUpdate->get_and_clear_pending_events->handle_new_monitor_update] Updating ChannelMonitor to id 5 [p:02888f]
node 1 INFO  [lightning::chain::channelmonitor:4226]   ch:d9d065 [Complete blocked ChannelMonitorUpdate->get_and_clear_pending_events->handle_new_monitor_update] Applying update, bringing update_id from 4 to 5 with 1 change(s). [p:02888f]
node 1 TRACE [lightning::chain::channelmonitor:4311]   ch:d9d065 [Complete blocked ChannelMonitorUpdate->get_and_clear_pending_events->handle_new_monitor_update] Updating ChannelMonitor with commitment secret [p:02888f]

@ldk-reviews-bot
Copy link

👋 Hi! I see this is a draft PR.
I'll wait to assign reviewers until you mark it as ready for review.
Just convert it out of draft status when you're ready for review!

@joostjager joostjager force-pushed the std-spans branch 2 times, most recently from 38d439b to 5d2f39f Compare December 16, 2025 12:29
@codecov
Copy link

codecov bot commented Dec 16, 2025

Codecov Report

❌ Patch coverage is 82.85714% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.36%. Comparing base (62c5849) to head (5d2f39f).

Files with missing lines Patch % Lines
lightning-macros/src/lib.rs 75.00% 5 Missing and 1 partial ⚠️
lightning/src/util/logger.rs 86.04% 0 Missing and 6 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4287      +/-   ##
==========================================
- Coverage   89.38%   89.36%   -0.02%     
==========================================
  Files         180      180              
  Lines      139834   139902      +68     
  Branches   139834   139902      +68     
==========================================
+ Hits       124985   125030      +45     
- Misses      12262    12274      +12     
- Partials     2587     2598      +11     
Flag Coverage Δ
fuzzing 35.23% <100.00%> (+0.02%) ⬆️
tests 88.70% <82.85%> (-0.02%) ⬇️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@joostjager joostjager force-pushed the std-spans branch 2 times, most recently from 8a1ec8b to 1355c20 Compare December 18, 2025 10:30
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.

2 participants