-
Notifications
You must be signed in to change notification settings - Fork 3.4k
lnwallet: zeroconf/just-in-time improvements and tests #10463
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
Open
f321x
wants to merge
9
commits into
spesmilo:master
Choose a base branch
from
f321x:jit_2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
297aed9
lnpeer: check just-in-time channel opening fee
f321x 1f17574
lnchannel: fix update_unfunded_state, add unittest
f321x 2da9fbb
lnworker/config: check if zeroconf is enabled when forwarding
f321x f56e1ca
lnworker: stop setting static jit alias for jit channel
f321x 2eac67b
open_channel_just_in_time: add cleanup and broadcast retry
f321x a3f1250
tests: add unittests for LNWallet just in time opening
f321x 85356e5
lnwallet: make jit fees configurable, add mining fees
f321x a06c8ba
lnpeer: don't signal OPTION_ZEROCONF_OPT to untrusted peer
f321x a4af5cf
qt: ReceiveTab: fix flickering zeroconf message
f321x File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if the electrum server is lying by omission? maybe we should not delete the channel...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, maybe we should only freeze it for receiving and then delete it after
has_funding_timed_outbecomes true. This would leave much more time to connect to a honest server and find the funding tx if it really has been omitted.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok 1f17574 now freezes the channel after 10 minutes without funding transaction and deletes the channel after
has_funding_timed_out(~2 weeks). If the channel gets funded it is unfrozen.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why wait 10 minutes? should we not freeze it by default, and unfreeze it when we detect the funding tx?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree this would be simpler.
As freezing the channel doesn't prevent the channel peer from sending htlcs through it we could simply not release the preimage for any htlc(set) that arrived on a zeroconf channel without funding tx (except for the first one which pays for the channel).
In practice the funding tx should become visible in the mempool quickly, so we wouldn't have to fail any htlcs that already made it to us during this time period.
If the electrum server omits the transaction, we could either fail after some timeout, or the user restarts the wallet, we connect to a different server that tells us about it and can still settle.
On first thought this seems like an acceptable tradeoff, what do you think?