Skip to content

Conversation

@TheBlueMatt
Copy link
Collaborator

@TheBlueMatt TheBlueMatt commented Dec 9, 2025

AttributionData is a part of the public UpdateFulfillHTLC and UpdateFailHTLC messages, but its not actually pub. Yet again re-exports bite us and leave us with a broken public API - we ended up accidentally sealing AttributionData.

Instead, here, we just make onion_utils pub so that we avoid making the same mistake in the future.

Note that this still leaves us with arather useless public AttributionData API - it can't be created, updated, or decoded, it can only be serialized and deserialized, but at least it exists.

Best reviewed with --color-moved --color-moved-ws=ignore-space-change.

@TheBlueMatt TheBlueMatt added this to the 0.3 milestone Dec 9, 2025
@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Dec 9, 2025

I've assigned @joostjager as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

`AttributionData` is a part of the public `UpdateFulfillHTLC` and
`UpdateFailHTLC` messages, but its not actually `pub`. Yet again
re-exports bite us and leave us with a broken public API - we
ended up accidentally sealing `AttributionData`.

Instead, here, we just make `onion_utils` `pub` so that we avoid
making the same mistake in the future.

Note that this still leaves us with arather useless public
`AttributionData` API - it can't be created, updated, or decoded,
it can only be serialized and deserialized, but at least it exists.
@TheBlueMatt TheBlueMatt force-pushed the 2025-12-dont-seal-structs branch from 70be158 to bd57823 Compare December 9, 2025 01:40
@codecov
Copy link

codecov bot commented Dec 9, 2025

Codecov Report

❌ Patch coverage is 97.72727% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 89.33%. Comparing base (75a6c5b) to head (bd57823).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
lightning/src/ln/onion_utils.rs 97.61% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4268   +/-   ##
=======================================
  Coverage   89.33%   89.33%           
=======================================
  Files         180      180           
  Lines      139302   139300    -2     
  Branches   139302   139300    -2     
=======================================
+ Hits       124439   124450   +11     
+ Misses      12241    12219   -22     
- Partials     2622     2631    +9     
Flag Coverage Δ
fuzzing 35.04% <97.61%> (+0.01%) ⬆️
tests 88.68% <97.72%> (+<0.01%) ⬆️

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.

Copy link
Contributor

@joostjager joostjager left a comment

Choose a reason for hiding this comment

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

Why not make the AttributionData API more useful by making more public?

General comment is that there are a few changes bundled in one commit that would be easier to review if separated. Nothing complicated happening of course here.

pub(crate) mod channel;

pub(crate) mod onion_utils;
pub mod onion_utils;
Copy link
Contributor

Choose a reason for hiding this comment

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

One commit where just this and making everything inside onion_utils pub(crate) would have been a nice intermediate step.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yea, it grew organically 😂

@ldk-reviews-bot
Copy link

👋 The first review has been submitted!

Do you think this PR is ready for a second reviewer? If so, click here to assign a second reviewer.

@TheBlueMatt
Copy link
Collaborator Author

Why not make the AttributionData API more useful by making more public?

I didn't think too hard about it, but looked through the existing API and it all really seemed to be internal utilities that don't make sense public. I'd love to expose a useful public API but changing the interface seemed out of scope for a PR just trying to fix our public API which is currently broken.

@TheBlueMatt TheBlueMatt merged commit b38f117 into lightningdevkit:main Dec 9, 2025
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants