Commit Graph

95 Commits

Author SHA1 Message Date
shaurya947
db44924c5a
lnwallet: add Memo to InitFundingReserveMsg
We also pass the value of Memo from funding/manager.go.
2023-05-18 13:02:30 -04:00
shaurya947
7c6faa4c98
funding: add Memo to InitFundingMsg struct
We add byte-array field called Memo to the InitFundingMsg struct.
We also provide a value for this from
rpcserver.go#parseOpenChannelReq().
2023-05-18 13:02:30 -04:00
Oliver Gugger
8df4edef1b
Merge pull request #7624 from ellemouton/marshalBytesAndStringTxid
multi: populate both string and byte TXID in lnrpc.Outpoint
2023-05-08 17:32:54 +02:00
Carla Kirk-Cohen
3f9f0ea5d1
multi/refactor: separate methods for get and set node announcement
In preparation for a more complex function signature for set node
announcement, separate get and set so that readonly callers don't need
to handle the extra arguments.
2023-05-04 10:35:42 -04:00
Elle Mouton
ef17b12a86
funding: update "funding locked" in error string
Replace a few uncaught instances of "funding locked" found in error
strings with "channel_ready"
2023-04-27 20:03:44 +02:00
Elle Mouton
9ea3f55694
multi: update "funding locked" comments
Replace a few un-caught instances of "funding locked" in some comments
with "channel_ready"
2023-04-27 20:02:34 +02:00
Elle Mouton
7b186716a1
multi: populate both string and byte TXID in lnrpc.Outpoint
This commit adds a a new `MarshalOutPoint` helper in the `lnrpc` package
that can be used to convert a `wire.Outpoint` to an `lnrpc.Outpoint`.
By using this helper, we are less likely to forget to populate both the
string and byte form of the TXID.
2023-04-24 16:19:26 +02:00
Elle Mouton
784dc8d530
funding: use default fwding policy if persisted values not found
In this commit, a bug is fixed in the funding manager that could result
in the funding process erroring out if the persisted initial forwarding
policy is not found. This could occur if a node restarts after opening a
channel that is not yet fully confirmed and also upgrades their node
from a pre-0.16 version to 0.16 since the values are only expected to be
persisted after 0.16.
2023-04-19 11:51:32 +02:00
Oliver Gugger
af70af2710
funding+server: update switch after sending channel update
With this commit we give the funding manager the ability to inform the
switch about custom channel policies, right after we've announced the
channel to the network.
This change is necessary because before #6753 a channel could only be
opened with the default forwarding policies, so the switch automatically
had the "correct" default values. Since #6753 added the ability to
specify forwarding policies at channel open time, we announced those
policies to the network but never updated the switch to inform it about
the changed policies (previously changing the policies was only possible
through the UpdateChannelPolicy RPC which did call the switch).
2023-04-18 09:40:18 +02:00
Oliver Gugger
68881f5c20
funding: refactor manager test 2023-04-18 09:40:17 +02:00
Torakushi
0445fef7ad
funding: use p2tr by default for batch_open_channel
In LND v0.15.1, batch_open_channel used p2tr by default
for change output. However, in a later version, a breaking
change has been fixed in FundPSBT to make the change type
configurable (default to p2wkh). As batch_open_channel
uses FundPsbt, we need to put back p2tr as default for
change output
2023-04-17 17:37:51 +02:00
Slyghtning
94900acaa0 funding unit: fundmax sanity check for new channel commitment types. 2023-04-05 23:10:04 +02:00
Slyghtning
5d88693852 lnd+lnwallet: fundmax flag for openchannel 2023-04-05 23:09:11 +02:00
Bjarne Magnussen
0e5b3e77cb lnd: handles the FundMax field inside parseOpenChannelReq
Adds handling of the `FundMax` field when parsing an
`OpenChannelRequest` with `rpcServer.parseOpenChannelReq`.
2023-04-05 23:05:07 +02:00
yyforyongyu
dc3f83c670
funding+lnwire: rename and fix make lint
Fix linter and rename `funding_locked.go` to `channel_ready.go`
2023-03-17 18:21:59 +08:00
yyforyongyu
d4ad5f362f
funding: replace fundingLocked found in docs
This commit is created by running,
```shell
find . -name "*.go" -exec sed -i '' 's/fundingLocked/channelReady/g' {} \;
```
2023-03-17 18:21:59 +08:00
yyforyongyu
465285efb8
funding: replace fundingLocked with channelReady 2023-03-17 18:21:59 +08:00
yyforyongyu
6b9217acfc
multi: replace FundingLocked related docs
This commit replaces `FundingLocked` found in docs using the following
command,
```shell
find . -name "*.go" -exec sed -i '' 's/FundingLocked/ChannelReady/g' {} \;
find . -name "*.go" -exec sed -i '' 's/FundingLock/ChannelReady/g' {} \;
```
2023-03-17 18:21:59 +08:00
yyforyongyu
f8a8326141
multi: replace FundingLocked and funding_locked strings
This commit is created by running the following commands,
```shell
find . -name "*.go" -exec sed -i '' 's/\"FundingLocked/\"ChannelReady/g' {} \;
find . -name "*.go" -exec sed -i '' 's/FundingLocked\"/ChannelReady\"/g' {} \;
find . -name "*.go" -exec sed -i '' 's/\ funding_locked/\ channel_ready/g' {} \;
```
2023-03-17 18:21:59 +08:00
yyforyongyu
015446559b
funding+lnwire: rename FundingLocked related tests
This commit is created by running the following commands,

```shell
gofmt -d -w -r 'fundingLockedAlice -> channelReadyAlice' .
gofmt -d -w -r 'fundingLockedBob -> channelReadyBob' .
gofmt -d -w -r 'assertHandleFundingLocked -> assertHandleChannelReady' .
gofmt -d -w -r 'assertFundingLockedSent -> assertChannelReadySent' .
gofmt -d -w -r 'aliceFundingLocked -> aliceChannelReady' .
gofmt -d -w -r 'bobFundingLocked -> bobChannelReady' .
gofmt -d -w -r 'FuzzFundingLocked -> FuzzChannelReady' .
gofmt -d -w -r 'newMsgFundingLocked -> newMsgChannelReady' .
gofmt -d -w -r 'TestFundingManagerReceiveFundingLockedTwice -> TestFundingManagerReceiveChannelReadyTwice' .
gofmt -d -w -r 'TestFundingManagerRestartAfterReceivingFundingLocked -> TestFundingManagerRestartAfterReceivingChannelReady' .
```
2023-03-17 18:21:59 +08:00
yyforyongyu
539cae1999
multi: rename fundingLockedMsg to channelReadyMsg
This commit is created by running,
```shell
gofmt -d -w -r 'fundingLockedMsg -> channelReadyMsg' .
```
2023-03-17 18:21:59 +08:00
yyforyongyu
112dc1faca
funding: rename FundingLocked related functions and variables
This commit is created by running the following commands,
```shell
gofmt -d -w -r 'sendFundingLocked -> sendChannelReady' .

gofmt -d -w -r 'handleFundingLockedMtx -> handleChannelReadyMtx' .

gofmt -d -w -r 'handleFundingLockedBarriers -> handleChannelReadyBarriers' .

gofmt -d -w -r 'receivedFundingLocked -> receivedChannelReady' .

gofmt -d -w -r 'handleFundingLocked -> handleChannelReady' .

gofmt -d -w -r 'fundingLockedSent -> channelReadySent' .

gofmt -d -w -r 'checkPeerFundingLockInterval -> checkPeerChannelReadyInterval' .
```
2023-03-17 18:21:58 +08:00
yyforyongyu
2dc08a2a76
multi: rename NewFundingLocked to NewChannelReady
This commit is created by the following command,

```shell
gofmt -d -w -r 'NewFundingLocked -> NewChannelReady' .
```
2023-03-17 18:21:58 +08:00
yyforyongyu
1b7c56b2ed
multi: rename FundingLocked to ChannelReady
This commit is created by running,

```shell
gofmt -d -w -r 'FundingLocked -> ChannelReady' .

gco master channeldb/migration
```
2023-03-17 18:21:58 +08:00
yyforyongyu
3f6315242a
funding: fix itest flake with pending channels 2023-02-24 01:35:16 +08:00
yyforyongyu
edba938996
multi: add new build tag integration
This commit adds a new build tag `integration` and removes the old tag
`rpctest` for clarity. Multiple unnecessary usages of `build !rpctest`
is also removed.
2023-02-23 21:56:09 +08:00
bitromortac
dd5273c88c
multi: rename due to required maxHTLC bit
We rename `ChanUpdateOptionMaxHtlc` to `ChanUpdateRequiredMaxHtlc`
as with the latest changes it is now required.

Similarly, rename `validateOptionalFields` to
`ValidateChannelUpdateFields`, export it to use it in a later commit.
2023-02-21 11:10:39 +01:00
Oliver Gugger
e4f3a35c0c
funding: fix peer key serialization in log message 2023-02-07 22:15:09 +01:00
yyforyongyu
f9ede5af73
funding+lnwallet: add more debug logs 2023-01-17 07:26:57 +08:00
Slyghtning
b47cf7e871 funding: code style cleanup for the funding package 2023-01-12 22:40:51 +10:30
Elle Mouton
d4a49b08f5
funding: check error to avoid panic during test
This commit, the error returned from `getInitialFwdingPolicy` is checked
in order to avoid a nil pointer dereference panic during the
TestFundingManagerCustomChannelParameters test.
2022-12-22 10:06:42 +02:00
Oliver Gugger
55b53555e9
multi: improve readability of goroutine defers
This commit fixes the readability of some of the defer calls in
goroutines by making sure the defer stands out properly.
2022-11-21 13:54:24 +01:00
yyforyongyu
5805363867
funding: mark tx label before notifying channel open event 2022-11-15 18:58:26 +08:00
yyforyongyu
4b558c3af5
funding: decrease checking interval to be 10ms in itest
When waiting for the peer to send us FundingLocked, we check whether
we've received this message periodically. This commit changes the
checking interval from 1s to 10ms in itest, which allows us to still
stop the CPU spike while responding to the message quickly.
2022-11-10 13:59:14 +08:00
yyforyongyu
8761a9a056
funding: wait for one sec if funding locked is not received 2022-11-02 02:02:49 +08:00
Tony Giorgio
09537596fc
funding+lnwire: remove ErrSynchronizingChain 2022-10-28 10:06:59 -05:00
positiveblue
4d4d8e480c
multi: stop casting peer warning messages as errors
Split the logic for processing `error` and `warning` messages from our
peers.
2022-10-26 08:09:08 -07:00
Oliver Gugger
d2d3cf3408
Merge pull request #6956 from ellemouton/configureChanReserve
multi: configurable remote chan reserve
2022-10-13 15:39:40 +02:00
Eng Zer Jun
19b1eb9617
funding: replace defer cleanup with t.Cleanup
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-10-13 17:47:03 +08:00
Matt Morehouse
768854aac9
funding: create waitForPeerOnline helper
Simplifies and deduplicates the code.
2022-10-11 11:59:01 -05:00
Elle Mouton
eeed3e6f39
funding: fix formatting of comments of InitFundingMsg 2022-10-07 14:57:05 +02:00
Roei Erez
6467b0ee12
funding: enable configurable channel reserve
In this commit, the channel reserve of an initiated channel is made to
be optionally configurable.
2022-10-07 14:57:05 +02:00
Elle Mouton
10f0eddd51
multi: verify channel constraints on funding request
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.
2022-10-07 14:57:05 +02:00
eugene
79e618268d
funding: ignore maxWaitNumBlocksFundingConf for zero conf channels
This is so that if the funding transaction hasn't been confirmed
in 2016 blocks, the channel isn't marked as closed by the responder.
2022-10-06 19:34:54 -04:00
Slyghtning
6ea89a51af unit: openchannel fee update and db tests 2022-09-29 08:31:48 -04:00
Slyghtning
e87412bd63 funding+channeldb: handle and persist channel fees 2022-09-29 08:21:06 -04:00
Matt Morehouse
54474d5cd7
funding: fix potential data race
localDiscoverySignals needs to be guarded by its mutex.  I was unable to
write a test case that would trigger a race under the race detector, but
better safe than sorry.
2022-09-19 10:55:45 -05:00
Eng Zer Jun
4f1e4ff87a
funding: use T.TempDir to create temporary test directory
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-08-24 08:58:16 +08:00
eugene
16067ca908
funding: defer sending channel_update until received funding_locked
This is required by BOLT#07 as otherwise the counter-party will
discard the channel_update as they may not consider the channel
"ready" or reorg-safe. Most other implementations besides eclair
have work-arounds for this, but it is nice to be spec-compliant.
2022-08-12 17:48:25 -04:00
eugene
c2a4a9adbc
multi: add zeroconfacceptor that default rejects if no rpc acceptors
This is a safety mechanism so that zero-conf channels are not accepted
by default if no rpc acceptor exists.
2022-08-12 16:30:42 -04:00