-
Notifications
You must be signed in to change notification settings - Fork 30
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
openchannel with pushsats isn't accounted for #112
Comments
Thanks for the issue! Unfortunately push amounts weren't included because they aren't tracked after the channel has been closed (lightningnetwork/lnd#4490), and it seemed inconsistent to include them when we run the report for the open channel, but not when we run it when the channel is closed. I've created #114 to at least mention this in the docs while we wait on the blocking lnd issue.
You'd be surprised 😬
The rationale behind this was that the balance moves out of your on-chain wallet balance (as reflected by lnd) and then is repaid to your on-chain balance when you close out. Although this has been brought up by other users anecdotally, so perhaps there's a better way to deal with this movement of funds. |
That would require an off-chain credit to go along with it. I understand viewing on-chain and off-chain as separate wallets, but if I open a channel with 10 BTC, I have (close to) 10 BTC off-chain now... but there is no credit event in the audit so it just looks like that 10 BTC disappeared into a blackhole, then randomly payments that are debiting via off-chain payments appear, but you've never "credited" your off-chain wallet to begin with. So to summarize, if I open a channel of 10 BTC and push_sats 5 BTC
If someone push_sats 5 BTC to us
It seems like currently faraday only starts tracking from the point when it starts watching lnd and doesn't try to parse all past payments... so the ability to see push_sats after closing seems like it's not a big deal. |
I think that's a good idea, thanks for the suggestion! As is some additional logic which knows this balance went off chain to use the report. Seems sensible to have a matching entry. A remote push could also show up as this same type of credit.
This isn't the case for the audit report, it can be run for any period of time that lnd has records for (with the caveat that there may be some issues with very old payments, because lnd 0.11 was updated to help with accounting).
The problem with this is that the report needs to be consistent, you could run into all sorts of issues in this kind of scenario:
We'd have different reports for the same period of time, which is very messy for auditing, which is why we need the lnd change. |
When you use openchannel with the push_sats argument (ie. open channel worth 10 BTC and push 5 BTC to the other side from the beginning state)
I doubt anyone will use push_sats on mainnet in prod... but in our test environment it was very obvious since we use push_sats all the time, and everything is wonky because of it.
Also, should we be considering LOCAL_CHANNEL_OPEN capacity as debited funds?
Currently it shows
amount: 10 BTC, credit: false
for the channel open when I still control half the funds in the channel.Perhaps LOCAL_CHANNEL_OPEN should only "debit":
The text was updated successfully, but these errors were encountered: