lnd/routing
bitromortac d78e756406
routing: add probability benchmarks
$ go test -bench=PairProbability ./routing
goos: linux
goarch: amd64
pkg: github.com/lightningnetwork/lnd/routing
cpu: AMD Ryzen 5 3600 6-Core Processor
BenchmarkBimodalPairProbability-4   	 2050206	       599.8 ns/op
BenchmarkAprioriPairProbability-4   	 9524289	       126.7 ns/op

* math.Exp:
goos: linux
goarch: amd64
pkg: github.com/lightningnetwork/lnd/routing
cpu: AMD Ryzen 5 3600 6-Core Processor
BenchmarkExp-4   	143843622	         8.700 ns/op

* bimodal benchmark profile:
Showing nodes accounting for 2000ms, 76.05% of 2630ms total
Dropped 156 nodes (cum <= 13.15ms)
Showing top 10 nodes out of 141
      flat  flat%   sum%        cum   cum%
    1110ms 42.21% 42.21%     1110ms 42.21%  math.archExp
     230ms  8.75% 50.95%      230ms  8.75%  runtime.memclrNoHeapPointers
     180ms  6.84% 57.79%      930ms 35.36%  github.com/lightningnetwork/lnd/routing.(*BimodalEstimator).calculateProbability
     110ms  4.18% 61.98%      130ms  4.94%  runtime.scanobject
      90ms  3.42% 65.40%       90ms  3.42%  memeqbody
      60ms  2.28% 67.68%      940ms 35.74%  github.com/lightningnetwork/lnd/routing.(*BimodalEstimator).directProbability
      60ms  2.28% 69.96%      230ms  8.75%  github.com/lightningnetwork/lnd/routing.cannotSend
      60ms  2.28% 72.24%       60ms  2.28%  runtime.madvise
      50ms  1.90% 74.14%      480ms 18.25%  github.com/lightningnetwork/lnd/routing.(*BimodalEstimator).primitive
      50ms  1.90% 76.05%       60ms  2.28%  runtime.mapiternext

* apriori benchmark profile:
Showing nodes accounting for 1570ms, 77.34% of 2030ms total
Dropped 138 nodes (cum <= 10.15ms)
Showing top 10 nodes out of 151
      flat  flat%   sum%        cum   cum%
     340ms 16.75% 16.75%      340ms 16.75%  math.archExp
     290ms 14.29% 31.03%      980ms 48.28%  github.com/lightningnetwork/lnd/routing.(*AprioriEstimator).getNodeProbability
     190ms  9.36% 40.39%      260ms 12.81%  runtime.mapiternext
     190ms  9.36% 49.75%      190ms  9.36%  runtime.memclrNoHeapPointers
     160ms  7.88% 57.64%      340ms 16.75%  github.com/lightningnetwork/lnd/routing.(*AprioriEstimator).calculateProbability
     110ms  5.42% 63.05%      110ms  5.42%  aeshashbody
     110ms  5.42% 68.47%      130ms  6.40%  runtime.scanobject
      80ms  3.94% 72.41%      420ms 20.69%  github.com/lightningnetwork/lnd/routing.capacityFactor
      60ms  2.96% 75.37%       60ms  2.96%  runtime.madvise
      40ms  1.97% 77.34%       40ms  1.97%  runtime.isEmpty (inline)
