-
Notifications
You must be signed in to change notification settings - Fork 366
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
Cleanup PackageTemplate
a bit
#3297
Cleanup PackageTemplate
a bit
#3297
Commits on Oct 16, 2024
-
Rename claim cleaning match bool for accuracy
We don't actually care if a confirmed transaction claimed other outputs, only that it claimed a superset of the outputs in the pending claim we're looking at. Thus, the variable to detect that is renamed `is_claim_subset_of_tx` instead of `are_sets_equal`.
Configuration menu - View commit details
-
Copy full SHA for 2f549ee - Browse repository at this point
Copy the full SHA 2f549eeView commit details -
Rename
PackageTemplate::timelock
counteraprty_spendable_height
This function was very confusing - its used to determine by when we have to stop aggregating this claim with others as it starts to be at risk of pinning due to the counterparty's ability to spend the output. It is not ever used as a timelock for a transaction, and thus its name is very confusing. Instead we rename it `counterparty_spendable_height`.
Configuration menu - View commit details
-
Copy full SHA for a19edbc - Browse repository at this point
Copy the full SHA a19edbcView commit details
Commits on Oct 17, 2024
-
Drop unused
PackageTemplate::height_original
This has never been used, and its set to a fixed value of zero for HTLCs on local commitment transactions making it impossible to rely on so might as well remove it.
Configuration menu - View commit details
-
Copy full SHA for 8c4794d - Browse repository at this point
Copy the full SHA 8c4794dView commit details -
Stop passing current height to
PackageTemplate::build_package
Now that we don't store the confirmation height of the inputs being spent, passing the current height to `PackageTemplate::build_package` is useless - we only use it to set the height at which we should next bump the fee, but we just want it to be "next block", so we might as well use `0` and avoid the extra argument. Further, in one case we were already passing `0`, so passing the argument is just confusing as we can't rely on it being set. Note that this does remove an assertion that we never merge packages that were crated at different heights, and in the future we may wish to do that (as there's no specific reason not to), but we do not currently change the behavior.
Configuration menu - View commit details
-
Copy full SHA for 303a0c9 - Browse repository at this point
Copy the full SHA 303a0c9View commit details -
Clean up
PackageTemplate::get_height_timer
to consider type`PackageTemplate::get_height_timer` is used to decide when to next bump our feerate on claims which need to make it on chain within some window. It does so by comparing the current height with some deadline and increasing the bump rate as the deadline approaches. However, the deadline used is the `counterparty_spendable_height`, which is the height at which the counterparty might be able to spend the same output, irrespective of why. This doesn't make sense for all output types, for example outbound HTLCs are spendable by our counteraprty immediately (by revealing the preimage), but we don't need to get our HTLC timeout claims confirmed immedaitely, as we actually have `MIN_CLTV_EXPIRY` blocks before the inbound edge of a forwarded HTLC becomes claimable by our (other) counterparty. Thus, here, we adapt `get_height_timer` to look at the type of output being claimed, and adjust the rate at which we bump the fee according to the real deadline.
Configuration menu - View commit details
-
Copy full SHA for be91587 - Browse repository at this point
Copy the full SHA be91587View commit details -
Rename
soonest_conf_deadline
tocounterparty_spendable_height
This renames the field in `PackageTemplate` which describes the height at which a counterparty can make a claim to an output to match its actual use. Previously it had been set based on when a counterparty can claim an output but also used for other purposes. In the previous commit we cleaned up its use for fee-bumping-rate, so here we can rename it as it is now only used as the `counteraprty_spendable_height`.
Configuration menu - View commit details
-
Copy full SHA for d557334 - Browse repository at this point
Copy the full SHA d557334View commit details
Commits on Oct 18, 2024
-
Set correct
counterparty_spendable_height
for outb local HTLCsFor outbound HTLCs, the counterparty can spend the output immediately. This fixes the `counterparty_spendable_height` in the `PackageTemplate` claiming outbound HTLCs on local commitment transactions, which was previously spuriously set to the HTLC timeout (at which point *we* can claim the HTLC).
Configuration menu - View commit details
-
Copy full SHA for 6ae33dc - Browse repository at this point
Copy the full SHA 6ae33dcView commit details -
Add a test for the fee-bump rate of timeout HTLC claims on cp txn
In a previous commit we updated the fee-bump-rate of claims against HTLC timeouts on counterparty commitment transactions so that instead of immediately attempting to bump every block we consider the fact that we actually have at least `MIN_CLTV_EXPIRY_DELTA` blocks to do so, and bumping at the appropriate rate given that. Here we test that by adding an extra check to an existing test that we do not bump in the very next block after the HTLC timeout claim was initially broadcasted.
Configuration menu - View commit details
-
Copy full SHA for 20db790 - Browse repository at this point
Copy the full SHA 20db790View commit details