routing: add custom sender-sider bandwidth hint selection as a top level config option #8617
Labels
advanced
Issues suitable for very experienced developers
config
Parameters/arguments/config file related issues/PRs
enhancement
Improvements to existing features / behaviour
refactoring
routing
For certain custom channel types, we'll wan to extend the default${X, Y, Z}$ may have enough bandwidth to satisfy a payment of amount $M$ , we may actually want to take channel $A$ instead, as $F(htlc, A) == true$ .
bandwidthHints
that the router uses to introspect into the local balance of a channel to make decisions w.r.t which channel should be selected as an outgoing edge. As an example, given a TLV blob contained in anupdate_add_htlc
message, and a custom blob that may be stored along side anOpenChannel/ChannleCommitment
struct, even though channelsIn this case, we want the creator of a new lnd process in an existing go program to be able to provide the function$F$ to us.
When we decide to make a payment, we'll make the following series of calls:
getOutgoingBalance
to see if any of our local channels can even carry the payment: https://github.com/lightningnetwork/lnd/blob/master/routing/pathfind.go#L602getBalance
to see if the link can actually forward, and if so, return the active balance: https://github.com/lightningnetwork/lnd/blob/master/routing/bandwidth.go#L10-L22getBandwidth
to optionally be aware of the TLV blob of a given HTLC. Then, we'll want to just return zero (similar to if!link.EligibleToForward()
), if our functiongetEdgeLocal
:lnd/routing/unified_edges.go
Line 215 in b117551
fn.Option
), but returns false.Here's an interface sketch that may be useful:
The
htlcTLV
will just be what's present in theupdate_add_htlc
, tho we'll also need a way to pass in a custom instance as path finding hasn't completed yet.channelBlob
will be available based on the channels in the link.The text was updated successfully, but these errors were encountered: