Skip to content
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

Use remote fee policy when constructing route hints #1000

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

dangeross
Copy link
Collaborator

Fixes #999

Copy link
Contributor

@JssDWt JssDWt left a comment

Choose a reason for hiding this comment

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

One comment. I like that listchannels call where the local node is the destination. Smart.

Comment on lines 1730 to 1732
fees_base_msat: fees_base_msat.unwrap_or(peer_fee_base_msat),
fees_proportional_millionths: fees_proportional_millionths
.unwrap_or(peer_fees_proportional_millionths),
Copy link
Contributor

Choose a reason for hiding this comment

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

If the remote fee policy cannot be found, we should not include the route hint in the response. It should never make sense to include the local channel policy in a route hint.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok, I changed it so that it only adds route hints where the source channel is found

Copy link
Member

@roeierez roeierez left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@JssDWt JssDWt left a comment

Choose a reason for hiding this comment

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

I think this should be OK.

Thinking about it, I think there's still the possibility I suppose that there is an open channel with the LSP, but no route hint will be added, because we don't have the remote channel policy of the lsp.

So in the case:

  • no route hint in the invoice
  • no remote channel policy
  • with active channel

There will not be an LSP hint added.

@dangeross
Copy link
Collaborator Author

Thinking about it, I think there's still the possibility I suppose that there is an open channel with the LSP, but no route hint will be added, because we don't have the remote channel policy of the lsp.

Would it make sense then to pass in the lsp_info to get_route_hints() and always override the lsp peer remote fees with the ones in the lsp_info? What do you think @roeierez?

@roeierez
Copy link
Member

Thinking about it, I think there's still the possibility I suppose that there is an open channel with the LSP, but no route hint will be added, because we don't have the remote channel policy of the lsp.

Would it make sense then to pass in the lsp_info to get_route_hints() and always override the lsp peer remote fees with the ones in the lsp_info? What do you think @roeierez?

Yes but not always. I think only in case you don't find a channel policy because the policy might change after the channel was opened and if it exists then it is the correct one.

Copy link
Member

@roeierez roeierez left a comment

Choose a reason for hiding this comment

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

LGTM

@dangeross dangeross merged commit 6188f46 into main Jun 11, 2024
7 checks passed
@dangeross dangeross deleted the savage-remote-fee-policy branch June 11, 2024 09:21
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.

Route hints may contain local fees instead of remote
3 participants