-
Notifications
You must be signed in to change notification settings - Fork 422
Description
Currently, the onion_utils module in rust-lightning is private and not accessible to library users. This module contains useful structs and functions for working with onion routing that could benefit developers building custom Lightning implementations or tools.
Use Case
Developers who need direct access to onion-related utilities for:
- Custom payment routing logic
- Advanced onion packet manipulation
- Testing and development of Lightning-adjacent tools
- Building specialized Lightning applications that need lower-level onion routing primitives
Proposed Solution
Expose the onion_utils module and it internal structs and functions publicly behind an opt-in feature flag (e.g., expose-onion-utils or advanced-routing)
- Make the module conditionally public with a feature flag
- Convert internal
pub(crate)items to pub
Real-World Use Case
I've been using a fork to implement a new target for bitcoinfuzz to do differential fuzzing on onion decoding. I've made some internal structs public and the whole module public using a feature flag.
Fork demonstrating the changes: main...erickcestari:rust-lightning:expose-onion-utils
Some questions
- Would you be open to accepting a PR with these changes?
- What would be an appropriate feature flag name?
- Should the feature be marked as unstable/experimental in documentation?
- Are there specific items in
onion_utilsthat should remain private?