Skip to content
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

repro: multifundchannel and all amount #7037

Merged
merged 3 commits into from Mar 21, 2024

Conversation

daywalker90
Copy link
Contributor

related issue: #6664

Using "amount": "all" is atleast in multifundchannel broken. I could not find a test for it so i wrote a simple test for it. Didn't know 100% where to put it or what to put for the @, but this test fails with:

pyln.client.lightning.RpcError: RPC call failed: method: multifundchannel, payload: {'destinations': [{'id': '022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59@localhost:35399', 'amount': 50000}, {'id': '035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d@localhost:42377', 'amount': 'all'}], 'minchannels': 2}, error: {'code': -1, 'message': 'Error broadcasting transaction: error code: -26\\nerror message:\\nbad-txns-in-belowout, value in (0.02) < value out (0.02045073). Unsent tx discarded 020000000001014953a8be36fba5a3be8813cb8464a5db17b9a5d59175e2f7d9205b36aaf9b2be0100000000fdffffff0250c30000000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd41711e0000000000220020b5534649d83864bf66a7c404ff30ee074a302e0095899686beb5d8dae0e3d87002473044022053a89a5c8f590220ae299cb4fcdaffe3bc134c7fe0402258298691485a2c23cf02206710c2332bd35ac2bcfb9e4a40b9459187f861b9cb9a3b9386c4abf20e09a799012103d745445c9362665f22e0d96e9e766f273f3260dea39c8a76bfa05dd2684ddccf66000000'}

important part: value in (0.02) < value out (0.02045073)

Expectation is that this test passes and not tries to inflate bitcoin.

@daywalker90
Copy link
Contributor Author

On mainnet this has the consequence of pending channels for 2 weeks and no way to open to most peers in that time since they only allow 1 pending channel at the same time. So no way to get liquidity to the same node for 2 weeks, even if you forget about the channel on cln's side, lnd nodes wont forget them without manual intervention.

@vincenzopalazzo
Copy link
Collaborator

Mh this looks like a bug! thanks for reproducing it

@cdecker cdecker added the state::repro A reproduction of an issue. Merging should be deferred until the underlying issue was addressed. label Feb 8, 2024
@cdecker cdecker changed the title tests: multifundchannel and "all" amount repro: multifundchannel and all amount Feb 9, 2024
@daywalker90
Copy link
Contributor Author

The amounts of the regular destinations seem to not be subtracted from the "all" amount destination

daywalker90 and others added 3 commits March 20, 2024 14:27
…all").

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
We tried to put *everything* into the "all" output, which didn't work
if there were other outputs!

Fixes: ElementsProject#6664
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: JSON-RPC: `multifundchannel` with `all` as an amount works as expected.
@rustyrussell
Copy link
Contributor

Great report! How's this?

@daywalker90
Copy link
Contributor Author

I've ran a bunch of tests on it and it works! Thank you for fixing this!

@rustyrussell rustyrussell merged commit 42207eb into ElementsProject:master Mar 21, 2024
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state::repro A reproduction of an issue. Merging should be deferred until the underlying issue was addressed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants