Skip to content

Add more information to OpenChannelRequest Event #3019

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
Aug 5, 2024

Conversation

benthecarman
Copy link
Contributor

Noticed it was missing is_public and figured could just add all the fields since this isn't serialized.

@codecov-commenter
Copy link

codecov-commenter commented Apr 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.73%. Comparing base (a76ec06) to head (eb47656).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3019      +/-   ##
==========================================
- Coverage   89.80%   89.73%   -0.07%     
==========================================
  Files         122      122              
  Lines      101621   101634      +13     
  Branches   101621   101634      +13     
==========================================
- Hits        91261    91206      -55     
- Misses       7674     7730      +56     
- Partials     2686     2698      +12     

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

@benthecarman
Copy link
Contributor Author

Msrv strikes again 😭

/// True if this channel is (or will be) publicly-announced.
is_public: bool,
/// Opening fields for the channel given by the counterparty.
open_fields: msgs::CommonOpenChannelFields,
Copy link
Contributor

Choose a reason for hiding this comment

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

Mh, if we want to do this, I wonder if we should drop the channel_type field as it's redundant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think so, channel type is calculated through a function above, eaiser to give that to the user so they don't need to calculate themselves

Copy link
Collaborator

Choose a reason for hiding this comment

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

I mean if we want to do that we should just (finally) require channel type features and then its never negotiated but rather we always use what is in the message :).

That said, there's a lot of extra crap here...I'm fairly confident users don't care about the basepoints of the channel, the temporary_channel_id is redundant, and the chain hash is always matching (cause we check it in LDK). ISTM this is being included primarily for the numerical fields (dust limit, max in-flight value, htlc min, initial feerate, to-self delay and max HTLCs), which makes sense, but its a bit annoying to shove a lot of additional data in here.

Can we instead add like a ChannelParameters struct which contains just these? Can be a part of the wire message struct or a standalone one for the event.

@tnull
Copy link
Contributor

tnull commented Apr 25, 2024

Btw, we should also look into allowing acting on any of these fields soon, see #2914

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.

I'll probably do a pass at improving the docs, but this is fine as-is. Gonna go ahead and merge it, though, since its quite simple and there wasn't any other feedback on the API changes in the last round.

/// The feerate for the commitment transaction set by the channel initiator until updated by
/// [`UpdateFee`]
pub commitment_feerate_sat_per_1000_weight: u32,
/// The number of blocks which the counterparty will have to wait to claim on-chain funds if they
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is somewhat confusing in context - for an inbound channel this is the amount of blocks that we'll have to wait.

@TheBlueMatt TheBlueMatt merged commit c7419b4 into lightningdevkit:main Aug 5, 2024
14 of 19 checks passed
@benthecarman benthecarman deleted the is-public branch August 5, 2024 17:38
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.

4 participants