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
[anchor] pluggable anchor commitments #3821
Commits on Mar 9, 2020
-
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.
-
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.
-
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.
-
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
-
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.
-
-
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.
-
-
-
-
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.
-
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>
-
input+lnwallet: use individual commit weight calculations for channel…
… type Based on the channel type, the commitment weight will be calculated.
-
-
-
-
-
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.
-
-
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.
-
cfg: rename legacyprotocol to protocol
Since we are also going to use it for experimental new features.
-
multi: optionally enable and signal anchor support
Defaults to disabled.
-
-
-
fundingmanager+lnwallet: enable anchor commitments
If both nodes are signalling the feature, make all opened channels using this type.
-