Correct htlc witness size calculations#815
Merged
t-bast merged 4 commits intolightning:masterfrom Dec 7, 2020
Merged
Conversation
Regardless of the previous commit, this didn't add up
Collaborator
|
Is this an artifact of signature size variation? I mean there is no "right" answer after you sign things vary a byte or two, but is the limit wrong because we didn't account for low-S implying signatures are never max size? |
Contributor
Author
|
We always assume they are the worst case size (73). Are you saying signatures never actually get that large? Interesting. |
Collaborator
|
Wow good catch, I don't understand why we considered this |
14 tasks
cdecker
reviewed
Nov 16, 2020
03-transactions.md
Outdated
| 663 (HTLC-timeout) (666 with with option_anchor_outputs)) | ||
| 703 (HTLC-success) (706 with with option_anchor_outputs)) | ||
| 703 (HTLC-success) (706 with with option_anchor_outputs)) | ||
| - (reeeally 702 and 705, but we use these numbers for historical reasons) |
t-bast
approved these changes
Nov 23, 2020
Collaborator
|
I re-did the calculations and I agree with what you found. |
940ff6d to
fc5f7c4
Compare
fc5f7c4 to
9fdee1e
Compare
flack
reviewed
Nov 26, 2020
03-transactions.md
Outdated
|
|
||
| 663 (HTLC-timeout) (666 with with option_anchor_outputs)) | ||
| 703 (HTLC-success) (706 with with option_anchor_outputs)) | ||
| 703 (HTLC-success) (706 with with option_anchor_outputs)) |
t-bast
approved these changes
Dec 7, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I noticed a few inconsistencies in the weight constants.
I guess implementations just use the hardcoded constants for
HTLC-timeoutandHTLC-successwhen doing tx constructions (this is what lnd does), so I added a note here that we should continue using this value even though it is off by one.