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

ZEUS-2688: Receive: auto-enable route hints #2716

Merged
merged 3 commits into from
Jan 9, 2025

Conversation

kaloudis
Copy link
Contributor

@kaloudis kaloudis commented Jan 8, 2025

Description

Relates to issue: ZEUS-2688

This pull request is categorized as a:

  • New feature
  • Bug fix
  • Code refactor
  • Configuration change
  • Locales update
  • Quality assurance
  • Other

Checklist

  • I’ve run yarn run tsc and made sure my code compiles correctly
  • I’ve run yarn run lint and made sure my code didn’t contain any problematic patterns
  • I’ve run yarn run prettier and made sure my code is formatted correctly
  • I’ve run yarn run test and made sure all of the tests pass

Testing

If you modified or added a utility file, did you add new unit tests?

  • No, I’m a fool
  • Yes
  • x ] N/A

I have tested this PR on the following platforms (please specify OS version and phone model/VM):

  • Android
  • iOS

I have tested this PR with the following types of nodes (please specify node version and API version where appropriate):

  • Embedded LND
  • LND (REST)
  • LND (Lightning Node Connect)
  • Core Lightning (CLNRest)
  • LndHub
  • [DEPRECATED] Core Lightning (c-lightning-REST)
  • [DEPRECATED] Core Lightning (Spark)
  • [DEPRECATED] Eclair

Locales

  • I’ve added new locale text that requires translations
  • I’m aware that new translations should be made on the ZEUS Transfix page and not directly to this repo

Third Party Dependencies and Packages

  • Contributors will need to run yarn after this PR is merged in
  • 3rd party dependencies have been modified:
    • verify that package.json and yarn.lock have been properly updated
    • verify that dependencies are installed for both iOS and Android platforms

Other:

  • Changes were made that require an update to the README
  • Changes were made that require an update to onboarding

@kaloudis kaloudis added this to the v0.9.5 milestone Jan 8, 2025
for (const channel of channels) {
if (!channel.private && channel.isActive) {
haveAnnouncedChannels = true;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

we can break early when 1 announced channel was found

Copy link
Contributor

Choose a reason for hiding this comment

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

better use break; after haveAnnouncedChannels = true;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

better use break; after haveAnnouncedChannels = true;

there are other enhancements occurring in this loop

Copy link
Contributor

Choose a reason for hiding this comment

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

ah of course

@myxmaster
Copy link
Contributor

I think we should also enable "Include route hints" in Invoices settings in case there are no announced channels.

If later an announced channel is opened, the setting can stay enabled imo.

@kaloudis
Copy link
Contributor Author

kaloudis commented Jan 8, 2025

I think we should also enable "Include route hints" in Invoices settings in case there are no announced channels.

If later an announced channel is opened, the setting can stay enabled imo.

this already exists

@myxmaster
Copy link
Contributor

this already exists

I was thinking about global settings, because it might be confusing to see that option being disabled but Zeus still enabling it when actually creating an invoice...
But now I'm not sure... With your approach, when user opens an announced channel later, then it will fall back to not include route hints by default, which might be better for privacy.

@myxmaster
Copy link
Contributor

Ah I think we can stick with your approach and simply modify views.Receive.routeHintSwitchExplainer2.

Before:
It's helpful to toggle route hints on if you're using only unannounced channels, or if someone trying to pay you cannot reach you via your announced channels.

After:
Route hints are automatically enabled when you only have unannounced channels, ensuring payments can reach your node.

Copy link
Contributor

@myxmaster myxmaster left a comment

Choose a reason for hiding this comment

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

tested, lgtm

@kaloudis kaloudis merged commit 2ccf02a into ZeusLN:master Jan 9, 2025
4 checks passed
@kaloudis kaloudis deleted the zeus-2688 branch January 9, 2025 15:25
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.

Automatically enable "Include route hints" if only unannounced channels exist
2 participants