mirror of
https://github.com/lightningnetwork/lnd.git
synced 2026-08-18 13:07:58 +02:00
In this commit, we turn the attempt loop into a state machine and put a deterministic event loop in front of it, so that the sender can have several of its own payments in the air at once. The loop is NOT goroutines, and the reasons are concrete. SimGraph has no locking on balances or on the holds map. The traffic rng is a single stream whose draw order IS the exogenous process. The attribution degrader consumes a fixed number of draws per attempt precisely so that two routers face the same sequence. Real parallelism would destroy all three, and with them the reproducibility every sealed tier depends on. So each live payment carries a next-event timestamp, and the scheduler picks the earliest, breaking ties by scenario index, advances the clock to it, runs the background traffic owed for the interval, and executes exactly one step: one RequestRoute, or one dispatch and one ReportAttempt. A payment splits between those two because the window between choosing a route and hearing what happened to it is the only window two of the sender's payments can share. One payment is a batch of one on the same loop, so the sequential behavior the concurrent path has to reproduce is the behavior it actually reproduces rather than a second implementation of it. The gap between payments is measured from the moment the slot freed, which is what makes max_in_flight one identical to the loop it replaces: 256 paired whole-output runs across the sealed hard, ood and corpus-mix tiers and regenerated default, hard, drift, split and atomic corpora, both arms, zero diffs, plus 132 mainnet runs compared as aggregate sets because of stage B's finding 4. Two things follow from running the traffic per interval rather than per payment, and both are deliberate. A concurrent batch clears in less virtual time and therefore churns the network for less of it. And the whole window fills at once, since every slot is free when the batch starts, so the first max_in_flight payments plan against the same balances. SimBalanceRefresher is the optional half of the contract: a router that wants to be told its own outbound liquidity moved under it can be, and router_accepts_balance_refresh says who asked. No router in this program does, which is exp-016's lesson applied before the fact rather than after it. self_contention_failures is the number the stage exists to produce, and it is causal rather than coincidental. The runner reads the failing edge's true balance and reservation at the moment of the failure and asks whether the edge would have carried the amount with the siblings' share removed. Without atomic mpp nothing reserves anything, so the counter is structurally zero and that tier is the free control. |
||
|---|---|---|
| .. | ||
| blindedpath | ||
| chainview | ||
| localchans | ||
| route | ||
| shards | ||
| testdata | ||
| additional_edge.go | ||
| additional_edge_test.go | ||
| bandwidth.go | ||
| bandwidth_test.go | ||
| blinding.go | ||
| blinding_test.go | ||
| control_tower.go | ||
| control_tower_test.go | ||
| graph.go | ||
| heap.go | ||
| heap_test.go | ||
| integrated_routing_context_test.go | ||
| integrated_routing_test.go | ||
| log.go | ||
| missioncontrol.go | ||
| missioncontrol_state.go | ||
| missioncontrol_state_test.go | ||
| missioncontrol_store.go | ||
| missioncontrol_store_test.go | ||
| missioncontrol_test.go | ||
| mock_graph_test.go | ||
| mock_test.go | ||
| nodepair.go | ||
| patch_config.go | ||
| patch_config_test.go | ||
| pathfind.go | ||
| pathfind_test.go | ||
| payment_lifecycle.go | ||
| payment_lifecycle_test.go | ||
| payment_session.go | ||
| payment_session_source.go | ||
| payment_session_test.go | ||
| probability_apriori.go | ||
| probability_apriori_test.go | ||
| probability_bimodal.go | ||
| probability_bimodal_test.go | ||
| probability_estimator.go | ||
| probability_estimator_test.go | ||
| README.md | ||
| result_interpretation.go | ||
| result_interpretation_test.go | ||
| router.go | ||
| router_test.go | ||
| setup_test.go | ||
| sim_atomic_test.go | ||
| sim_attribution.go | ||
| sim_attribution_test.go | ||
| sim_concurrency.go | ||
| sim_concurrency_test.go | ||
| sim_corridors_test.go | ||
| sim_fee_limit.go | ||
| sim_fee_limit_test.go | ||
| sim_graph.go | ||
| sim_htlc_limits.go | ||
| sim_htlc_limits_test.go | ||
| sim_inbound_fees.go | ||
| sim_inbound_fees_test.go | ||
| sim_liquidity.go | ||
| sim_liquidity_test.go | ||
| sim_load.go | ||
| sim_load_test.go | ||
| sim_policy_test.go | ||
| sim_router.go | ||
| sim_run.go | ||
| sim_test.go | ||
| sim_topology.go | ||
| sim_traffic.go | ||
| sim_traffic_test.go | ||
| sim_warmup_test.go | ||
| sim_weights.go | ||
| sim_weights_test.go | ||
| unified_edges.go | ||
| unified_edges_test.go | ||
routing
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