Commit graph

15257 commits

Author SHA1 Message Date
Slyghtning
14be2cdae0
itest: batch channel fee params 2023-07-26 09:49:22 +02:00
Slyghtning
47bcf7af69
funding: add all parameters to batch open channel 2023-07-26 09:49:22 +02:00
Slyghtning
6631741766
lnrpc: sync BatchOpenChannel and OpenChannel params 2023-07-26 09:49:20 +02:00
ziggie
a9ad0e5208
docs: add release-notes for 0.17.0. 2023-07-26 00:18:08 +02:00
ziggie
521a67c795
lnd: define additional rebroadcaster function.
The MapCustomBroadcastError of the rebroadcaster is defined.
This let's us use the Rebroadcaster of the neutrino package (pushtx)
with other backends and guarantee a consistent behaviour. Prior
to this change the rebroadcaster would stop rebroadcasting
transactions because they did not meet the neutrino specific
broadcastErr type.
2023-07-26 00:18:08 +02:00
ziggie
c88ff14477
contractcourt: add tests for mempool rejection.
Add a test where the channel arbitrator starts up correctly
when a prior unilateral close of a channel did not broadcast
for specific reasons.
Also add a test which ensures that when a crib output is
rejected by the bitcoin backend the startup works correctly
for specific errors.
2023-07-26 00:03:17 +02:00
Olaoluwa Osuntokun
9ed064be75
Merge pull request #7516 from hieblmi/utxo-funding
funding: fund channel with selected utxos
2023-07-25 19:19:42 +02:00
positiveblue
83ccf61df9
routing: fix index out of range panic
Make sure that we do not crash the node trying to access an invalid
position for an array (-1) in `BuildRoute`.
2023-07-25 10:13:26 -07:00
positiveblue
aadf385f67
routing: split BuildRoute
Create a couple of subroutines that we can unit test separately.
2023-07-25 10:12:55 -07:00
Oliver Gugger
7fdb55bd30
Merge pull request #7827 from carlaKC/cleanup-invoicetests
invoices/test: Cleanup Invoice Registry Tests
2023-07-25 13:15:34 +02:00
Oliver Gugger
0e0e8d8631
Merge pull request #7854 from matheusdtech/itest-network-conn
itest: bind to local addr in network test
2023-07-25 09:20:40 +02:00
ziggie
8314f0a879
contractcourt: handle mempool min fee error.
In case the mempool backend signals that our transaction does not
meet fee requirements when publishing it we will continue to
start up now. The transaction will be rebroadcasted in the
background and a specific log message will be printed to let the
user know that he could increase his mempool size to at least
have this transaction in his own mempool.
2023-07-25 01:13:24 +02:00
ziggie
54bacec422
lnwallet: add new ErrMempoolFee error. 2023-07-25 01:12:39 +02:00
ziggie
6da0f2a157
mod: bump version of neutrino and btcwallet. 2023-07-25 01:12:39 +02:00
Carla Kirk-Cohen
4645fdfb0a
invoice/test: make all tests parallel
When we have tests using global variables and a mix of parallel and
non-parallel tests, odd races can appear when we run them.
2023-07-24 10:54:03 -04:00
Carla Kirk-Cohen
94e434d2f1
invoices/test: move payment address required global into test using it 2023-07-24 10:54:02 -04:00
Carla Kirk-Cohen
d080d07a22
invoices/test: remove duplicate test invoice amount global
We have testInvoiceAmt and testInvoiceAmount with the same value.
2023-07-24 10:54:01 -04:00
Carla Kirk-Cohen
40f695743a
invoice/test: move payment address optional into test using it
No need for a global when this is only used once.
2023-07-24 10:54:00 -04:00
Carla Kirk-Cohen
ceff879f37
invoices/test: replace global testInvoice with constructor
For our relatively "static" test invoice, add a simple constructor
using the globals defined, rather than having a global invoice which
risks being mutated.
2023-07-24 10:53:58 -04:00
Matheus Degiovani
13399e9e81
itest: bind to local addr in network test
This makes the test work even if the local OS has no outside network
connections available or if DNS lookups are failing.
2023-07-24 08:47:26 -03:00
Slyghtning
23467cbb66
docs: update release notes 2023-07-24 13:07:01 +02:00
Slyghtning
396cffcd70
itest: anchor reserve test for SendOutputs 2023-07-24 13:07:01 +02:00
Slyghtning
baa1419187
chanfunding: fix typo 2023-07-24 13:07:01 +02:00
Slyghtning
f0579cc509
lncli: add flag utxos for openchannel 2023-07-24 13:07:01 +02:00
Slyghtning
e4f0e58214
lnd: handles selected outpoints in parseOpenChannelReq 2023-07-24 13:06:59 +02:00
Slyghtning
d327c92188
lnwallet: adds selected Outpoints for funding 2023-07-24 12:10:54 +02:00
Slyghtning
50acd49283
lnrpc: adds field Outpoints to fund a selected set of coins 2023-07-24 12:10:54 +02:00
Slyghtning
ac523f93ee
chanfunding: adds ability to fund a selected set of coins 2023-07-24 12:10:53 +02:00
Matt Morehouse
15f6e7a80a
htlcswitch: split mailCourier by courierType
The goroutine is very long and littered with switches on courierType. By
separating the implementations into different methods for each
courierType we eliminate the cruft and improve readability.
2023-07-20 14:53:46 -05:00
Slyghtning
37c0e521e8
scripts: add gpg key for Slyghtning [skip ci] 2023-07-20 16:28:21 +02:00
Matt Morehouse
e2f2b07149
peer: combine handleWarning and handleError
The two methods were nearly identical, so we can simplify by combining
them.
2023-07-19 12:40:16 -05:00
Oliver Gugger
c3cd93c98a
Merge pull request #7723 from morehouse/fuzz_zpay32_checksum
zpay32: improve fuzz tests
2023-07-19 16:58:44 +02:00
Matt Morehouse
9200abf96e
zpay32: allow fuzzer to choose invoice net
We add a parameter to select which network will be used for the fuzz
tests, rather than hardcoding the network.
2023-07-19 09:04:26 -05:00
Matt Morehouse
e5fcc57bbc
docs: release note for #7723 2023-07-19 09:04:22 -05:00
Matt Morehouse
bd7ec84497
zpay32: help fuzzer generate valid encodings
It is very difficult for the fuzzer to create a valid checksum for each
serialized invoice, and we were therefore unable to fuzz deeper than
invoice decoding. We can help the fuzzer generate valid serialized
invoices by calculating and appending the checksum ourselves.

We also switch to using mainnet invoices to make it easier to find valid
invoices for seeding the fuzzer. We prepend the required "lnbc" prefix
ourselves to further help the fuzzer generate valid invoices.
2023-07-19 09:04:18 -05:00
Matt Morehouse
82753f091b
zpay32: use message signer from unit tests
The message signer from invoice_test.go is identical to the one created
in the fuzz test. We're already using the private key from
invoice_test.go, so we may as well use the complete message signer for
simplicity.
2023-07-19 09:04:13 -05:00
Matt Morehouse
4207be6e50
zpay32: remove unused method calls
The fuzz tests call inv.MinFinalCLTVExpiry() and inv.Expiry() supposedly
to ensure the invoice is well-formed. However, those methods can never
panic or return errors and therefore provide no benefit for this
purpose.
2023-07-19 09:04:03 -05:00
Oliver Gugger
0d2f2aa802
Merge pull request #6895 from ellemouton/towerHasUnackedUpdates
wtclient: replay pending and unacked updates
2023-07-19 12:19:49 +02:00
Elle Mouton
7bf07d8875
docs: add release note for 6895 2023-07-19 10:10:15 +02:00
Elle Mouton
3ea67983b5
wtclient: replay un-acked updates onto pipeline
In this commit, the bugs demonstrated in prior commits are fixed. In the
case where an session has persisted a CommittedUpdate and the tower is
being removed, the session will now replay that update on to the main
task pipeline so that it can be backed up using a different session.
2023-07-18 16:28:27 +02:00
Elle Mouton
c432899bf9
watchtower: add DeleteCommittedUpdate DB method
Add a new DeleteCommittedUpdate method to the wtdb In preparation for an
upcoming commit that will replay committed updates from one session to
another.
2023-07-18 16:28:27 +02:00
Elle Mouton
cfb81c00a6
wtclient: tower with unacked updates cant be removed after restart
This commit demonstrates that if a session has persisted committed
updates and the client is restarted _after_ these committed updates have
been persisted, then removing the tower will fail.
2023-07-18 16:28:27 +02:00
Elle Mouton
af1506bff1
wtclient: demo "tower has unacked updates" bug
In this commit, we demonstrate the situation where a client has
persisted CommittedUpdates but has not yet recieved Acks for them from
the tower. If this happens and the client attempts to remove the tower,
it will with the "tower has unacked updates" error.
2023-07-18 16:28:26 +02:00
Elle Mouton
552ef4bf81
wtclient: replay pending tasks on sessionQueue stop
This commit does a few things:
- First, it gives the sessionQueue access to the TowerClient task
  pipeline so that it can replay backup tasks onto the pipeline on Stop.
- Given that the above is done, the ForceQuit functionality of the
  sessionQueue and TowerClient can be removed.
- The bug demonstrated in a prior commit is now fixed due to the above
  changes.
2023-07-18 16:28:26 +02:00
Elle Mouton
449d6b5500
wtclient: fix handleStaleTower comment 2023-07-18 14:27:14 +02:00
Elle Mouton
25c4d3f1f7
wtclient: make sessionQueueSet thread safe
In preparation for an upcoming commit where multiple threads will have
access to the TowerClient sessionQueueSet, we turn it into a thread safe
struct.
2023-07-18 14:27:04 +02:00
Elle Mouton
c4fec3ebc9
wtclient: show that bound tasks are not replayed
This commit demonstrates a bug. It shows that if backup tasks have been
bound to a session with a tower (ie, the tasks are in the session's
pendingQueue) and then the tower is removed and a new one is added, then
the tasks from the pendingQueue are _not_ replayed to the session with
the new tower. Instead, they are silently lost. This will be fixed in an
upcoming commit.
2023-07-18 14:26:51 +02:00
Elle Mouton
feb35e65d8
wtclient: show that a client can switch towers
This commit adds a new watchtower client test to demonstrate that a
client is able to successfully switch to a new tower and continue
backing up updates to that new tower.
2023-07-18 14:26:35 +02:00
Elle Mouton
d8af5fcc92
wtclient: ensure that waitForUpdates has no race condition on timeout
Enforce that the fail timeout in `waitForUpdates` is greater than the
ping timeout.
2023-07-18 14:25:58 +02:00
Elle Mouton
d979f59331
wtclient: move server specific methods to serverHarness 2023-07-18 14:15:46 +02:00