-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
TESTNET: unable to broadcast justice tx ... Witness program hash mismatch #970
Comments
@SimonVrouwe This is a very interesting issue! Any chance you got more of the |
Here are log files, the part I pasted above is from lnd.log.14 older log files are missing, are they auto cleaned-up? |
[edit] Forgot something, after step 6 and before step 7 (broadcasting): shutdown Debian1 node |
Why did
Log file atm are rotated automatically. However, there's an issue to make this optional. Decoding the script we get:
This is actually the sender's HTLC script, meaning you captured If we take a look at this fragment: https://github.com/lightningnetwork/lnd/blob/master/lnwallet/channel.go#L1990-L2014 You'll see that we generate the script based on if this was an incoming our outgoing HTLC. The description of your setup above was a bit unclear, but it seems like:
So I'm not sure if this is actually a bug or not, as we wouldn't have been able to sweep the outputs, since the the transaction should actually be invalid all together since we can't execute our own revocation clause. I could be wrong, but this is my current understanding, will revisit this in a bit to ensure I have the correct picture. |
Were all 3 nodes sharing the same |
Also it just seems that there's a lack of segwit enabled miners on testnet atm, so that would explain why it took so long for the transaction to get mined. |
Also the hash of the script above is actually: |
Do you know what block height this was at? I'm trying to reconstruct what the script for the receiver's HTLC would have been. |
Actually it wouldn't be possible for |
Also, are you able to repro on the current master? |
I must say that my setup is a bit messy/chaotic and a lot of things go wrong. High probability that I made a mistake somewhere or forgot to mention a step or just don't know what I am doing. But because this was the second time I encountered this error I reported it anyway. Will try to sort it out.
no, the c-lightning nodes share one bitcoind and lnd has its own
for the wscript for outpoint n=1 (witness_v0_scripthash), I got sha256(wscript)=fc31809b74fccdbe9b82c8a2fb875e7b5a9cd999aac58b3c1f93e3295a6c75f4
the revoked commit-tx was mined in block (testnet): 1289539 The commit-tx's where captured using the |
[edit] in step 2, "OpenSuse" should be "Lenovo" |
This isn't possible. You can't take the other party's commitment, sign it and broadcast it. Otherwise, it would be possible to make the remote party violate the contract at any point. The remote party only sends you sigs of your commitment. I'll need to go through their source to see exactly what the command does. |
Do you know why |
Working my way through BOLT#5 now and try to understand the nomenclature, which I find sometimes very confusing (i.e. 'holder', 'owner' and the perspectives 'local' and 'remote'). Here is the tx that was captured during
As far as I understand, above tx is Debian1's = local_node = sender/offerer of the HTLC because:
It seems to make sense that the command
Note that Debian1 (c-lightning) is the sender of the payment in |
updated
Gives same error as before:
|
The
Interchanging
Which sha256 hashes correctly to the HTLC output script:
|
Yep, if you examine the pr linked above, it makes that very correction
…On Wed, Apr 4, 2018, 10:08 PM SimonVrouwe ***@***.***> wrote:
The wscript that lnd constructed:
76a9140660c4ae39dc325f9754f791976e801d8b022fdf8763ac672102b494cee9b3cad20472fa5e03783e440b858ffcff15b1f2de0081e83ffed587af7c820120876475527c2103d395162f93927849ac5866ab9a1997d1e734af78bec86b4cb31009d748a1dc1d52ae67a91494e19b257098c4d67e3da459541cfafbdce1cbc788ac6868
Interchanging local_htlcpubkey and remote_htlcpubkey in that gives:
76a9140660c4ae39dc325f9754f791976e801d8b022fdf8763ac672103d395162f93927849ac5866ab9a1997d1e734af78bec86b4cb31009d748a1dc1d7c820120876475527c2102b494cee9b3cad20472fa5e03783e440b858ffcff15b1f2de0081e83ffed587af52ae67a91494e19b257098c4d67e3da459541cfafbdce1cbc788ac6868
Which sha256 hashes *correctly* to the HTLC output script:
a93f67d3e83bdf68670d7b92003a884c721b34f03e174d8898d9aae9bc3e4fc2
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#970 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA87Lv2AN0jroixAlGXmTPbn0ofidth-ks5tlaa0gaJpZM4TAf41>
.
|
Not sure if this should solve my setup and if I do this correctly, but tried to test #1025
And started but the same error:
is returned. Looking at the
Looks exactly the same as before. |
Background
Testing/learning lightning and the various tx's on TESTNET.
Having a channel between a c-lightning and a lnd node on my lan. A revoked commit-tx with htlc-output was captured manually from the c-lightning node and subsequently broadcasted. Lnd detects the breach, constructs the penalty-tx ... but fails to broadcast it because the Witness script hash for the htlc-output does not match. Had the same error yesterday which I could reproduced today with clean settings and latest builds.
Funding-tx ID: 487f43bca6862b7259557936f65ad3854011bf2c6e50b94030f61676f3dccc32
Revoked commit-tx ID: ad7961bb2f99358c743cfe2f90d0dd39fb34a308a7d3b16ad99dcaacdc941c29
Here is part of the lnd logfile about penalty-tx:
From above log result, for outpoint ad7961bb2f99358c743cfe2f90d0dd39fb34a308a7d3b16ad99dcaacdc941c29:1 the wscript=76a9140660c4ae39dc325f9754f791976e801d8b022fdf8763ac672102b494cee9b3cad20472fa5e03783e440b858ffcff15b1f2de0081e83ffed587af7c820120876475527c2103d395162f93927849ac5866ab9a1997d1e734af78bec86b4cb31009d748a1dc1d52ae67a91494e19b257098c4d67e3da459541cfafbdce1cbc788ac6868
which hashes to sha256(wscript)=fc31809b74fccdbe9b82c8a2fb875e7b5a9cd999aac58b3c1f93e3295a6c75f4
Where it should be: a93f67d3e83bdf68670d7b92003a884c721b34f03e174d8898d9aae9bc3e4fc2
according to the corresponding redeemscript in the broadcasted revoked commit-tx. Other two hashes seem correct.
Your environment
lnd
version 0.4, did 'git pull' and build yesterday, but also a 'git pull origin master' today (I wasn't not so sure about git)Steps to reproduce
capture commit-tx on Debian1 by running in another terminal simultaneously:
Beside above issue, I had other issues with lnd node.
bitcoind was crashed, restarting bitcoind and lnd solved above.
Not sure if related but in above lnd's version I changed in fundingmanager.go:
To get a more stable (low) feerate on testnet, but this was done and build after creating above channels.
The text was updated successfully, but these errors were encountered: