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

Correct MIN_FINAL_CLTV_EXPIRY to match our enforced requirements #911

Merged
merged 3 commits into from May 6, 2021

Commits on May 5, 2021

  1. Increase the CLTV delay required on payments and forwards

    This increases the CLTV_CLAIM_BUFFER constant to 18, much better
    capturing how long it takes to go on chain to claim payments.
    This is also more in line with other clients, and the spec, which
    sets the default CLTV delay in invoices to 18.
    
    As a side effect, we have to increase MIN_CLTV_EXPIRY_DELTA as
    otherwise as are subject to an attack where someone can hold an
    HTLC being forwarded long enough that we *also* close the channel
    on which we received the HTLC.
    TheBlueMatt committed May 5, 2021
    Copy the full SHA
    e84f5ed View commit details
    Browse the repository at this point in the history
  2. Correct MIN_FINAL_CLTV_EXPIRY to match our enforced requirements

    Our enforced requirements for HTLC acceptance is that we have at
    least HTLC_FAIL_BACK_BUFFER blocks before the HTLC expires. When we
    receive an HTLC, the HTLC would be "already expired" if its
    `cltv_expiry` is current-block + 1 (ie the next block could
    broadcast the commitment transaction and time out the HTLC). From
    there, we want an extra HTLC_FAIL_BACK_BUFFER in blocks, plus an
    extra block or two to account for any differences in the view of
    the current height before send or while the HTLC is transiting the
    network.
    TheBlueMatt committed May 5, 2021
    Copy the full SHA
    68c2c44 View commit details
    Browse the repository at this point in the history

Commits on May 6, 2021

  1. Copy the full SHA
    0ba727a View commit details
    Browse the repository at this point in the history