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

lnwallet+htlcswitch: make Switch dust-aware #5770

Merged
merged 6 commits into from
Oct 1, 2021

Commits on Sep 30, 2021

  1. lnwallet: introduce GetDustSum method to calculate worst-case dust sum

    It over-estimates the local or remote commitment's dust sum by
    counting all updates in both updateLogs that are dust using the
    trimmed-to-dust mechanism if applicable. The over-estimation is done
    because ensuring an accurate counting is a trade-off between code
    simplicity and accuracy.
    Crypt-iQ committed Sep 30, 2021
    Configuration menu
    Copy the full SHA
    7d16e58 View commit details
    Browse the repository at this point in the history
  2. htlcswitch: extend Mailbox iface with dust, fee methods

    This commit extends the Mailbox interface with the SetDustClosure,
    SetFeeRate, and DustPackets methods. This enables the mailbox to
    report the dust exposure to the Switch when the Switch decides whether
    to forward a dust packet. The dust is counted from the time an Add is
    introduced via AddPacket until it is removed via AckPacket. This can
    lead to some packets being counted twice before they are signed for,
    but this is a trade-off between accuracy and simplicity.
    Crypt-iQ committed Sep 30, 2021
    Configuration menu
    Copy the full SHA
    0b24603 View commit details
    Browse the repository at this point in the history
  3. htlcswitch: extend ChannelLink iface with dustHandler iface

    This allows the Switch to determine the dust exposure of a certain
    channel and allows the link to set the feerate of the mailbox given
    a fee update.
    Crypt-iQ committed Sep 30, 2021
    Configuration menu
    Copy the full SHA
    0ce6194 View commit details
    Browse the repository at this point in the history
  4. htlcswitch: call evaluateDustThreshold in SendHTLC, handlePacketForward

    This commit makes SendHTLC (we are the source) evaluate the dust
    threshold of the outgoing channel against the default threshold of
    500K satoshis. If the threshold is exceeded by adding this HTLC, we
    fail backwards. It also makes handlePacketForward (we are forwarding)
    evaluate the dust threshold of the incoming channel and the outgoing
    channel and fails backwards if either channel's dust sum exceeds the
    default threshold.
    Crypt-iQ committed Sep 30, 2021
    Configuration menu
    Copy the full SHA
    3897baf View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    702b3a3 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    25a0fe2 View commit details
    Browse the repository at this point in the history