lnd/routing
eugene 1aa9626606
server+funding: allow scid-alias, zero-conf chantypes, scid-alias
feature-bit channels

This allows opening zero-conf chan-type, scid-alias chan-type, and
scid-alias feature-bit channels. scid-alias chan-type channels are
required to be private. Two paths are available for opening a zero-conf
channel:

* explicit chan-type negotiation
* LDK carve-out where chan-types are not used, LND is on the
  receiving end, and a ChannelAcceptor is used to enable zero-conf

When a zero-conf channel is negotiated, the funding manager:
* sends a FundingLocked with an alias
* waits for a FundingLocked from the remote peer
* calls addToRouterGraph to persist the channel using our alias in
  the graph. The peer's alias is used to send them a ChannelUpdate.
* wait for six confirmations. If public, the alias edge in the
  graph is deleted and replaced (not atomically) with the confirmed
  edge. Our policy is also read-and-replaced, but the counterparty's
  policy won't exist until they send it to us.

When a scid-alias-feature channel is negotiated, the funding manager:
* sends a FundingLocked with an alias:
* calls addToRouterGraph, sends ChannelUpdate with the confirmed SCID
  since it exists.
* when six confirmations occurs, the edge is deleted and re-inserted
  since the peer may have sent us an alias ChannelUpdate that we are
  storing in the graph.

Since it is possible for a user to toggle the scid-alias-feature-bit
to on while channels exist in the funding manager, care has been taken
to ensure that an alias is ALWAYS sent in the funding_locked message
if this happens.
2022-07-07 17:10:28 -04:00
..
chainview multi: move many t.Fatalf calls to require.NoError 2022-06-17 04:26:55 +00:00
localchans multi: use btcd's btcec/v2 and btcutil modules 2022-03-09 19:02:37 +01:00
route routing+channeldb: send payment metadata from invoice 2022-04-13 22:55:40 +02:00
shards multi: Fix typos [skip ci] 2022-01-24 12:19:02 +02:00
testdata routing: add private key attribute in router test 2021-06-23 18:13:02 +08:00
ann_validation.go multi: use btcd's btcec/v2 and btcutil modules 2022-03-09 19:02:37 +01:00
bandwidth_test.go multi: use btcd's btcec/v2 and btcutil modules 2022-03-09 19:02:37 +01:00
bandwidth.go multi: formatting and comment fixes 2022-02-10 11:02:02 +01:00
control_tower_test.go multi: add keep-failed-payment-attempts flag 2022-07-03 21:04:27 +00:00
control_tower.go channeldb+routing: htlcs are pruned on settle 2022-07-03 21:04:34 +00:00
errors.go multi: Fix typos [skip ci] 2022-01-24 12:19:02 +02:00
graph.go multi: use single read transaction for path finding 2021-10-22 09:32:49 +02:00
heap_test.go
heap.go multi: use minimal policy in cache 2021-09-29 17:00:04 +02:00
integrated_routing_context_test.go multi: use single read transaction for path finding 2021-10-22 09:32:49 +02:00
integrated_routing_test.go multi: move many t.Fatalf calls to require.NoError 2022-06-17 04:26:55 +00:00
log.go
missioncontrol_state_test.go multi: formatting and comment fixes 2022-02-10 11:02:02 +01:00
missioncontrol_state.go multi: Fix typos [skip ci] 2022-01-24 12:19:02 +02:00
missioncontrol_store_test.go routing: store missioncontrol state in blocks and eliminate cursor use 2021-07-26 17:02:11 +02:00
missioncontrol_store.go routing: fix memory corruption in MC store 2021-12-08 23:10:16 +01:00
missioncontrol_test.go routing: store missioncontrol state in blocks and eliminate cursor use 2021-07-26 17:02:11 +02:00
missioncontrol.go multi: Fix typos [skip ci] 2022-01-24 12:19:02 +02:00
mock_graph_test.go multi: use btcd's btcec/v2 and btcutil modules 2022-03-09 19:02:37 +01:00
mock_test.go channeldb+routing: htlcs are pruned on settle 2022-07-03 21:04:34 +00:00
nodepair.go
notifications_test.go multi: move many t.Fatalf calls to require.NoError 2022-06-17 04:26:55 +00:00
notifications.go multi: use btcd's btcec/v2 and btcutil modules 2022-03-09 19:02:37 +01:00
pathfind_test.go multi: move many t.Fatalf calls to require.NoError 2022-06-17 04:26:55 +00:00
pathfind.go routing+channeldb: send payment metadata from invoice 2022-04-13 22:55:40 +02:00
payment_lifecycle_test.go server+routing: pass isAlias to router 2022-07-07 17:10:28 -04:00
payment_lifecycle.go routing: fix formatting 2022-07-06 13:33:02 +02:00
payment_session_source.go multi: use btcd's btcec/v2 and btcutil modules 2022-03-09 19:02:37 +01:00
payment_session_test.go routing: add time_pref parameter to queryroutes and sendpayment 2022-04-13 20:26:46 +02:00
payment_session.go routing+channeldb: send payment metadata from invoice 2022-04-13 22:55:40 +02:00
probability_estimator_test.go multi: formatting and comment fixes 2022-02-10 11:02:02 +01:00
probability_estimator.go multi: formatting and comment fixes 2022-02-10 11:02:02 +01:00
README.md multi: unify code blocks in READMEs 2021-01-22 09:14:11 +01:00
result_interpretation_test.go multi: run gosimports 2022-02-10 11:02:01 +01:00
result_interpretation.go multi: Fix typos [skip ci] 2022-01-24 12:19:02 +02:00
router_test.go server+routing: pass isAlias to router 2022-07-07 17:10:28 -04:00
router.go server+funding: allow scid-alias, zero-conf chantypes, scid-alias 2022-07-07 17:10:28 -04:00
setup_test.go channeldb/test: test with postgres 2021-10-29 10:54:44 +02:00
stats.go
unified_policies_test.go multi: move bandwidth hints behind interface 2021-10-19 09:50:49 +02:00
unified_policies.go multi: use btcd's btcec/v2 and btcutil modules 2022-03-09 19:02:37 +01:00
validation_barrier_test.go routing+discovery: uniform error codes in routing 2022-01-05 04:27:33 +08:00
validation_barrier.go multi: Fix typos [skip ci] 2022-01-24 12:19:02 +02:00

routing

Build Status MIT licensed GoDoc

The routing package implements authentication+validation of channel announcements, pruning of the channel graph, path finding within the network, sending outgoing payments into the network and synchronizing new peers to our channel graph state.

Installation and Updating

⛰  go get -u github.com/lightningnetwork/lnd/routing