-
Notifications
You must be signed in to change notification settings - Fork 893
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
possible bug in annoucement_signatures
construction?
#3819
Comments
annoucement_signatures
verification?annoucement_signatures
construction?
This is the code that generates the channel announcements: Lines 440 to 459 in fc2561f
The Line 3145 in fc2561f
The lightning/lightningd/channel_control.c Line 550 in fc2561f
...which should be correct. Huh. Can you show debug-level logs from C-Lightning? That should show the |
@ZmnSCPxj Does this help? I deleted volumes so the seeds and keys has changed. I don't know how to fix a seed. Also, I added some scripts for easy reproduction to my repo (Which probably does not need any dependency besides docker-compose and jq)
|
Thank you. Looks like you added a new debug print. What is
It looks like the 010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f0000d20000010000 02550ede68f6503e783cdb00a0f9e1b5b192c77b9077f180a445245ff6845cc7d5 <- local pubkey, correctly sorted since it is lexicographically less than remote pubkey Is the rust-lightning pubkey 0339bf81f00556bbd9ae471553718b14dd72d142acca5f0da95dab50f5ae667cec? That is what we think the peer is, and that "should" be correct since the noiseXK protocol is going to use that pubkey, and that is the link-level encryption protocol, so mismatch here would lead to C-Lightning and the rust-lightning node not communicating at all. |
Thanks for the feedback, let me double check. |
Shoot I was printing rust-lightning's value as c-lightning's and vise versa. Sorry for the confusion, I will probably open another issue in rl side ... |
Ah, it was not even a bug in rl. It is just I was misusing its api and using different |
Ok, good to know no problem on our side! |
Issue and Steps to Reproduce
While I've been trying to open the public channel from "c-lightning -> my rust-lightning node" , the rl fails to verify the
annoucement_signatures
sent from c-lightning.I first thought this is a bug in rl because doing the same for "c-lightning -> lnd" seems ok.
But by taking a closer look, it seems that when c-lightning signs to
channel_announcement
, it uses a wrongnode_id
key for the remote node.I don't know where it came from.
reproducing the bug.
I can reproduce the failure by running above code, but it is probably not helpful for debugging.
(By looking into the error message rl just tells that rl failed to verify the signature. and force-close the channel.)
Investigation done in my side
What I have done to check the above fact is
printf
the hex encodedchannel_announcement
in both sides.UnsignedChannelAnnonuncement
(which is a msg for actually performing signing) with my own LN libraryUnsignedChannelAnnouncement
and compare the equality.Everything besides nodeid deserializes to the same object, but in the c-lightning side,
node_id
for the remote node is completely different.Actual pretty printed messages.
Not sure this helps but I will put pretty-printed
UnsignedChannelAnnouncement
object here.The one printed in c-lightning side is
And the one printed in rl side is
Here, nodeid for my rl node is
025383792642c752a6cfe786b5ef8edce1dc9c6ba93c644139d4cd1a1aff487874
and the nodeid for c-lightning is
02a4f894bdf8005260bcca913f531a4cbcda2a780fdafab43724b20e09dcf64af5
You can see that
037d62e9651e9ee4c67b1adf93e9f017caaa3b30dba13629fcca2e96d367acaa95
in c-lightning came out of no where.NOTE: The ordering of the pubkey is also different, but I think this is a side effect fo the c-lightning is using wrong nodeid. rl uses node_id they exchanged at first for determining the ordering.
getinfo
outputnode id is different because I restarted the node when the test finished. Not sure this will help either but I will put here anyway.
The text was updated successfully, but these errors were encountered: