-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[bug]: SubscribeSingleInvoice
and SendPaymentV2
do not wait for the channel balance to be completely updated before returning
#9467
Comments
SubscribeSingleInvoice
and SendPaymentV2
do not wait for the internal balance to be completely updated before returningSubscribeSingleInvoice
and SendPaymentV2
do not wait for the channel balance to be completely updated before returning
Interesting observations would be interesting how much time switch (channel state maschine) lags behind. In general I am not quite sure if we should regard this as a bug and we might question whether such a testcase is reasonable. What you are observing is that the Switch (which handles the state transitions) needs a bit of time to exchange another round of commitment signatures to clear the htlc from the commitment state. However we are already in the possession of the preimage (bobs point of view) which means technically the payment happened. So the Maybe what we could do is, to list the htlcs in the But I don't think we need to sync the states as you were requiring in your inital statement, because receiving the preimage is the exact point in time when the payment happened. But maybe some other devs can jump in an share their view on this topic. Going to remove the |
I get what you are saying. I think it could be valuable to adjust ListChannels to provide more clarity. Also, for SubscribeInvoices, SubscribeSingleInvoice and SendPaymentV2, maybe we could add another status update after returning |
Think this is an issue described in |
Looking at https://github.com/lightninglabs/lightning-terminal/blob/66b0f15176aa9b12e2e624142b1e3acc40cc7277/itest/litd_custom_channels_test.go#L2934-L2993, why do |
Steps to reproduce (simplified by skipping channel reserve, etc.):
SendPaymentV2
and waits for a response to includestatus: SUCCEEDED
ListChannels
and checks and sees she now has 9 sat in the channel and bob still has 0SubscribeSingleInvoice
to wait for the invoice to be instate: SETTLED
ListChannels
and checks and sees he still has 0 sat and alice now has 9 satHowever, if they both then
ListChannels
, they both later see that bob has 1 sat as he shouldIf I follow the same process as above, but sending a taproot asset instead of sats, I'm seeing the same behaviour with the balance of taproot assets in the
custom_channel_data
field.For some reason both alice and bob are taking longer to update bob's change in channel balance. It's fine if it takes longer to do that, but
SubscribeSingleInvoice
andSendPaymentV2
should block before returningstate: SETTLED
andstatus: SUCCEEDED
.This creates lots of confusion for the node operator and with automated testing.
The text was updated successfully, but these errors were encountered: