-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Enhance lncli
listchannels command with the chan_id and short_chan_id (human readable format)
#9390
base: master
Are you sure you want to change the base?
Enhance lncli
listchannels command with the chan_id and short_chan_id (human readable format)
#9390
Conversation
Important Review skippedAuto reviews are limited to specific labels. 🏷️ Labels to auto review (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
6cf95f0
to
755d729
Compare
PTAL @ziggie1984 |
Please read the contribution guidelines thoroughly in particular what was immediately catching my eye is the commit structure |
Got it! Working on it Now... |
Maybe people should be warned that a renaming an API attribute would break things |
755d729
to
3d19e19
Compare
Hey @ziggie1984, I have addressed the Git commit structure and made the required changes based on your review. Please take a look. |
Thank you for the PR, I think it is enough to have the short_chan_id and the normal channel_id in the rpc msg. Then when for example depicting the channel struct via |
Addresses the reviewed changes. Here is how the {
"channels": [
{
"active": true,
"remote_pubkey": "02769271ddfb03149bc9e2e6124bb8d83209284dda3affed0dead73f57b64f45dd",
"channel_point": "6ab312e3b744e1b80a33a6541697df88766515c31c08e839bf11dc9fcc036a19:0",
"chan_id": "829031767408640",
"capacity": "20000",
"local_balance": "16530",
"remote_balance": "0",
"commit_fee": "3140",
"commit_weight": "772",
"fee_per_kw": "2500",
"unsettled_balance": "0",
"total_satoshis_sent": "0",
"total_satoshis_received": "0",
"num_updates": "0",
"pending_htlcs": [],
"csv_delay": 144,
"private": false,
"initiator": true,
"chan_status_flags": "ChanStatusDefault",
"local_chan_reserve_sat": "354",
"remote_chan_reserve_sat": "354",
"static_remote_key": false,
"commitment_type": "ANCHORS",
"lifetime": "11",
"uptime": "11",
"close_address": "",
"push_amount_sat": "0",
"thaw_height": 0,
"local_constraints": {
"csv_delay": 144,
"chan_reserve_sat": "354",
"dust_limit_sat": "354",
"max_pending_amt_msat": "19800000",
"min_htlc_msat": "1",
"max_accepted_htlcs": 483
},
"remote_constraints": {
"csv_delay": 144,
"chan_reserve_sat": "354",
"dust_limit_sat": "354",
"max_pending_amt_msat": "19800000",
"min_htlc_msat": "1",
"max_accepted_htlcs": 483
},
"alias_scids": [],
"zero_conf": false,
"zero_conf_confirmed_scid": "0",
"peer_alias": "02769271ddfb03149bc9",
"peer_scid_alias": "0",
"memo": "",
"custom_channel_data": "",
"channel_id": "196a03cc9fdc11bf39e8081cc315657688df971654a6330ab8e144b7e312b36a",
"short_chan_id": "829031767408640",
"short_chan_id_str": "754x1x0"
},
{
"active": true,
"remote_pubkey": "02769271ddfb03149bc9e2e6124bb8d83209284dda3affed0dead73f57b64f45dd",
"channel_point": "e428fb553769e4e53dbfb9749f8b057272969517ea85c63f46288487bfd62cf0:0",
"chan_id": "807041534853120",
"capacity": "100000",
"local_balance": "0",
"remote_balance": "96530",
"commit_fee": "3140",
"commit_weight": "772",
"fee_per_kw": "2500",
"unsettled_balance": "0",
"total_satoshis_sent": "0",
"total_satoshis_received": "0",
"num_updates": "0",
"pending_htlcs": [],
"csv_delay": 144,
"private": false,
"initiator": false,
"chan_status_flags": "ChanStatusDefault",
"local_chan_reserve_sat": "1000",
"remote_chan_reserve_sat": "1000",
"static_remote_key": false,
"commitment_type": "ANCHORS",
"lifetime": "459",
"uptime": "421",
"close_address": "",
"push_amount_sat": "0",
"thaw_height": 0,
"local_constraints": {
"csv_delay": 144,
"chan_reserve_sat": "1000",
"dust_limit_sat": "354",
"max_pending_amt_msat": "99000000",
"min_htlc_msat": "1",
"max_accepted_htlcs": 483
},
"remote_constraints": {
"csv_delay": 144,
"chan_reserve_sat": "1000",
"dust_limit_sat": "354",
"max_pending_amt_msat": "99000000",
"min_htlc_msat": "1",
"max_accepted_htlcs": 483
},
"alias_scids": [],
"zero_conf": false,
"zero_conf_confirmed_scid": "0",
"peer_alias": "02769271ddfb03149bc9",
"peer_scid_alias": "0",
"memo": "",
"custom_channel_data": "",
"channel_id": "f02cd6bf878428463fc685ea1795967272058b9f74b9bf3de5e4693755fb28e4",
"short_chan_id": "807041534853120",
"short_chan_id_str": "734x1x0"
}
]
} |
While looking at the protobuf file, a lot of the structs use Maybe something like I think it is not really worth dealing with all these name changes in the protofiles if so many structs are affected. Wdyt @guggero ? |
I have a better idea: So initial request was to make the We can do all this by just changing the So I favour the approach to not change anything in the RPC code, but just add all the information on the lncli side! |
90ed477
to
de85265
Compare
Done. Here is how the {
"channels": [
{
"active": false,
"remote_pubkey": "02769271ddfb03149bc9e2e6124bb8d83209284dda3affed0dead73f57b64f45dd",
"channel_point": "6ab312e3b744e1b80a33a6541697df88766515c31c08e839bf11dc9fcc036a19:0",
"funding_outpoint_id": "196a03cc9fdc11bf39e8081cc315657688df971654a6330ab8e144b7e312b36a",
"chan_id": "829031767408640",
"chan_id_str": "754x1x0",
"capacity": "20000",
"local_balance": "16530",
"remote_balance": "0",
"commit_fee": "3140",
"commit_weight": "772",
"fee_per_kw": "2500",
"unsettled_balance": "0",
"total_satoshis_sent": "0",
"total_satoshis_received": "0",
"num_updates": "0",
"pending_htlcs": [],
"csv_delay": 144,
"private": false,
"initiator": true,
"chan_status_flags": "ChanStatusDefault",
"local_chan_reserve_sat": "354",
"remote_chan_reserve_sat": "354",
"static_remote_key": false,
"commitment_type": "ANCHORS",
"lifetime": "0",
"uptime": "0",
"close_address": "",
"push_amount_sat": "0",
"thaw_height": 0,
"local_constraints": {
"csv_delay": 144,
"chan_reserve_sat": "354",
"dust_limit_sat": "354",
"max_pending_amt_msat": "19800000",
"min_htlc_msat": "1",
"max_accepted_htlcs": 483
},
"remote_constraints": {
"csv_delay": 144,
"chan_reserve_sat": "354",
"dust_limit_sat": "354",
"max_pending_amt_msat": "19800000",
"min_htlc_msat": "1",
"max_accepted_htlcs": 483
},
"alias_scids": [],
"zero_conf": false,
"zero_conf_confirmed_scid": "0",
"peer_alias": "02769271ddfb03149bc9",
"peer_scid_alias": "0",
"memo": "",
"custom_channel_data": ""
},
{
"active": false,
"remote_pubkey": "02769271ddfb03149bc9e2e6124bb8d83209284dda3affed0dead73f57b64f45dd",
"channel_point": "e428fb553769e4e53dbfb9749f8b057272969517ea85c63f46288487bfd62cf0:0",
"funding_outpoint_id": "f02cd6bf878428463fc685ea1795967272058b9f74b9bf3de5e4693755fb28e4",
"chan_id": "807041534853120",
"chan_id_str": "734x1x0",
"capacity": "100000",
"local_balance": "0",
"remote_balance": "96530",
"commit_fee": "3140",
"commit_weight": "772",
"fee_per_kw": "2500",
"unsettled_balance": "0",
"total_satoshis_sent": "0",
"total_satoshis_received": "0",
"num_updates": "0",
"pending_htlcs": [],
"csv_delay": 144,
"private": false,
"initiator": false,
"chan_status_flags": "ChanStatusDefault",
"local_chan_reserve_sat": "1000",
"remote_chan_reserve_sat": "1000",
"static_remote_key": false,
"commitment_type": "ANCHORS",
"lifetime": "0",
"uptime": "0",
"close_address": "",
"push_amount_sat": "0",
"thaw_height": 0,
"local_constraints": {
"csv_delay": 144,
"chan_reserve_sat": "1000",
"dust_limit_sat": "354",
"max_pending_amt_msat": "99000000",
"min_htlc_msat": "1",
"max_accepted_htlcs": 483
},
"remote_constraints": {
"csv_delay": 144,
"chan_reserve_sat": "1000",
"dust_limit_sat": "354",
"max_pending_amt_msat": "99000000",
"min_htlc_msat": "1",
"max_accepted_htlcs": 483
},
"alias_scids": [],
"zero_conf": false,
"zero_conf_confirmed_scid": "0",
"peer_alias": "02769271ddfb03149bc9",
"peer_scid_alias": "0",
"memo": "",
"custom_channel_data": ""
}
]
} |
Hi @ziggie1984, just following up in case my previous message was missed. |
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.
Yes this is the right approach, left some suggestions. Please also update all the comments as well if you adopt them.
@@ -74,6 +74,12 @@ | |||
This is a protocol gadget required for Dynamic Commitments and Splicing that | |||
will be added later. | |||
|
|||
* [Added]((https://github.com/lightningnetwork/lnd/pull/9390)) |
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.
add the release notes under the lncli section
Updated the `String` method of `ShortChannelID` to produce a human-readable format with 'x' as a separator (block x transaction x output). Signed-off-by: Nishant Bansal <[email protected]>
Added scid_str as a string representation of chan_id, replacing chan_id with scid, channel_point with chan_point, and including chan_id in lncli listchannels output. Signed-off-by: Nishant Bansal <[email protected]>
Signed-off-by: Nishant Bansal <[email protected]>
de85265
to
2999a81
Compare
New output: {
"channels": [
{
"active": false,
"remote_pubkey": "0367cb414c9487311a1466b51b911c994d3438713edc373a27110a7162ac1046f5",
"chan_point": "6ab312e3b744e1b80a33a6541697df88766515c31c08e839bf11dc9fcc036a19:0",
"chan_id": "196a03cc9fdc11bf39e8081cc315657688df971654a6330ab8e144b7e312b36a",
"scid": "829031767408640",
"scid_str": "754x1x0",
"capacity": "20000",
"local_balance": "0",
"remote_balance": "16530",
"commit_fee": "3140",
"commit_weight": "772",
"fee_per_kw": "2500",
"unsettled_balance": "0",
"total_satoshis_sent": "0",
"total_satoshis_received": "0",
"num_updates": "0",
"pending_htlcs": [],
"csv_delay": 144,
"private": false,
"initiator": false,
"chan_status_flags": "ChanStatusDefault",
"local_chan_reserve_sat": "354",
"remote_chan_reserve_sat": "354",
"static_remote_key": false,
"commitment_type": "ANCHORS",
"lifetime": "0",
"uptime": "0",
"close_address": "",
"push_amount_sat": "0",
"thaw_height": 0,
"local_constraints": {
"csv_delay": 144,
"chan_reserve_sat": "354",
"dust_limit_sat": "354",
"max_pending_amt_msat": "19800000",
"min_htlc_msat": "1",
"max_accepted_htlcs": 483
},
"remote_constraints": {
"csv_delay": 144,
"chan_reserve_sat": "354",
"dust_limit_sat": "354",
"max_pending_amt_msat": "19800000",
"min_htlc_msat": "1",
"max_accepted_htlcs": 483
},
"alias_scids": [],
"zero_conf": false,
"zero_conf_confirmed_scid": "0",
"peer_alias": "0367cb414c9487311a14",
"peer_scid_alias": "0",
"memo": "",
"custom_channel_data": ""
},
{
"active": false,
"remote_pubkey": "0367cb414c9487311a1466b51b911c994d3438713edc373a27110a7162ac1046f5",
"chan_point": "e428fb553769e4e53dbfb9749f8b057272969517ea85c63f46288487bfd62cf0:0",
"chan_id": "f02cd6bf878428463fc685ea1795967272058b9f74b9bf3de5e4693755fb28e4",
"scid": "807041534853120",
"scid_str": "734x1x0",
"capacity": "100000",
"local_balance": "96530",
"remote_balance": "0",
"commit_fee": "3140",
"commit_weight": "772",
"fee_per_kw": "2500",
"unsettled_balance": "0",
"total_satoshis_sent": "0",
"total_satoshis_received": "0",
"num_updates": "0",
"pending_htlcs": [],
"csv_delay": 144,
"private": false,
"initiator": true,
"chan_status_flags": "ChanStatusDefault",
"local_chan_reserve_sat": "1000",
"remote_chan_reserve_sat": "1000",
"static_remote_key": false,
"commitment_type": "ANCHORS",
"lifetime": "0",
"uptime": "0",
"close_address": "",
"push_amount_sat": "0",
"thaw_height": 0,
"local_constraints": {
"csv_delay": 144,
"chan_reserve_sat": "1000",
"dust_limit_sat": "354",
"max_pending_amt_msat": "99000000",
"min_htlc_msat": "1",
"max_accepted_htlcs": 483
},
"remote_constraints": {
"csv_delay": 144,
"chan_reserve_sat": "1000",
"dust_limit_sat": "354",
"max_pending_amt_msat": "99000000",
"min_htlc_msat": "1",
"max_accepted_htlcs": 483
},
"alias_scids": [],
"zero_conf": false,
"zero_conf_confirmed_scid": "0",
"peer_alias": "0367cb414c9487311a14",
"peer_scid_alias": "0",
"memo": "",
"custom_channel_data": ""
}
]
} |
lncli
listchannels command with the chan_id and short_chan_id (human readable format)
Change Description
Fixes: #8650
This PR enhances channel ID representation by introducing both integer and string formats for
ShortChannelId
:Renamed
ChanId
toShortChanIdInt
:ShortChannelId
.Added
ShortChanId
:ShortChannelId
in the formatblock x transaction x output
.Introduced
chan_id
:chan_id
based on the definition in the BOLT-2 Peer Protocol specification, aligning with Lightning Network standards.Steps to Test
Steps for reviewers to follow to test the change.
Pull Request Checklist
Testing
Code Style and Documentation
[skip ci]
in the commit message for small changes.📝 Please see our Contribution Guidelines for further guidance.