Skip to content

BOLT #2: order htlc_signatures by BIP69 + increasing CLTV.#491

Merged
cdecker merged 2 commits intolightning:masterfrom
rustyrussell:bip69-plus
Jan 22, 2019
Merged

BOLT #2: order htlc_signatures by BIP69 + increasing CLTV.#491
cdecker merged 2 commits intolightning:masterfrom
rustyrussell:bip69-plus

Conversation

@rustyrussell
Copy link
Collaborator

We express it has how the outputs are ordered, but the only way you can
detect that is by the htlc_signatures order, which is the part which really
matters.

I finally reproduced this, BTW, which is why I'm digging it up!

Closes: #448
Signed-off-by: Rusty Russell rusty@rustcorp.com.au

@rustyrussell rustyrussell requested a review from pm47 October 21, 2018 10:26
Copy link
Collaborator

@pm47 pm47 left a comment

Choose a reason for hiding this comment

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

This is the simplest way to fix #448 I think.

I have just one bikeshed comment, mainly to try out the new suggestion github feature.

@TheBlueMatt
Copy link
Collaborator

Can we just throw out the reference to BIP 69 and write out the full context there? (#456). This is really actually just a bug in BIP 69 as it should specify everything you need, but its a very poorly-written BIP.

@rustyrussell rustyrussell added this to the v1.0 milestone Nov 26, 2018
@rustyrussell
Copy link
Collaborator Author

Implemented in c-lightning. Waiting on second implementation by LND or Eclair...

@araspitzu
Copy link
Contributor

What about adding test vectors for the resulting htlc transactions? Although we should test against the htlc_signatures (in commitment_signed) having a test vector that specify the order of the htcl-tx associated with the commit-tx would be helpful for the implementers.

@rustyrussell
Copy link
Collaborator Author

We should definitely have more test vectors, though this should be applied meanwhile IMHO.

rustyrussell and others added 2 commits January 22, 2019 21:42
We express it has how the outputs are ordered, but the only way you can
detect that is by the htlc_signatures order, which is the part which really
matters.

I finally reproduced this, BTW, which is why I'm digging it up!

Closes: lightning#448
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Co-Authored-By: rustyrussell <rusty@rustcorp.com.au>
@cdecker
Copy link
Collaborator

cdecker commented Jan 22, 2019

Merging as decided during the 2019/01/21 IRC meeting.

@cdecker cdecker merged commit 1f4538c into lightning:master Jan 22, 2019
t-bast pushed a commit that referenced this pull request Mar 5, 2021
…used as tie-breaker for sorting (#539)

Add a serialized transactions test vector for the edge case of sorting htlc-timeout-tx
when there are multiple offered htlc with the same amount and preimage.

The test vector reuses previous preimages and creates a case scenario with 1 received htlc
and 2 offered, the two offered will have same scriptPubKey and redeemScript, but different CLTV value.

It is asserted the order in which the htlc transactions should be kept internally
and we assume the same order is used to construct the commitment_signed message.
This complements #491 .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants