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

lncli openchannel in psbt mode does not accept network serialized tx at final step #4330

Closed
SomberNight opened this issue May 27, 2020 · 2 comments · Fixed by #4601
Closed
Assignees
Labels
enhancement Improvements to existing features / behaviour feature request Requests for new features

Comments

@SomberNight
Copy link

SomberNight commented May 27, 2020

When trying open a channel using the CLI in psbt mode, at the last step, after the tx has been signed, lnd only accepts a finalized PSBT.
The PSBT at this point is a complete and signed transaction, as returned by an Input Finalizer.

What is the reasoning for not accepting a network serialized raw hex tx at that point, as returned by a Transaction Extractor?

I cannot see any technical reason why the finalized PSBT would be needed: the only extra information inside it (compared to the network tx) is potentially the input UTXOs, but even the presence of those is not guaranteed (and if they were there, they have already been seen by lnd in the earlier steps).

Context: Electrum currently does not expose the finalised PSBT to the user; only the network serialized tx. The "Transation Extractor" phase of the PSBT flow happens automatically. This makes the UX significantly simpler.

@Roasbeef Roasbeef added enhancement Improvements to existing features / behaviour feature request Requests for new features labels May 27, 2020
@Roasbeef
Copy link
Member

It's certainly possible to modify the interface to accept the final fully signed transaction. One thing we wanted to prevent (depending on how the client can interpret a partial PSBT where only the outputs are populated) is having a user create an invalid funding transaction, which possibly locks up their coins without interaction from the counter-party. Ideally the user always executes the verify call to ensure that they aren't at risk of this, with lnd broadcasting the final funding transaction in the end itself (which also lets it rebroadcast since the transaction will be stored in the wallet).

Roasbeef added a commit to Roasbeef/lnd that referenced this issue Jun 9, 2020
In this commit, we fix a deadlock that can happen if a user attempts to
init then rapidly unlock a wallet right after. In my profiles, it seems
the lnd gets caught up on the bbolt flock, which deadlocks the entire
process. We fix this issue by making the Init/Unlock calls now fully
synchronous. Only a single outstanding request can exist across the
entire wallet unlocker service now.

Fixes lightningnetwork#4330.

Fixes lightningnetwork#3631.
@guggero
Copy link
Collaborator

guggero commented Jul 20, 2020

When fixing this, we should also make sure that the funding flow is not aborted for simple encoding or copy/paste errors as described in point 1 of #4400.
Ideally we ask for the same input in a loop until either a non-nil error is received or the user aborts by pressing Ctrl+C.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvements to existing features / behaviour feature request Requests for new features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants