-
Notifications
You must be signed in to change notification settings - Fork 902
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
restored channel has mismatched state on the two nodes #228
Comments
The netaddr issue is that we don't store the address to the DB, it's likely no longer the same anyway, e.g., when the connection was initiated by the other end the node would see a random high port. We will rely on gossip and the DNS seeds to get the current address for the node. The second thing is that they disagree on their current msatoshis, that's a bit scarier. Can you tell us more about how to reproduce this? Which node connects to which other node and which node gets restarted? |
just get any error during the loop of sendpay, since it never gets past 100 sendpays, it always ends up in this state. I restart both nodes, but it doesnt seem to matter. then restart the node and odds are very good, it wont restore state properly and end up with things like: lightningd(16350): peer 02779b57b66706778aa1c7308a817dc080295f3c2a6af349bb1114b8be328c28dc: Attempt to send HTLC but unowned (CHANNELD_NORMAL) still trying to isolate the causal factor, but before the update, I was able to always go into the sendpay loop. Now, I need to wipe the DB file and addfunds, fundchannel, etc. all over again. Oh, one thing. Is the paid invoices list critically needed for the payments? I am assuming that once the invoice is paid, it can be deleted, but wanted to make sure that isnt causing any problems The way to reproduce this is:
now it is in a state where I have to wipe the DB file in order to get the nodes to be able to sendpay again. |
after getting EXPIRY error, both nodes have the correct values in the channel: sending node: { "unique_id" : 0, "state" : "CHANNELD_NORMAL", "netaddr" : "5.9.253.195:9735", "peerid" : "02779b57b66706778aa1c7308a817dc080295f3c2a6af349bb1114b8be328c28dc", "connected" : true, "owner" : "lightningd_channel", "channel" : "70880:1:1", "msatoshi_to_us" : 90950000000, "msatoshi_total" : 101250000000 } receiving node: { "unique_id" : 0, "state" : "CHANNELD_NORMAL", "netaddr" : "::ffff:5.9.253.196:48872", "peerid" : "03b03efcf647e6dd48b949e5b1f7e9e064257a5c48c2d56b1334b283b48338f821", "connected" : true, "owner" : "lightningd_channel", "channel" : "70880:1:1", "msatoshi_to_us" : 10300000000, "msatoshi_total" : 101250000000 } I will now stop each lightningd and restart it: sending node: { "unique_id" : 0, "state" : "CHANNELD_NORMAL", "netaddr" : "Unknown protocol 0", "peerid" : "02779b57b66706778aa1c7308a817dc080295f3c2a6af349bb1114b8be328c28dc", "connected" : false, "channel" : "70880:1:1", "msatoshi_to_us" : 101250000000, "msatoshi_total" : 101250000000 } receiving node: { "unique_id" : 0, "state" : "CHANNELD_NORMAL", "netaddr" : "Unknown protocol 0", "peerid" : "03b03efcf647e6dd48b949e5b1f7e9e064257a5c48c2d56b1334b283b48338f821", "connected" : false, "channel" : "70880:1:1", "msatoshi_to_us" : 0, "msatoshi_total" : 101250000000 } ] } both nodes appear to have forgotten all of the payments. only the receiving node is deleting the paid invoice, so there is something amiss here as that cant affect the sending nodes sent amount. restore on startup appears to be the issue |
from sendpay node: { "unique_id" : 0, "state" : "CHANNELD_NORMAL", "netaddr" : "Unknown protocol 0", "peerid" : "02779b57b66706778aa1c7308a817dc080295f3c2a6af349bb1114b8be328c28dc", "connected" : false, "channel" : "70332:1:0", "msatoshi_to_us" : 10125000000, "msatoshi_total" : 10125000000 }
from receiving node: { "unique_id" : 0, "state" : "CHANNELD_NORMAL", "netaddr" : "::ffff:5.9.253.196:55268", "peerid" : "03b03efcf647e6dd48b949e5b1f7e9e064257a5c48c2d56b1334b283b48338f821", "connected" : false, "channel" : "70332:1:0", "msatoshi_to_us" : 9900000000, "msatoshi_total" : 10125000000 }
I am also seeing strange "netaddr" for reconnected peers. It seems close, but not quite restoring state to the same as from a fresh connect. For now, I need to make it forget about the other node to be able to sendpay successfully again. The only way I know how to make it forget is by removing the sql DB file. maybe there is a less drastic way to make a peer forgotten?
The text was updated successfully, but these errors were encountered: