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

multi: configurable remote chan reserve #6956

Merged
merged 6 commits into from
Oct 13, 2022

Conversation

ellemouton
Copy link
Collaborator

@ellemouton ellemouton commented Sep 29, 2022

In this PR, the remote channel reserve amount is made to be configurable.
Up until now, it has always just been 1% of the channel capacity.

This is just an updated of this pr. The original author has been preserved as
commit author where it applies.

Fixes #1083

Related #800

Copy link
Collaborator

@guggero guggero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice and clean PR.

funding/manager_test.go Show resolved Hide resolved
lnrpc/lightning.proto Outdated Show resolved Hide resolved
rpcserver.go Outdated Show resolved Hide resolved
rpcserver.go Outdated Show resolved Hide resolved
Copy link
Collaborator Author

@ellemouton ellemouton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for review @guggero 🚗 updated!

funding/manager_test.go Show resolved Hide resolved
Copy link
Collaborator

@guggero guggero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

@lightninglabs-deploy
Copy link

@sputn1ck: review reminder

Copy link
Collaborator

@sputn1ck sputn1ck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the changes, when using a lower than accepted remote reserve sats, my funds where locked until I restarted lnd. Is that expected? The other peer is using the tagged release 0.15.1-beta

./lncli-debug -n regtest listunspent
{
        "utxos": [
                {
                        "address_type": 4,
                        "address": "bcrt1p7r5fzhfvaa03zghds7cedkzw3zzssr9ctvy6mcjcrpkkm74fkj6sfdvf2x",
                        "amount_sat": 1000000,
                        "pk_script": "5120f0e8915d2cef5f1122ed87b196d84e8885080cb85b09ade258186d6dfaa9b4b5",
                        "outpoint": "3264a46325894726614c097f1cd6300b1f388a95c9e5849c4a4559026d17112b:0",
                        "confirmations": 3
                }
        ]
}
./lncli-debug -n regtest openchannel --remote_reserve_sats=100 02d0830a548c670525ae0f17c8c2f2d9a3f0c520da0cc75591394198092e46ce1a 50000
[lncli] rpc error: code = Unknown desc = channel reserve of 100 sat is too small, min is 354 sat
./lncli-debug -n regtest listunspent
{
        "utxos": []
}

@ellemouton
Copy link
Collaborator Author

ahhhh you are completely right @sputn1ck! Thanks for catching this. Have updated it so that the cancelReservationCtx is called upon failure of constraint verification 👍

Copy link
Collaborator

@sputn1ck sputn1ck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new changes fixed the reservation issue, however now I don't see any response when calling
./lncli-debug -n regtest openchannel --remote_reserve_sats=100 02d0830a548c670525ae0f17c8c2f2d9a3f0c520da0cc75591394198092e46ce1a 50000

ellemouton and others added 6 commits October 7, 2022 14:57
In this commit, the sanity checks in the CommitConstraints method is
moved out into a helper function called VerifyConstraints. This is done
so that the sanity checks can be performed more easily else where in the
code base. The new helper method is then called in the
handleInitFundingMsg method of the funding manager before the
OpenChannelMessage is sent.
In this commit, the channel reserve of an initiated channel is made to
be optionally configurable.
Copy link
Collaborator

@sputn1ck sputn1ck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, tACK LGTM 🚀

@guggero guggero merged commit d2d3cf3 into lightningnetwork:master Oct 13, 2022
@ellemouton ellemouton deleted the configureChanReserve branch October 13, 2022 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

startup option for channel_reserve_satoshis (LND)
5 participants