Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libplugin-pay: use map for channel hints (on top of #7494) #7648

Commits on Sep 6, 2024

  1. pay: Add a function to update channel_hints based on their age

    We relax constraints from the `channel_hint` through a linear refill.
    cdecker committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    5349f00 View commit details
    Browse the repository at this point in the history
  2. route: Add the total capacity to route_hops

    We need to know the overall channel capacity, i.e., the amount_msat
    that the channel was funded with, in order to relax the channel_hint
    to refill over time.
    cdecker committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    6975f56 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6f65862 View commit details
    Browse the repository at this point in the history
  4. pay: Make the channel_hints global

    We attach the hints to the plugin, so they get shared across multiple
    payments.
    cdecker committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    5ee2b96 View commit details
    Browse the repository at this point in the history
  5. make: Weaken over aggressive check-amount-access test

    Changelog-None
    cdecker committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    17aaf90 View commit details
    Browse the repository at this point in the history
  6. plugin: Split out the struct channel_hint handling

    We're getting serious about how we manage the channel_hints, so let's
    give them a proper home.
    cdecker committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    b265c13 View commit details
    Browse the repository at this point in the history
  7. pay: Rename overall_capacity to just capacity

    Suggested-by: Rusty Russell <@rustyrussell>
    cdecker committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    25d55a3 View commit details
    Browse the repository at this point in the history
  8. route: Simplify direction

    cdecker committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    9b1610f View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    9a2827e View commit details
    Browse the repository at this point in the history
  10. route: Use safe amount_sat_to_msat conversion

    Suggested-by: Rusty Russell <@rustyrussell>
    cdecker committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    124e215 View commit details
    Browse the repository at this point in the history
  11. route: Change the type of the funding capacity to amount_sat

    Keeping it in `amount_msat` made the comparisons easier, but it was
    the wrong type for this.
    cdecker committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    f4911a9 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    dbe9685 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    248113b View commit details
    Browse the repository at this point in the history
  14. pay: Add a hysteresis for channel_hint relaxation

    If we have a large channel, fail to send through a small amount, and
    then add a `channel_hint`, then it can happen that the call to
    `channel_hint_set_update` is already late enough that it refills the
    1msat we removed from the attempted amount, thus making the edge we
    just excluded eligible again, which can lead into an infinite loop.
    
    We slow down the updating of the channel_hints to once every
    hysteresis timeout. This allows us to set tight constraints, while not
    incurring in the accidental relaxation issue.
    cdecker committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    b102c04 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    2902283 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    8db5e8d View commit details
    Browse the repository at this point in the history
  17. pay: Inject channel_hints we receive via plugin notifications

    Making sure that we don't accidentally create an endless loop.
    cdecker committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    95b459f View commit details
    Browse the repository at this point in the history
  18. pay: Remove use of temporary local channel_hint

    We were using `channel_hint` to temporarily tweak the graph inside of
    a payment. However, these ad-hoc `channel_hints` are stickier than
    their predecessors, in that they outlive the payment attempt itself,
    and interfere with later ones.
    
    Changelog-Changed: pay: Discarding an overly long or expensive route does not blocklist channels anymore.
    cdecker committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    3b173e2 View commit details
    Browse the repository at this point in the history
  19. pytest: Remove the test_mutual_reconnect_race test

    I'm not sure how this ever worked, and it must've been racy: we
    initiate a number of payments, then proceed to disconnect and
    reconnect repeatedly. If a payment is attempted inbetween the
    `disconnect` and `connect` the payment will fail. Removing it since it
    most likely was just a sledgehammer test that we didn't know how to
    fine-tune.
    
    Changelog-None
    cdecker committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    485725f View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    9b876f5 View commit details
    Browse the repository at this point in the history
  21. pytest: Fix up the test_sendpay_grouping test

    It was failing because the channel_hint from one attempt would prevent
    us from retrying. By changing the amounts so that the channel_hints do
    not concern them (value smaller than estimate) we can make things work
    as before again.
    cdecker committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    772a505 View commit details
    Browse the repository at this point in the history
  22. pay: Simplify the channel_hint update logic

    We were ignoring more reliable information because of the
    stricter-is-better logic. This meant that we were also ignoring local
    channel information, despite knowing better.
    
    By simplifying the logic to pick the one with the newer timestamp we
    ensure that later observations always trump earlier ones. There is a
    bit of interplay between the relaxation of the constraints updating
    the timestamp, and comparing to real observation timestamps, but that
    should not impact us for local channels.
    cdecker committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    1e833ba View commit details
    Browse the repository at this point in the history

Commits on Sep 9, 2024

  1. libplugin-pay: use map for channel hints

    This commit fixes a "FIXME: This is slow" in the pay plugin. For
    nodes with many channels this is a tremendous improvement in pay
    performance. PR ElementsProject#7611 improves payment performance from 15 seconds to
    13.5 seconds on one of our nodes. This commit improves payment
    performance from 13.5 seconds to 5.7 seconds.
    
    Changelog-Fixed: Improved pathfinding speed for large nodes.
    JssDWt committed Sep 9, 2024
    Configuration menu
    Copy the full SHA
    aaff2f3 View commit details
    Browse the repository at this point in the history