Commit graph

613 commits

Author SHA1 Message Date
Oliver Gugger
671f430b88
multi: use funding manager as BatchCleaner
If we detect we have a pending batch in the local database that was
replaced by a different transaction, we try to clean up funding shims
and pending channels on startup as well.
To allow that, we use the funding manager as the BatchCleaner
implementation.
2020-12-09 09:42:31 +01:00
Oliver Gugger
5098fe1ccb
auctioneer+server: add new BatchCleaner interface
To prepare for using the funding manager to do the actual cleanup of a
pending batch, we extract the cleanup itself into a new interface.
2020-12-09 09:42:31 +01:00
Oliver Gugger
90b6e8c598
server: initialize funding manager in server
We'll soon need a reference to the funding manager in the server, so we
can pass it to the auctioneer client. To enable that, we initialize and
use it in the server instead of the rpcserver.
2020-12-09 09:42:30 +01:00
Oliver Gugger
b589cb7e70
clientdb: remove unused pending batch TX key
Because we now only use the batch TX from the local pending batch
snapshot, the redundant information in the pending batch TX key is not
needed anymore.
2020-12-09 09:42:30 +01:00
Oliver Gugger
8b57bb9a4e
multi: replace PendingBatch with PendingBatchSnapshot
To be able to fully clean up an old, pending batch snapshot on daemon
startup, we first need to switch to a method that returns the full
snapshot instead of just its ID.
2020-12-09 09:42:30 +01:00
Oliver Gugger
4b2291aaa8
clientdb: add fetchPendingBatchSnapshot
In preparation for loading the full local pending batch snapshot instead
of only the ID when starting the daemon, we add a new function to the
database to retrieve the snapshot.
2020-12-09 09:42:29 +01:00
Oliver Gugger
e07f6cbdce
Merge pull request #187 from guggero/manager-refactor
refactor: move funding manager into own package, make it clean up pending batches
2020-12-09 09:40:20 +01:00
Oliver Gugger
f936a70317
funding+rpcserver: extract channel cleanup into funding mgr
Since it's ultimately the funding manager's job to clean up
non-finalized pending channels and/or funding shims, we move that
functionality into the manager now.
2020-12-09 09:16:43 +01:00
Oliver Gugger
4a728a864c
funding: use base client
To make testing easier and give the funding manager access to the
freshly refactored cleanup functions, we switch them over to use the
funding manager's base client interface instead of the full RPC client
interface.
2020-12-09 09:16:42 +01:00
Oliver Gugger
02cd3ffa28
multi: move cleanup functions to funding package
To delegate the pending batch cleanup to the funding manager, we first
need to move the cleanup functions into the funding package.
2020-12-09 09:16:42 +01:00
Oliver Gugger
2cd6381e25
order: demote scary sounding warn message to debug
Since this error caused quite some confusion among our users, we demote
it to info and change the text to further explain what's happened.
If a trader is involved in a batch and the channel funding fails in the
batch sign phase, a pending channel is never created in lnd. If the next
batch prepare message comes in, we try to clean up all pending channels
of the previous attempt. Because the channel negotiation failed and
there is no pending channel, cleaning up fails with this message.
2020-12-09 09:13:42 +01:00
Oliver Gugger
43ecf1d320
order+rpcserver: refactor AbandonCanceledChannels into function
We also need to make the channel abandonment independent of a particular
format of a pending batch, so we refactor it into a standalone function
instead of a method on the in-memory batch format.
2020-12-08 11:25:13 +01:00
Oliver Gugger
aa7f4a228f
order+rpcserver: refactor CancelPendingFundingShims into function
We want to be able to clean up after a pending batch that is replaced.
We want to do this for both in-memory pending batches but also for
persisted local snapshot batches on startup. Therefore we need to
refactor the cleanup methods into independent functions.
2020-12-08 11:25:13 +01:00
Oliver Gugger
5a60adc605
funding+rpcserver+log: move funding manager to own package
To not clutter the main package namespace with too much functionality,
we move the funding manager into its own package.
2020-12-08 11:25:12 +01:00
Oliver Gugger
6c2deae310
fundingmgr+rpcserver: prepare to extract funding manager
We want to move the funding manager into its own package in the next
commit. This commit prepares everything we can to make the actual move
as simple as possible.
2020-12-08 11:25:12 +01:00
Oliver Gugger
4f7cfe31fc
fundingmgr+rpcserver: remove quit chan, use update chan directly
By passing in the quit channel where needed, we make the
funding manager a bit less stateful and easier to reason about.
By sending channel updates to the funding manager's update chan
directly, we also make it more clear who's responsible for processing
the updates.
2020-12-08 11:24:13 +01:00
Olaoluwa Osuntokun
d2852c13fd
Merge pull request #188 from guggero/bump-0.3.4
build: bump version to v0.3.4-alpha
2020-12-07 14:15:39 -08:00
Oliver Gugger
00c42dd87a
build: bump version to v0.3.4-alpha 2020-12-07 22:28:19 +01:00
Johan T. Halseth
91aa076044
Merge pull request #165 from guggero/batch-rpcs
Add RPC to query multiple batches
2020-12-01 12:08:10 +01:00
Oliver Gugger
4dd9eb8c6c
order: add DecrementingBatchIDs
To make iterating over batch IDs easier, we add a new helper function
that returns all batch IDs starting at the start key (inclusive) and
ending at the end key (inclusive) by decrementing the public keys. If
the end key cannot be reached by decrementing the start key by a maximum
of 10k times, we abort and return the first 10k items (without the end
key).
2020-11-30 23:44:27 +01:00
Oliver Gugger
380646704f
cmd/pool: add num_batches to snapshot command 2020-11-30 23:44:27 +01:00
Oliver Gugger
fde059c096
poolrpc: add batch query RPCs 2020-11-30 23:44:22 +01:00
Oliver Gugger
ae75931d1b
make+poolrpc: add rpc-format command 2020-11-30 23:20:51 +01:00
Wilmer Paulino
91ce637950
Merge pull request #182 from cryptagoras/patch-2
cmd/pool: fix typo on account deposit
2020-11-30 11:46:57 -08:00
cryptagoras
08b822ea57
cmd/pool: fix typo on account deposit 2020-11-28 12:35:52 +02:00
Johan T. Halseth
925533d618
Merge pull request #178 from guggero/account-fix
Add debug CLI and wrap errors
2020-11-27 13:45:17 +01:00
Johan T. Halseth
09be9fb73f
Merge pull request #179 from guggero/relevant-snapshot-fix
Fix startup error because of wrong RPC
2020-11-25 12:48:55 +01:00
Johan T. Halseth
1ff8e796a2
Merge pull request #181 from wpaulino/context-canceled-logs
log+watcher: avoid log of manual context canceled error
2020-11-25 12:48:02 +01:00
Olaoluwa Osuntokun
76e9929b5d
Merge pull request #180 from wpaulino/close-account-order-state
rpc: avoid query of auctioneer order state for terminal orders
2020-11-24 16:12:09 -08:00
Wilmer Paulino
8208acb4df
rpc: avoid query of auctioneer order state for terminal orders 2020-11-24 11:07:08 -08:00
Wilmer Paulino
ad9ef3f3ff
log+watcher: avoid log of manual context canceled error 2020-11-24 10:59:06 -08:00
Wilmer Paulino
ae50ee788b
account: fix account key in logs 2020-11-24 10:58:46 -08:00
Oliver Gugger
1e28ec0c63
auctioneer: wrap errors
To get more information about where exactly an error occurs, we wrap it
with additional information.
2020-11-24 14:46:37 +01:00
Oliver Gugger
0ed405f55c
auctioneer: use BatchSnapshot instead of RelevantBatchSnapshot
Because the RelevantBatchSnapshot RPC didn't return the raw batch
transaction at all, traders with a pending batch crashed here. We don't
necessarily need to know anything other than the transaction bytes here
so we might as well call the other RPC.
2020-11-24 14:40:00 +01:00
Oliver Gugger
246d685179
cmd/pool: add debug commands 2020-11-24 14:28:02 +01:00
Oliver Gugger
9714deb848
multi: specify DB filename when opening clientdb
To make it possible to open any DB in the debug CLI, we allow specifying
the file name too instead of only the path.
2020-11-24 14:27:45 +01:00
Oliver Gugger
394c6c1747
rpcserver: export marshall functions
To make it possible to re-use the marshall functions in the debug CLI,
we export them in the RPC server.
2020-11-24 14:27:40 +01:00
Oliver Gugger
09195d6552
Merge pull request #164 from guggero/active-accounts-only
Show active accounts only by default
2020-11-24 11:40:26 +01:00
Oliver Gugger
c40b8e4f91
Merge pull request #175 from guggero/fix-rest
server: fix REST connection
2020-11-24 11:40:02 +01:00
Oliver Gugger
058307a18f
server: fix REST connection
Because of a misplaced defer of a context cancel, the REST proxy didn't
work at all before the fix in this commit.
2020-11-24 11:28:00 +01:00
Oliver Gugger
6f046b585f
server: remove incorrect additional TLS listener wrap
If the REST listener is not nil at this point, it is always already
wrapped in a TLS listener and doesn't need to be wrapped again.
2020-11-24 11:27:59 +01:00
Oliver Gugger
c1636137e2
cmd/pool: add show_archived flag to list command 2020-11-24 11:25:52 +01:00
Oliver Gugger
dc28c3b857
rpcserver: avoid shadowing package names 2020-11-24 11:25:51 +01:00
Oliver Gugger
2119b01396
rpcserver: consider ActiveOnly flag in ListAccounts 2020-11-24 11:25:51 +01:00
Oliver Gugger
8677b0f92e
account: add IsActive() to State 2020-11-24 11:25:51 +01:00
Oliver Gugger
fbdf455cb5
poolrpc: add active_only flag to ListAccounts 2020-11-24 11:25:46 +01:00
Olaoluwa Osuntokun
245ddcf19b
Merge pull request #169 from guggero/docs-update
docs: update FAQ and quickstart doc
2020-11-23 17:57:39 -08:00
Oliver Gugger
2e08eb7ce1
docs: mention LSAT payment 2020-11-20 10:17:19 +01:00
cryptagoras
178ad564f6
docs/faqs: update on-chain fee payers info
closes #166
2020-11-20 09:58:30 +01:00
Olaoluwa Osuntokun
7f4610096c
build: bump version to v0.3.3-alpha 2020-11-12 16:00:17 -08:00