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

Dyncomms [3/n]: Add channel epoch history tracker to handle breach scenarios #9158

Draft
wants to merge 28 commits into
base: master
Choose a base branch
from

Commits on Oct 14, 2024

  1. htlcswitch: define state machine for quiescence

    htlcswitch: add drive method to quiescer
    ProofOfKeags committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    f3230a4 View commit details
    Browse the repository at this point in the history
  2. htlcswitch: implement stfu response

    htlcswitch: use quiescer drive method in link stfu implementation
    
    This commit amends the implementation presented in the last one
    by taking advantage of the quiescer drive method. This allows us
    to centralize quiescence logic better rather than diffusing it
    throughout the link. h/t @carlaKC
    ProofOfKeags committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    9c4c65a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    52ad0ab View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2beb8eb View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    a3607ea View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    d8a11b1 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    b930ec7 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    998d39b View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    7fc6c2f View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    c097d20 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    66ecd42 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    d20381b View commit details
    Browse the repository at this point in the history
  13. htlcswitch: defer processRemoteAdds when quiescent

    In this commit we defer processRemoteAdds using a new mechanism on
    the quiescer where we capture a closure that needs to be run. We
    do this because we need to avoid the scenario where we send back
    immediate resolutions to the newly added HTLCs when quiescent as
    it is a protocol violation. It is not enough for us to simply defer
    sending the messages since the purpose of quiescence itself is to
    have well-defined and agreed upon channel state. If, for whatever
    reason, the node (or connection) is restarted between when these
    hooks are captured and when they are ultimately run, they will
    be resolved by the resolveFwdPkgs logic when the link comes back
    up.
    
    In a future commit we will explicitly call the quiescer's resume
    method when it is OK for htlc traffic to commence.
    ProofOfKeags committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    e63e310 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    cb867aa View commit details
    Browse the repository at this point in the history
  15. htlcswitch: implement noop quiescer

    In this commit we implement a noop quiescer that we will use when
    the feature hasn't been negotiated. This will make it far easier to
    manage quiescence operations without having a number of if statements
    in the link logic.
    ProofOfKeags committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    42315d9 View commit details
    Browse the repository at this point in the history
  16. htlcswitch+peer: allow the disabling of quiescence

    Here we add a flag where we can disable quiescence. This will be used
    in the case where the feature is not negotiated with our peer.
    ProofOfKeags committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    68ef311 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    a98b790 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    a269a83 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    f89f44d View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    58eb9c9 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    e072626 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    dd55c6e View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    56a34cb View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    30dbe64 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    8d34873 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    5d4020f View commit details
    Browse the repository at this point in the history
  27. channeldb+lnwallet: add epoch history to OpenChannel

    This commit takes the CommitChainEpochHistory defined in the last
    commit and adds it to the OpenChannel structure. As of this commit
    it is essentially redundant with the ChanCfgs but it will capture
    the history of the ChanCfgs when we add the ability to update them.
    ProofOfKeags committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    dc3aef4 View commit details
    Browse the repository at this point in the history
  28. lnwallet: use CommitChainEpochHistory to determine CsvDelay during Br…

    …each
    
    This commit changes the way we create breach retributions to use the
    CsvDelay we compute from the CommitChainEpochHistory so as to account
    for the possibility that the channel parameters have changed since
    opening.
    ProofOfKeags committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    6678f08 View commit details
    Browse the repository at this point in the history