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
public scid utils #2694
public scid utils #2694
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #2694 +/- ##
==========================================
- Coverage 88.78% 88.51% -0.28%
==========================================
Files 112 115 +3
Lines 88474 92277 +3803
Branches 88474 92277 +3803
==========================================
+ Hits 78553 81678 +3125
- Misses 7686 8094 +408
- Partials 2235 2505 +270 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ran into needing a function from here yesterday
Can you expand on the motivation here a bit? A commit with just "public scid utils" isn't very descriptive of what you're trying to do, why you're trying to do it, and how you're going about accomplishing it. |
Please see my comment in this other PR #2677 (comment). These "lite" users on Sphinx Chat effectively share a channel by creating "virtual private channels" behind a real node. The utils in this file are useful for the server assigning SCIDs (our app actually creates a new identity keypair for each contact or group, and can simultaneously have self-custodial sats via VLS bindings and real channels). These "virtual" accounts can be thought of like "onion mailboxes" whose purpose is to obfuscate activity from the server operator and group chat admins |
Lets discuss there what's required, but specific to this I don't think exposing these utils as-is provides any value unless |
Any other thought on this @TheBlueMatt? I'm happy to close the issue it if you don't feel comfortable exposing this stuff ... easy enough to copy+paste little utils like |
Apologies for the delay here. Sorry, somehow I'd been confused and thought you specifically needed the |
no prob! My need for the |
Right, if you have a "service provider node" can you not just call |
our node is actually a CLN node, we are using the |
lightning/src/util/scid_utils.rs
Outdated
@@ -65,7 +70,7 @@ pub fn scid_from_parts(block: u64, tx_index: u64, vout_index: u64) -> Result<u64 | |||
/// 2) phantom node payments, to get an scid for the phantom node's phantom channel | |||
/// 3) payments intended to be intercepted will route using a fake scid (this is typically used so | |||
/// the forwarding node can open a JIT channel to the next hop) | |||
pub(crate) mod fake_scid { | |||
pub mod fake_scid { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we discussed this on discord prior to the holidays and concluded that all the fake_scid stuff wasn't actually that useful downstream since its really tied to internal LDK behavior and non-ChannelManager-based applications should do their own random SCID generation. However, the module itself is useful to expose. Mind making those changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, sorry to take forever on this simple change. Should be good to go now
Warning Rate Limit Exceeded@Evanfeenstra has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 27 minutes and 46 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. WalkthroughThe Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
f7c8d0d
to
9a665ca
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (2)
- lightning/src/util/mod.rs (2 hunks)
- lightning/src/util/scid_utils.rs (3 hunks)
Additional comments: 7
lightning/src/util/mod.rs (2)
- 23-23: The
scid_utils
module has been made public. This change aligns with the PR's objective to allow the use of utilities across other crates.- 23-23: The
transaction_utils
module has been changed from public topub(crate)
. Ensure that this change does not affect any external crates that might be depending on this module.lightning/src/util/scid_utils.rs (5)
- 27-31: The
ShortChannelIdError
enum has been introduced with variants for different overflow errors. This is a good practice for error handling and makes the code more robust.- 99-103: New variants have been added to the
Namespace
enum within thefake_scid
module. Ensure that the addition of these variants is reflected wherever theNamespace
enum is used.- 10-10: The file-level documentation comment has been added to describe the purpose of the utilities in
scid_utils.rs
. This is a good practice for code maintainability.- 27-31: The error handling for
scid_from_parts
using theShortChannelIdError
enum is well-implemented, providing clear error messages for different types of overflow.- 99-103: The addition of new variants to the
Namespace
enum is consistent with the PR's objectives to support different use cases for fake SCIDs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This is now super trivial and just exposes a handful of nice utilities. There's no reason to wait on a second reviewer.
These SCID utils are super useful! Would love to have this file public so we can use it in other crates. The
fake_scid
stuff is handy as well