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

[anchor] pluggable anchor commitments #3821

Merged
merged 31 commits into from Mar 10, 2020

Commits on Mar 9, 2020

  1. input/size: remove unused constants

    Since we never attempt to sweep an HTLC we offered with the preimage on
    the remote's commitment, we never use the constant
    AcceptedHtlcSuccessWitnessSize for weight estimation. Similarly, we
    never timout an HTLC offered by the remote on our own commitment, and
    don't need the constant OfferedHtlcTimeoutWitnessSize.
    halseth committed Mar 9, 2020
    Copy the full SHA
    02dd8d2 View commit details
    Browse the repository at this point in the history
  2. lnwallet/channel: use genHtlcScript to create scripts

    It takes into account the necessary variables and will prepare us for
    doing commitment type dependent script generation later.
    halseth committed Mar 9, 2020
    Copy the full SHA
    865776c View commit details
    Browse the repository at this point in the history
  3. input/script_utils_test: extract script execution into assert method

    This fixes an error case that wouldn't have been caught, since
    vm.Execute applies more rules than the individual steps (most notably
    the clean stack rule).
    
    Instead we execute the engine as normal, and only step through if we
    decide that the outcome is unexpected.
    halseth committed Mar 9, 2020
    Copy the full SHA
    b56c7e3 View commit details
    Browse the repository at this point in the history
  4. input/script_utils_test: refactor TestHTLCSenderSpendValidation

    To be able to change more than the witness used for each test case, we
    extract commit and sweep tx generation into own methods that can be
    called from each test case.
    
    We do the same for TestHTLCReceiverSpendValidation
    halseth committed Mar 9, 2020
    Copy the full SHA
    b228681 View commit details
    Browse the repository at this point in the history
  5. lnwallet: thread chanType down into genHtlcScript, gen[..]SigJobs,

    create[..]Tx
    
    NO FUNCTIONAL CHANGES
    This is a commit just supplying the channel types to various methods.
    halseth committed Mar 9, 2020
    Copy the full SHA
    6ecb379 View commit details
    Browse the repository at this point in the history
  6. Copy the full SHA
    b25f2fa View commit details
    Browse the repository at this point in the history
  7. input+lnwallet: Add scripts for CSV delayed HTLC outputs

    We also increase the witness size for these types to account for the 3
    extra bytes. The size won't be correct in all cases, but it is just an
    upper bound in any case.
    halseth committed Mar 9, 2020
    Copy the full SHA
    8c0deb8 View commit details
    Browse the repository at this point in the history
  8. Copy the full SHA
    dc271a8 View commit details
    Browse the repository at this point in the history
  9. Copy the full SHA
    a309132 View commit details
    Browse the repository at this point in the history
  10. Copy the full SHA
    990992c View commit details
    Browse the repository at this point in the history
  11. Copy the full SHA
    6deb913 View commit details
    Browse the repository at this point in the history
  12. Copy the full SHA
    50199ae View commit details
    Browse the repository at this point in the history
  13. lnwallet: add anchor commitmenttype

    With this commitment type, we'll add extra anchor outputs to the
    commitment transaction if the anchor channel type is active.
    halseth committed Mar 9, 2020
    Copy the full SHA
    af68ff1 View commit details
    Browse the repository at this point in the history
  14. contractcourt/commit_sweep_resolver: set sweep witness type based on …

    …witness script
    
    We use the fact that we can tell whether the commit is local or remote
    by inspecting the witness script. We cannot use the maturity delay
    anymore, as we can have delayed to_remote outputs also now.
    
    Co-authored-by: Joost Jager <joost.jager@gmail.com>
    halseth and joostjager committed Mar 9, 2020
    Copy the full SHA
    1f28bd8 View commit details
    Browse the repository at this point in the history
  15. input+lnwallet: use individual commit weight calculations for channel…

    … type
    
    Based on the channel type, the commitment weight will be calculated.
    halseth committed Mar 9, 2020
    Copy the full SHA
    ea94dbb View commit details
    Browse the repository at this point in the history
  16. Copy the full SHA
    21c5a95 View commit details
    Browse the repository at this point in the history
  17. Copy the full SHA
    6810912 View commit details
    Browse the repository at this point in the history
  18. Copy the full SHA
    d1089fb View commit details
    Browse the repository at this point in the history
  19. Copy the full SHA
    bddd3e1 View commit details
    Browse the repository at this point in the history
  20. Copy the full SHA
    c5d58b4 View commit details
    Browse the repository at this point in the history
  21. Copy the full SHA
    92af234 View commit details
    Browse the repository at this point in the history
  22. Copy the full SHA
    ad8e9f3 View commit details
    Browse the repository at this point in the history
  23. lnwallet/reservation: add non-initiator balance check

    If we are the initiator, we check that our starting balance after
    subtracting fees are not less than two times the default dust limit.
    
    This commit adds a similar check for the non-initiator case, checking
    that the remote party has a starting balance of reasonable size.
    halseth committed Mar 9, 2020
    Copy the full SHA
    8741b93 View commit details
    Browse the repository at this point in the history
  24. Copy the full SHA
    f95a82b View commit details
    Browse the repository at this point in the history
  25. itest: make commit type enum

    To prepare for adding more commit types to test for basic channel
    funding, we make the commit type an enum that gets its own set of
    subtests.
    halseth committed Mar 9, 2020
    Copy the full SHA
    51c5352 View commit details
    Browse the repository at this point in the history
  26. cfg: rename legacyprotocol to protocol

    Since we are also going to use it for experimental new features.
    halseth committed Mar 9, 2020
    Copy the full SHA
    44756b5 View commit details
    Browse the repository at this point in the history
  27. multi: optionally enable and signal anchor support

    Defaults to disabled.
    halseth committed Mar 9, 2020
    Copy the full SHA
    21126ab View commit details
    Browse the repository at this point in the history
  28. Copy the full SHA
    fd93c56 View commit details
    Browse the repository at this point in the history
  29. Copy the full SHA
    7adb1bc View commit details
    Browse the repository at this point in the history
  30. fundingmanager+lnwallet: enable anchor commitments

    If both nodes are signalling the feature, make all opened channels using
    this type.
    halseth committed Mar 9, 2020
    Copy the full SHA
    ea2a58e View commit details
    Browse the repository at this point in the history
  31. Copy the full SHA
    b7885db View commit details
    Browse the repository at this point in the history