2023-02-14 13:34:25 +01:00
..
chainview routing: use T.TempDir to create temporary test directory 2022-08-24 09:03:05 +08: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 routing: add more verbose logs 2023-01-17 07:26:57 +08:00
control_tower_test.go routing: rename Fail to FailPayment 2022-12-07 18:38:01 +08:00
control_tower.go routing: rename Fail to FailPayment 2022-12-07 18:38:01 +08:00
errors.go multi: Fix typos [skip ci] 2022-01-24 12:19:02 +02:00
graph.go routing+routerrpc: add capacity in rpcs 2022-12-12 13:22:29 +01:00
heap_test.go routing: optimize path finding structures 2019-10-24 21:38:07 -03:00
heap.go multi: use minimal policy in cache 2021-09-29 17:00:04 +02:00
integrated_routing_context_test.go lnd+routing+rpc: switch mc to (external) estimator 2023-02-14 13:34:25 +01:00
integrated_routing_test.go lnd+routing+rpc: switch mc to (external) estimator 2023-02-14 13:34:25 +01:00
log.go routing: define subsystem constant 2019-12-11 00:17:04 +01:00
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: use T.TempDir to create temporary test directory 2022-08-24 09:03:05 +08:00
missioncontrol_store.go lnwire: allow longer failure messages 2022-12-02 14:27:59 +01:00
missioncontrol_test.go lnd+routing+rpc: switch mc to (external) estimator 2023-02-14 13:34:25 +01:00
missioncontrol.go lnd+routing+rpc: switch mc to (external) estimator 2023-02-14 13:34:25 +01:00
mock_graph_test.go routing+routerrpc: add capacity in rpcs 2022-12-12 13:22:29 +01:00
mock_test.go routing: use capacity in pathfinding 2022-12-12 13:22:28 +01:00
nodepair.go routing: extended DirectedNodePair functionality 2019-08-13 18:45:06 +02:00
notifications_test.go routing: replace defer cleanup with t.Cleanup 2022-10-13 17:47:04 +08:00
notifications.go routing: remove the mutex and use SyncMap instead 2023-01-19 07:08:18 +08:00
pathfind_test.go routing+routerrpc: add capacity in rpcs 2022-12-12 13:22:29 +01:00
pathfind.go lnd+routerrpc: configure server with new estimator 2023-02-14 13:34:25 +01:00
payment_lifecycle_test.go routing: fix race condition in TestUpdatePaymentState 2023-01-17 14:26:37 -08:00
payment_lifecycle.go routing: stop tracking totalAmount in paymentLifecycle 2022-12-07 18:38:01 +08:00
payment_session_source.go routing+routerrpc: add capacity in rpcs 2022-12-12 13:22:29 +01:00
payment_session_test.go router: return probability from findPath 2022-12-12 13:22:29 +01:00
payment_session.go router: return probability from findPath 2022-12-12 13:22:29 +01:00
probability_apriori_test.go routing: implement bimodal probability estimator 2023-02-14 13:34:25 +01:00
probability_apriori.go routing: add probability estimator interface 2023-02-10 09:58:40 +01:00
probability_bimodal_test.go routing: implement bimodal probability estimator 2023-02-14 13:34:25 +01:00
probability_bimodal.go routing: implement bimodal probability estimator 2023-02-14 13:34:25 +01:00
probability_estimator_test.go routing: add probability benchmarks 2023-02-14 13:34:25 +01:00
probability_estimator.go routing: add probability estimator interface 2023-02-10 09:58:40 +01:00
README.md scripted-diff: replace ⛰ emoji with $ [skip ci] 2022-10-28 12:06:49 -04: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 lnd+routing+rpc: switch mc to (external) estimator 2023-02-14 13:34:25 +01:00
router.go routing: remove the mutex and use SyncMap instead 2023-01-19 07:08:18 +08:00
setup_test.go channeldb/test: test with postgres 2021-10-29 10:54:44 +02:00
stats.go routing/router: log aggregate graph processing stats 2019-06-13 18:18:30 -07:00
unified_edges_test.go routing: implement capacity in getEdge 2022-12-12 13:22:28 +01:00
unified_edges.go routing: implement capacity in getEdge 2022-12-12 13:22:28 +01:00
validation_barrier_test.go routing+discovery: uniform error codes in routing 2022-01-05 04:27:33 +08:00
validation_barrier.go routing: refactor WaitForDependants to allow detailed logging 2022-12-08 17:57:01 +08: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