Skip to content

Include funding amounts in channel announcements #102

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 2 commits into from
Jul 12, 2025

Conversation

TheBlueMatt
Copy link
Contributor

This is the server-side changeset for addressing
lightningdevkit/rust-lightning#1559

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Jul 11, 2025

I've assigned @jkczyz 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.

@ldk-reviews-bot ldk-reviews-bot requested a review from jkczyz July 11, 2025 20:55
let mut node_id_b_index = node_id_b_index as u64;
if version >= 2 {
// Set the "extra data" bit so that we can write the funding amount below.
node_id_b_index |= 1 << 63;
Copy link

Choose a reason for hiding this comment

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

Does the client reset this bit when looking up the node id?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -279,7 +280,19 @@ pub fn serialize_stripped_channel_announcement(announcement: &UnsignedChannelAnn

// write indices of node ids rather than the node IDs themselves
BigSize(node_id_a_index as u64).write(&mut stripped_announcement).unwrap();
BigSize(node_id_b_index as u64).write(&mut stripped_announcement).unwrap();

let mut node_id_b_index = node_id_b_index as u64;
Copy link

Choose a reason for hiding this comment

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

I take it we'll always use the second node index for indicating extra data follows?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@TheBlueMatt TheBlueMatt merged commit 05d5420 into lightningdevkit:main Jul 12, 2025
4 checks passed
TheBlueMatt added a commit to TheBlueMatt/rust-lightning that referenced this pull request Jul 12, 2025
Neither `channel_announcement`s nor `channel_update`s contain a
channel's actual funding amount, complicating scoring as nodes may
set an `htlc_maximum_msat` to something less than the funding
amount. When scoring, we use `htlc_maximum_msat` anyway if we don't
know the funding amount, but its not a perfect proxy.

In
lightningdevkit/rapid-gossip-sync-server#102
we started including a channel's real funding amount in RGS data,
and here we start parsing it and including it in our network graph.
TheBlueMatt added a commit to TheBlueMatt/rust-lightning that referenced this pull request Jul 12, 2025
Neither `channel_announcement`s nor `channel_update`s contain a
channel's actual funding amount, complicating scoring as nodes may
set an `htlc_maximum_msat` to something less than the funding
amount. When scoring, we use `htlc_maximum_msat` anyway if we don't
know the funding amount, but its not a perfect proxy.

In
lightningdevkit/rapid-gossip-sync-server#102
we started including a channel's real funding amount in RGS data,
and here we start parsing it and including it in our network graph.

Fixes lightningdevkit#1559
TheBlueMatt added a commit to TheBlueMatt/rust-lightning that referenced this pull request Jul 16, 2025
Neither `channel_announcement`s nor `channel_update`s contain a
channel's actual funding amount, complicating scoring as nodes may
set an `htlc_maximum_msat` to something less than the funding
amount. When scoring, we use `htlc_maximum_msat` anyway if we don't
know the funding amount, but its not a perfect proxy.

In
lightningdevkit/rapid-gossip-sync-server#102
we started including a channel's real funding amount in RGS data,
and here we start parsing it and including it in our network graph.

Fixes lightningdevkit#1559
TheBlueMatt added a commit to TheBlueMatt/rust-lightning that referenced this pull request Jul 17, 2025
Neither `channel_announcement`s nor `channel_update`s contain a
channel's actual funding amount, complicating scoring as nodes may
set an `htlc_maximum_msat` to something less than the funding
amount. When scoring, we use `htlc_maximum_msat` anyway if we don't
know the funding amount, but its not a perfect proxy.

In
lightningdevkit/rapid-gossip-sync-server#102
we started including a channel's real funding amount in RGS data,
and here we start parsing it and including it in our network graph.

Fixes lightningdevkit#1559
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.

3 participants