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

Closing weight fix #5004

Merged
merged 7 commits into from
Jan 27, 2022

Conversation

rustyrussell
Copy link
Contributor

I was getting regular failures in the #4984 branch. This was caused by the closing fee estimation being wrong in elements, however, AFAICT the flaky retester has been covering it up (prior to this it would sometimes pass).

In debugging this, I discovered that our non-elements closing weight was also wrong, though not enough to trigger an error. New test, more debugging...

Can we remove the flaky stuff please after release? It's just deferring pain, not removing it!

…ill be.

We had an out-by-two error when calculating weights, because we grab weights
on unsigned txs.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Compare against lightningd's, and the actual tx.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Saves us actually creating the witness to measure it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
@rustyrussell rustyrussell force-pushed the guilt/closing-weight-fix branch from 0fdb8aa to 5aaa03f Compare January 12, 2022 03:53
Copy link
Contributor

@vincenzopalazzo vincenzopalazzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch

ack 4ac8e23

@cdecker
Copy link
Member

cdecker commented Jan 15, 2022

ACK 5aaa03f

@rustyrussell rustyrussell force-pushed the guilt/closing-weight-fix branch from 5aaa03f to ca593a4 Compare January 25, 2022 05:37
@rustyrussell
Copy link
Contributor Author

More elements fixes: @cdecker please review!

And in particular, fix onchaind grinding code which used the
actual number of inputs and outputs (which already includes the
fee output); that breaks with the next patch which fixes other
calculations.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This fixes lightningd's chronic weight underestimate.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: closingd: more accurate weight estimation helps mutual closing near min/max feerates.
Firstly, we were not adding the extra fee output on our dummy tx,
because the fee amount was 0.  We probably should always do this, even
if it's 0.

Secondly, there are 6 witnesses, not 1, for elements txs.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
And skip some tests: I'd simply be pasting in the results, which is
not very useful.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
@rustyrussell rustyrussell force-pushed the guilt/closing-weight-fix branch from ca593a4 to d6e603e Compare January 26, 2022 02:14
Copy link
Contributor

@vincenzopalazzo vincenzopalazzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I'm a little bit out of context with elements

ack d6e603e

@cdecker
Copy link
Member

cdecker commented Jan 27, 2022

ACK d6e603e

@cdecker cdecker merged commit c0e3155 into ElementsProject:master Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants