-
Notifications
You must be signed in to change notification settings - Fork 912
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
'withdraw all' fails when 'utxos' specified; leaves UTxOs unavailable #3591
Comments
Problem 1 also occurs when attempting to |
I experienced it too with
|
@darosior: Okay, then what is the recommended way to withdraw (or fund a channel with) exactly a set of UTxOs without producing a change output? The |
|
But I don't know what the fee will be. If I specify the whole sum of the UTxOs, then there won't be anything left for the fee, and if I specify too little a sum, then I'll inadvertently generate a change output, which is what I'm trying to avoid. |
Yes, that's the well-known problem of fees computation, that's why it's better automated :-) |
@whitslack ok I tried to reproduce and I think I understood the root cause : were you using unconfirmed utxos ? EDIT: btw I was badly wrong, |
@darosior: No. I was specifying exactly one confirmed UTxO, and I was specifying an explicit feerate using the |
Weird.. Then I cannot reproduce on current master. Cf #3593 for the unconfirmed case.. |
Maybe it's already been fixed since the 0.8.1 release. I'll retest after the next release and update here with my findings. |
@whitslack has this been fixed? |
@niftynei: I don't know. There hasn't been a new release since 0.8.1. I'll update this issue again after there's been a new release and I've retested. |
Oh I see, apologies I didn't quite grok that you were waiting til the next release to test :) |
We already handle this correctly, as these tests show, and these tests are in released 0.8.2.1: lightning/tests/test_wallet.py Line 172 in 7a7b154
lightning/tests/test_connection.py Line 872 in 7a7b154
@whitslack please confirm if ok to close. |
I just tested this again on 0.8.2.1 and got a different failure:
I was withdrawing with
So it looks like there's somewhere that C-Lightning is rounding down where it ought to be rounding up. On the plus side, the UTxO that I tried to spend is still listed in |
FWIW, you can use 253perkw for the moment.
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
Le mardi, juin 9, 2020 7:36 PM, Matt Whitlock <notifications@github.com> a écrit :
… I just tested this again on 0.8.2.1 and got a different failure:
{
"code": -1,
"message": "Error broadcasting transaction: error code: -26\\nerror message:\\nmin relay fee not met, 109 < 110 (code 66). Unsent tx discarded"
}
I was withdrawing with feerate=1000perkb, which should be the minimum-allowed fee rate. Indeed, bitcoin-cli getmempoolinfo reports:
{
"loaded": true,
"size": 15097,
"bytes": 9207924,
"usage": 32831760,
"maxmempool": 64000000,
"mempoolminfee": 0.00001000,
"minrelaytxfee": 0.00001000
}
So it looks like there's somewhere that C-Lightning is rounding down where it ought to be rounding up.
On the plus side, the UTxO that I tried to spend is still listed in listfunds after the failure.
—
You are receiving this because you were mentioned.
Reply to this email directly, [view it on GitHub](#3591 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AFLK3F7OBGXNX4CRGPQHI5DRVZXIBANCNFSM4LI5KLKA).
|
That worked. And my withdraw spent only the UTxO that I asked it to, and it spent the whole thing without creating a change output. 👍 |
I'll give the rounding error a look (greping logs on my nodes currently to check it doesn't happen on other code path.. Which might be worrying). |
1000perkb == 250perkw. It may have to do with us rounding down consistently as in C, and Bitcoin rounding up consistently because they have magic C++ code to do that or something (or maybe they just consistently round up from sheer code review). In practice we should probably use 253perkw as a minimum and also check that perkb units are greater than 253perkw when converted. |
Wouldn't that just kick the can? Then when |
Hmm, looks like an issue then. Suggest closing this one and opening another? |
Filed #3771, closing this. |
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
Issue and Steps to Reproduce
Attempting the same withdrawal a second time yields:
Indeed, the specified
<txid>:<vout>
is no longer returned inlightning-cli listfunds
. The UTxO does appear again after adev-rescan-outputs
, but obviously this is risky and shouldn't be needed.So there are really two problems here:
all
of a specified set of UTxOs while deducting enough from their total value to satisfy the specified fee rate.getinfo
outputThe text was updated successfully, but these errors were encountered: