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

reverse proxy causes invalid commit sig w/ CL #3586

Closed
JaviLib opened this issue Oct 7, 2019 · 7 comments
Closed

reverse proxy causes invalid commit sig w/ CL #3586

JaviLib opened this issue Oct 7, 2019 · 7 comments

Comments

@JaviLib
Copy link

JaviLib commented Oct 7, 2019

Background

I have two nodes, a LND one and a C-Lightning one. I try to open a channel from C-Lightning to LND, and I get the following error right after the 3 confirmations:

Channel ID: 598315x1745x0
Full Channel ID: e2fec018c84aaef708473a9f59a2a6774823aafc2614f324c17ed721345e5fa3
Status: ONCHAIN
Ours: 4,455,440 sat
Theirs: 0 sat
Age: 6 blocks (an hour)
Peer: 0354d80bcc05fc30b0d867238d83645b68b326c59f05303be14c87bcf4e84bd9c9 (connected)
Funding TXID: a35f5e3421d77ec124f31426fcaa234877a6a2599f3a4708f7ae4ac818c0fee2
CHANNELD_NORMAL:Received error from peer:
channel e2fec018c84aaef708473a9f59a2a6774823aafc2614f324c17ed721345e5fa3:
rejected commitment: commit_height=1, 
invalid_commit_sig=304402200f62b3f84f5a4c3cd5aa62b9fc2cfde5262a121bb05b7c9125eeecdb3678411f02203104870ef673a8dcdb31cec266407a650fa97350741383cd0c4179ca360c4c0e,
commit_tx=0200000001e2fec018c84aaef708473a9f59a2a6774823aafc2614f324c17ed721345e5fa30000000000cd705e8001d8f94300000000001600142c1f8af10692be63da20098b76a00e0347b8eabbd034d020,
sig_hash=aff607ba43671a5e7b2d2c1e589515253ebee576077330afe1e0b70d4eae9899
ONCHAIN:Tracking their unilateral close

I can provide any additional information you ask.

My environment

  • lnd version 0.8.0-beta commit=v0.8.0-beta-rc2
  • Linux arm (Raspian)
  • Bitcoin Core v0.18.1
  • C-Lightning v0.7.2.1
 lncli getinfo
{
	"version": "0.8.0-beta commit=v0.8.0-beta-rc2",
	"identity_pubkey": "0354d80bcc05fc30b0d867238d83645b68b326c59f05303be14c87bcf4e84bd9c9",
	"alias": "cheese",
	"color": "#3399ff",
	"num_pending_channels": 1,
	"num_active_channels": 0,
	"num_inactive_channels": 0,
	"num_peers": 6,
	"block_height": 598323,
	"block_hash": "0000000000000000001438e86c309bc986e74357e3018e31ed0d27685b1741d2",
	"best_header_timestamp": 1570466806,
	"synced_to_chain": true,
	"synced_to_graph": false,
	"testnet": false,
	"chains": [
		{
			"chain": "bitcoin",
			"network": "mainnet"
		}
	],
	"uris": [
		"0354d80bcc05fc30b0d867238d83645b68b326c59f05303be14c87bcf4e84bd9c9@94.177.171.73:9732"
	]
}

@JaviLib
Copy link
Author

JaviLib commented Oct 7, 2019

I have open the same issue in c-lightning github, as I don't know who is the culprit here: ElementsProject/lightning#3140

@Roasbeef
Copy link
Member

Roasbeef commented Oct 8, 2019

What does your listchannels entry for this channel look like? Feel free to remove any information you think might be sensitive.

@JaviLib
Copy link
Author

JaviLib commented Oct 8, 2019

It doesn't appear there, as it was inmediatly closed as I said in the first msg. But in closed channels it appears:

 {
            "channel_point": "a35f5e3421d77ec124f31426fcaa234877a6a2599f3a4708f7ae4ac818c0fee2:0",
            "chan_id": "657854299687157760",
            "chain_hash": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
            "closing_tx_hash": "31c22f87336e936f4f9d5d27697dcf65ff4e4daa06f071195b36092d7043c142",
            "remote_pubkey": "0276e09a267592e7451a939c932cf685f0754de382a3ca85d2fb3a864d4c365ad5",
            "capacity": "4455440",
            "close_height": 598319,
            "settled_balance": "0",
            "time_locked_balance": "0",
            "close_type": "LOCAL_FORCE_CLOSE"
        },

@cfromknecht
Copy link
Contributor

My guess is that this is just a feature bit disagreement, where one thinks it’s doing safu commitments and the other doesn’t.

Was the channel opened before upgrading to rc2 or after?

@JaviLib
Copy link
Author

JaviLib commented Oct 8, 2019

I think I found the trigger for this bug:

I am behind a reverse SSH proxy for incoming connections, and I used 127.0.0.1:9732 as the listen address, this way:

externalip=94.177.171.73:9732
listen=127.0.0.1:9732

This is the autossh command in case you want to reproduce this error:

/usr/bin/autossh -o "ServerAliveInterval 5" -o "ServerAliveCountMax 1" -o "ConnectTimeout 10" -R 94.177.171.73:8333:127.0.0.1:8333 -R 94.177.171.73:10009:127.0.0.1:10009 -R 94.177.171.73:9732:127.0.0.1:9732 -C -N -q -D localhost:9999 94.177.171.73

If I change the address from 127.0.0.1 to some ethernet address like for example 192.168.0.10, it suddenly starts to work.
It's worth checking out.

@Roasbeef Roasbeef changed the title Rejected commitment invalid_comit_sig right after opening channel from a C-Lightning node reverse proxy causes invalid commit sig w/ CL Oct 10, 2019
@Roasbeef
Copy link
Member

Will likely be fixed by #3872

@halseth
Copy link
Contributor

halseth commented Feb 3, 2020

Closing per #3586 (comment)

@halseth halseth closed this as completed Feb 3, 2020
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

No branches or pull requests

4 participants