feat: Add external pathfinding scores support for LDK Node#3992
feat: Add external pathfinding scores support for LDK Node#3992kaloudis merged 3 commits intoZeusLN:masterfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces functionality to configure a pathfinding scores source (scorer URL) for the LDK Node. This involves adding scorerUrl parameters and methods across Android (LdkNodeModule.kt), iOS (LdkNodeModule.swift), and TypeScript interfaces (LdkNode.d.ts, LdkNodeInjection.ts). The SettingsStore.ts and various UI components (SeedRecovery.tsx, WalletConfiguration.tsx, Wallet.tsx) are updated to manage and apply this new setting. Feedback highlights the need for consistent promise resolution in the iOS module (resolving with nil for void operations) and a logical correction in Wallet.tsx to correctly interpret an empty ldkScorerUrl as disabling the feature, rather than falling back to a default URL.

Description
Summary
Wires up ldk-node's
setPathfindingScoresSource(url)builder method through the React Native bridge, allowing Zeus LDK nodes to periodically download and merge pathfinding scorer data from an external server. This gives mobile nodes access to liquidity intelligence they could never build on their own, significantly improving payment success rates.Problem
LDK mobile nodes have poor pathfinding compared to LND for several structural reasons:
Solution
ldk-node (v0.5.0+) supports external pathfinding score sources via
Builder::set_pathfinding_scores_source(url). When configured:ChannelLiquiditiesdata, and merges it with the local scorer(external + local) / 2. External-only channels are inserted as-is. Local-only channels are untouched.Zeus operates a dedicated LDK scoring node that actively probes the Lightning network and exports its scorer data. Zeus mobile clients consume this data to get realistic liquidity priors from their first payment.
Changes
Native bridges
LdkNodeModule.kt(Android): AddedsetPathfindingScoresSourceReact Native method,storedScorerUrlproperty, andapplyBuilderSettingsintegrationLdkNodeModule.swift(iOS): Same pattern —@objcbridge method, stored property, builder settingsTypeScript layer
LdkNodeInjection.ts: AddedsetPathfindingScoresSourcewrapper, interface declaration, export,initializeNodeparameter, and conditional call during node initializationLdkNode.d.ts: Type declaration for the native module methodSettings
SettingsStore.ts: AddedldkScorerUrlfield to node config interface, observable property, load/clear lifecycleInitialization flow
LdkNodeUtils.ts: AddedDEFAULT_SCORER_URLconstant (https://scores.zeusln.com/latest.bin), threadedscorerUrlparameter throughinitNode,createLdkNodeWallet, andstartLdkNodeWalletCall sites
Wallet.tsx: PassesldkScorerUrl || DEFAULT_SCORER_URLduring node startupSeedRecovery.tsx: PassesDEFAULT_SCORER_URLduring wallet recoveryWalletConfiguration.tsx: PassesDEFAULT_SCORER_URLduring wallet creationArchitecture
Configuration
https://scores.zeusln.com/latest.binldkScorerUrlin node settings (same pattern as custom RGS/Esplora servers)ldkScorerUrlto empty/undefined skips the scorer source configurationDependencies
set_pathfinding_scores_sourceon the builder (available in the uniffi bindings since v0.5.0, present in Zeus's current ldk-node native libraries)Testing
ldkScorerUrloverride worksPR Type
This pull request is categorized as a:
Checklist
yarn run tscand made sure my code compiles correctlyyarn run lintand made sure my code didn’t contain any problematic patternsyarn run prettierand made sure my code is formatted correctlyyarn run testand made sure all of the tests passTesting
If you modified or added a utility file, did you add new unit tests?
I have tested this PR on the following platforms (please specify OS version and phone model/VM):
I have tested this PR with the following types of nodes (please specify node version and API version where appropriate):
On-device
Remote
Locales
Third Party Dependencies and Packages
yarnafter this PR is merged inpackage.jsonandyarn.lockhave been properly updatedOther: