Commit Graph

9916 Commits

Author SHA1 Message Date
Matheus Degiovani
3e1b4eadbb itest: switch to openChannelTimeout
This switches a few call sites that used a different timeout when
openening channels to the correct openChannelTimeout, which better deal
with flakes in the CI.
2020-07-13 13:24:22 -03:00
Matheus Degiovani
af660d0152 itest: improve backup check during wt test
This replaces an outstanding sleep for a check for a specific state
during the test for watchtower use: specifically, that the backup has
been sent to the watchtower prior to shutting down Dave.

This reduces flakiness in the test that could occur if the Dave shutdown
without the backup being comitted to the watchtower, causing the rest of
the test to fail.
2020-07-13 13:24:22 -03:00
Matheus Degiovani
91538884da lntest: wait for valid tls cert and macaroon files
This changes the wait during node connection to check both for the
existance as well as for the validity of the tls cert and macaroon
files.

This ensures that nodes in the process of starting up don't inadvertedly
cause a connection error due to not yet having written the entire file.
2020-07-13 13:24:22 -03:00
Matheus Degiovani
9f036b4310 lntest: wait for graph subscription on node init
During the channel_backup_restore/restore_during_unlock itest, the node
is restored from seed and immediately restarted. Depending on specific
timing of the machine, the test harness might not have had the graph
subscription processed before the node shuts down, causing the harness
to trigger a panic.

Reducing this to a synchronous subscription attempt means node
initialization necessarily waits until the subscription is done before
attempting to restart, reducing flakiness and ensuring correct behavior.
2020-07-13 13:24:22 -03:00
Matheus Degiovani
f52ee770f4 lntest: use ctx when not using macaroons
This forces the Dial attempt to succeed or fail before proceeding with
node setup.

We also log on the node a failure to establish the graph subscription
before panicking so that we can more easily find issues.
2020-07-13 13:24:22 -03:00
Matheus Degiovani
19873f721f lntest: more descriptive errors for CloseChannel
This improves the error reporting for the harness' CloseChannel so that
the exact step where closure fails can be better indicated.

This is to help debug some flaky failures in the CI.
2020-07-13 13:24:22 -03:00
Conner Fromknecht
60446494e9
Merge pull request #4157 from carlaKC/2472-newbucketforresolutions
contractcourt: Persist Resolution Outcomes
2020-07-07 12:14:58 -07:00
carla
177c314f06
lntest: add resolver report assertions to force close test 2020-07-07 19:50:13 +02:00
carla
1d5d616da3
lnrpc: add channel resolutions to closed channels 2020-07-07 19:50:12 +02:00
carla
d8a4b37c0e
contractcourt: persist commit sweep resolutions 2020-07-07 19:49:58 +02:00
carla
d0ec872ef3
contractcourt: store htlc timeout sweeps 2020-07-07 19:49:57 +02:00
carla
a38dc256fd
contractcourt: persist remote outgoing htlc claim outcome on disk
When a remote peer claims one of our outgoing htlcs on chain, we do
not care whether they claimed with multiple stages. We simply store
the claim outgome then forget the resolver.
2020-07-07 19:49:56 +02:00
carla
03b76ad9a4
contractcourt: save htlc success resolvers, including first stage
Checkpoint our htlc claims with on chain reasolutions, including our
first stage success tx where required.
2020-07-07 19:49:55 +02:00
carla
eb07f89090
contractcourt/test: add test context for success resolver 2020-07-07 19:49:54 +02:00
carla
cf739f3f87
contractcourt: persist timed out incoming htlc resolver reports
Incoming htlcs that are timed out or failed (invalid htlc or invoice
condition not met), save a single on chain resolution because we don't
need to take any actions on them ourselves (we don't need to worry
about 2 stage claims since this is the success path for our peer).
2020-07-07 19:49:54 +02:00
carla
f5b20b7429
contractcourt: store anchor resolutions on disk 2020-07-07 19:49:53 +02:00
carla
0a01d5d17c
contractcourt: add resolver report function to ContractReport
Our current set of reports contain much of the information we will
need to persist contract resolutions. We add a function to create
resolver reports from our exiting set of resolutions.
2020-07-07 19:49:52 +02:00
carla
fa46db9c48
multi: add resolver reports to Checkpoint
To allow us to write the outcome of our resolver to disk, we add
optional resolver reports to the CheckPoint function. Variadic params
are used because some checkpoints may have no reports (when the resolver
is not yet complete) and some may have two (in the case of a two stage
resolution).
2020-07-07 19:49:51 +02:00
carla
8c8f857f60
contractcourt: add PutResolverReport function to chanArb config 2020-07-07 19:49:50 +02:00
carla
578af99618
channeldb: save resolver outcomes in close summaries top level bucket
Add a new top level bucket which holds closed channels nested by chain
hash which contains additional information about channel closes. We add
resolver resolutions under their own key so that we can extend the
bucket with additional information if required.
2020-07-07 19:49:36 +02:00
Wilmer Paulino
9e8c39d4a2
Merge pull request #971 from vctt94/addMaxValueFlag
Add max value in flight flag
2020-07-07 10:29:51 -07:00
Olaoluwa Osuntokun
3a2f3504a5
Merge pull request #4281 from Roasbeef/host-ann
netann: add new HostAnnouncer to support dynamic IPs via domains
2020-07-06 18:12:15 -07:00
Olaoluwa Osuntokun
ba3688c3b9
netann: add new HostAnnouncer to support dynamic IPs via domains
In this commit, we add a new sub-system, then `HostAnnouncer` which
allows a users without a static IP address to ensure that lnd always
announces the most up to date address based on a domain name. A new
command line flag `--external-hosts` has been added which allows a user
to specify one or most hosts that should be periodically resolved to
update any advertised IPs the node has.

Fixes #1624.
2020-07-06 17:30:08 -07:00
Olaoluwa Osuntokun
854a12e4c6
Merge pull request #4347 from Crypt-iQ/peer_pkg_0518
peer: Brontide Peer implementation
2020-07-06 17:24:15 -07:00
nsa
cbd54101f8 multi: remove peer.go, change all references to point to peer pkg 2020-07-06 19:16:07 -04:00
nsa
9be9d69349 multi: initialize peer with peer.Config 2020-07-06 19:16:07 -04:00
nsa
bf161c9835 peer+server: add HandleLocalCloseChanReqs to peer, call from server 2020-07-06 19:16:07 -04:00
nsa
e1632dd172 peer.go: handleCloseMsg function for channelManager goroutine 2020-07-06 19:16:07 -04:00
nsa
1a91013c14 peer_test+test_utils: remove duplicate *LightningChannel return param
It was already present in the peer object that was returned.
2020-07-06 19:16:07 -04:00
nsa
02fd905f61 peer.go: moving the apply function outside of the constructor
This is mainly for readability so that the function isn't indented.
2020-07-06 19:16:07 -04:00
nsa
4ee4a1a24e peer.go: remove height argument to addLink function
Best height is not needed to create a link.
2020-07-06 19:16:07 -04:00
nsa
328094d8fb peer.go: replace switch statements with if statements 2020-07-06 19:16:06 -04:00
nsa
0dda9e06ce multi: exporting PendingUpdate, ChannelCloseUpdate, ErrorBufferSize 2020-07-06 19:16:06 -04:00
nsa
ac3d416b04 peer_test.go: fixes to coop close tests, modifying variable names
to either be alice or bob-prefixed. This helps an observer understand
what the test is actually doing.
2020-07-06 19:16:06 -04:00
nsa
ac72479b10 server.go: log DisconnectPeer errors, use public functions to access
peer internals.
2020-07-06 19:16:06 -04:00
nsa
bfaef46579 peer_test.go: comment clarifications 2020-07-06 19:16:06 -04:00
nsa
d23b30d889 peer.go: comment clarifications, improved formatting 2020-07-06 19:16:06 -04:00
nsa
01415f4a5f peer: define Config and LinkUpdater interface
This commit defines a Config for initializing a peer and the
LinkUpdater interface.
2020-07-06 19:16:06 -04:00
nsa
50186ba834 lnpeer/peer.go: modifying interface comment 2020-07-06 19:16:06 -04:00
Joost Jager
f9c6a1b73f
Merge pull request #4418 from joostjager/anchor-vectors
lnwallet/test: anchor vectors
2020-07-06 13:38:28 +02:00
Joost Jager
16577d7d0e
lnwallet/test: anchor test vectors 2020-07-06 12:45:17 +02:00
Joost Jager
1c775d131b
lnwallet/test: close database after test 2020-07-06 12:45:15 +02:00
Joost Jager
c65f60b101
lnwallet/test: convert test vectors to json 2020-07-06 12:45:13 +02:00
vctt94
2f6a8b13ae fundingmanager: Add max value to fundingmanager and fundingmanager_test 2020-07-03 11:09:40 -03:00
vctt94
6845763aa5 lncli: Add max_value_in_flight flag to openchannel 2020-07-03 11:09:34 -03:00
Olaoluwa Osuntokun
2d4facf940
Merge pull request #4428 from wpaulino/relative-thaw-height
multi: add relative thaw height interpretation
2020-07-02 15:37:23 -07:00
Wilmer Paulino
6075997ebc
multi: add relative thaw height interpretation
This is useful when we wish to have a channel frozen for a specific
amount of blocks after its confirmation. This could also be done with an
absolute thaw height, but it does not suit cases where a strict block
delta needs to be enforced, as it's not possible to know for certain
when a channel will be included in the chain. To work around this, we
add a relative interpretation of the field, where if its value is below
500,000, then it's interpreted as a relative height. This approach
allows us to prevent further database modifications to account for a
relative thaw height.
2020-07-02 12:05:49 -07:00
vctt94
8ebdfe3128 lnrpc: Add MaxValueInFlight flag 2020-07-02 15:50:26 -03:00
vctt94
474ce4ae25 server: Add max value in flight to server 2020-07-02 15:49:19 -03:00
Conner Fromknecht
01ba4d0b59
Merge pull request #4371 from yyforyongyu/expose-channel-constraints
lnrpc: expose all local and remote channel constraints
2020-07-01 16:45:35 -07:00