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

Eclair sent bad commitment signature (w/ log from C-Lightning node) #1133

Closed
whitslack opened this issue Sep 10, 2019 · 2 comments
Closed

Eclair sent bad commitment signature (w/ log from C-Lightning node) #1133

whitslack opened this issue Sep 10, 2019 · 2 comments
Assignees

Comments

@whitslack
Copy link

ACINQ's Lightning node (presumably Eclair) purportedly sent my C-Lightning node a bad commitment signature. My node responded with a WIRE_ERROR, and ACINQ's node unilaterally closed the channel.

I would expect an honest node never to send any bad signatures.

See the channel log from my C-Lightning node for the full details. Here is an excerpt from the point of reconnection through to the error:

{
	"type": "DEBUG",
	"time": "1970483.720066201",
	"source": "03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "Peer has reconnected, state CHANNELD_NORMAL"
},
{
	"type": "DEBUG",
	"time": "1970483.768750721",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "pid 16841, msgfd 319"
},
{
	"type": "DEBUG",
	"time": "1970483.768883359",
	"source": "03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "Already have funding locked in (and ready to announce)"
},
{
	"type": "DEBUG",
	"time": "1970484.103269147",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "init LOCAL: remote_per_commit = 039501d259c429847e26a109d16276cc341d85400d47700f31da965666076adac9, old_remote_per_commit = 0221aaef53251f43306945b54693a94a9dd74d21e58f4c3baad2cbd6d31ef517f0 next_idx_local = 7352 next_idx_remote = 7352 revocations_received = 7350 feerates 8136/8136 (range 253-121140)"
},
{
	"type": "DEBUG",
	"time": "1970484.103671924",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "peer_out WIRE_CHANNEL_REESTABLISH"
},
{
	"type": "DEBUG",
	"time": "1970484.104376575",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "peer_in WIRE_CHANNEL_REESTABLISH"
},
{
	"type": "DEBUG",
	"time": "1970484.209724220",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "Got reestablish commit=7352 revoke=7350"
},
{
	"type": "DEBUG",
	"time": "1970484.210389502",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "next_revocation_number = 7350"
},
{
	"type": "DEBUG",
	"time": "1970484.319661517",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "Reestablish, comparing commitments. Remote's next local commitment number is 7352. Our next remote is 7352 with 7350 revocations received"
},
{
	"type": "DEBUG",
	"time": "1970484.320291242",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "option_data_loss_protect: fields are correct"
},
{
	"type": "DEBUG",
	"time": "1970484.320901557",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "peer_out WIRE_REVOKE_AND_ACK"
},
{
	"type": "DEBUG",
	"time": "1970484.321381886",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "Exchanging announcement signatures."
},
{
	"type": "DEBUG",
	"time": "1970484.321602425",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "peer_out WIRE_ANNOUNCEMENT_SIGNATURES"
},
{
	"type": "DEBUG",
	"time": "1970484.322527245",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "peer_out WIRE_GOSSIP_TIMESTAMP_FILTER"
},
{
	"type": "DEBUG",
	"time": "1970484.322679914",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "peer_in WIRE_REVOKE_AND_ACK"
},
{
	"type": "DEBUG",
	"time": "1970484.322861211",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "Received revoke_and_ack"
},
{
	"type": "DEBUG",
	"time": "1970484.323034321",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "Commits outstanding after recv revoke_and_ack"
},
{
	"type": "DEBUG",
	"time": "1970484.323200255",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "Sending master 1022"
},
{
	"type": "DEBUG",
	"time": "1970484.323534146",
	"source": "03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "got revoke 7350: 0 changed"
},
{
	"type": "DEBUG",
	"time": "1970484.440069249",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "... , awaiting 1122"
},
{
	"type": "DEBUG",
	"time": "1970484.445720273",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "Got it!"
},
{
	"type": "DEBUG",
	"time": "1970484.445861033",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "revoke_and_ack LOCAL: remote_per_commit = 027f33c09b9a2533fd92f5dba0583fe9680c0503f8559e7b89eb3829ddf5eec3e6, old_remote_per_commit = 039501d259c429847e26a109d16276cc341d85400d47700f31da965666076adac9"
},
{
	"type": "DEBUG",
	"time": "1970484.446019369",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "We need 176542sat at feerate 12114 for 0 untrimmed htlcs: we have 8533415174msat/8533415174msat"
},
{
	"type": "DEBUG",
	"time": "1970484.446167843",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "Setting REMOTE feerate to 12114"
},
{
	"type": "DEBUG",
	"time": "1970484.446305397",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "peer_out WIRE_UPDATE_FEE"
},
{
	"type": "DEBUG",
	"time": "1970484.446449157",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "Trying commit"
},
{
	"type": "DEBUG",
	"time": "1970484.446616294",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "Creating commit_sig signature 7352 3045022100b64271618aadfc0c7542f5215f18b7015a4a2e6ef34c9719fb19128878e02f8902205755a8e1716b63efacd90f58284cb1ad1fc97844bc09ba28d3e2c0ad62be98be01 for tx 0200000001662914fd7218a8068c56f5597cc4e0f99a9a4e02442c4221b874e942cb2576c100000000003a0121800257ca7d0000000000220020f977ab070bcee5f34c9ad06f494939a5ef1c5a26592b60d8b6f2eb2a33bc3a846513820000000000160014a87e0b8581b4af93e3d3e72a9f9583af9e39b9750a763620 wscript 52210321a70116a810441b4f54866bec09f77b9592b37d662ba4cf306958685f24b58b2103641baea7668eb9f6278396ec292e8e878d97e9fe460e2bab03f1bcdfeed349af52ae key 0321a70116a810441b4f54866bec09f77b9592b37d662ba4cf306958685f24b58b"
},
{
	"type": "DEBUG",
	"time": "1970484.446802491",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "Telling master we're about to commit..."
},
{
	"type": "DEBUG",
	"time": "1970484.446965638",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "Sending master 1020"
},
{
	"type": "DEBUG",
	"time": "1970484.560013048",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "... , awaiting 1120"
},
{
	"type": "DEBUG",
	"time": "1970484.679973690",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "Got it!"
},
{
	"type": "DEBUG",
	"time": "1970484.680165588",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "Sending commit_sig with 0 htlc sigs"
},
{
	"type": "DEBUG",
	"time": "1970484.680325615",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "peer_out WIRE_COMMITMENT_SIGNED"
},
{
	"type": "DEBUG",
	"time": "1970484.680524221",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "peer_in WIRE_ANNOUNCEMENT_SIGNATURES"
},
{
	"type": "DEBUG",
	"time": "1970484.681151655",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "peer_in WIRE_COMMITMENT_SIGNED"
},
{
	"type": "DEBUG",
	"time": "1970484.681302911",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "Received commit"
},
{
	"type": "DEBUG",
	"time": "1970484.681452206",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "Derived key 022408cd3fcd61bec7b15357537c244dae935de41993d317741de68de2471bea3b from basepoint 026b717ba8f9c70137d6c4af2d1012f4e3345320df4a3b367e6121e10a0f475e8e, point 030f3b79739f16f4d9a94e51794a5e9b83de20de251b5dd7dd0356a96512c03c1a"
},
{
	"type": "DEBUG",
	"time": "1970484.681609660",
	"source": "lightning_channeld-03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "peer_out WIRE_ERROR"
},
{
	"type": "UNUSUAL",
	"time": "1970484.682220823",
	"source": "03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "Peer permanent failure in CHANNELD_NORMAL: lightning_channeld: sent ERROR Bad commit_sig signature 7352 3045022100e9174f203b0287ba7586523c274f7ba94382de75ccd96b9c02e22c1886a1343b022017997027446616878350008426bf0412352476e7004668c9cda82aef3d92e1da01 for tx 0200000001662914fd7218a8068c56f5597cc4e0f99a9a4e02442c4221b874e942cb2576c100000000003a0121800257ca7d0000000000160014254ec6de42b4cc05b560df7d1518291161e49ee8a51e8200000000002200201e354487d841ad08fd26f30aba844ad927c12f8d2b714339d6940ba17c08154f0a763620 wscript 52210321a70116a810441b4f54866bec09f77b9592b37d662ba4cf306958685f24b58b2103641baea7668eb9f6278396ec292e8e878d97e9fe460e2bab03f1bcdfeed349af52ae key 03641baea7668eb9f6278396ec292e8e878d97e9fe460e2bab03f1bcdfeed349af feerate 8136"
},
{
	"type": "INFO",
	"time": "1970484.776441514",
	"source": "03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f chan #102:",
	"log": "State changed from CHANNELD_NORMAL to AWAITING_UNILATERAL"
},

From my limited understanding, I would surmise that the error occurred because my node sent a new feerate of 12114 but ACINQ's node responded with a new commitment transaction that still used the old feerate of 8136.

I am not sure if I could reproduce this issue. I had had this channel open with ACINQ for many weeks before this anomaly occurred. I suspect an edge case.

I do not know what version of Eclair is running on ACINQ's node presently.

My environment is C-Lightning 0.7.2.1, compiled from sources, running on Gentoo Linux.

03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f.log

@pm47
Copy link
Member

pm47 commented Sep 10, 2019

I would expect an honest node never to send any bad signatures.

This error usually doesn't mean that the signature is invalid in itself, but rather that there is a disagreement on the data being signed. It's a typical interop problem.

my node sent a new feerate of 12114 but ACINQ's node responded with a new commitment transaction that still used the old feerate of 8136.

This reminds me ElementsProject/lightning#2661, which is a bug on c-lightning's side. Could be something different, I'll look into it.

@pm47 pm47 self-assigned this Sep 10, 2019
@pm47
Copy link
Member

pm47 commented Sep 11, 2019

Confirmed duplicate of ElementsProject/lightning#2661. Closing here and documenting there.

@pm47 pm47 closed this as completed Sep 11, 2019
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

2 participants