Commit graph

106 commits

Author SHA1 Message Date
Olaoluwa Osuntokun
7744d9d4bf
Merge pull request #104 from guggero/del-order-timestamp
Update order status to "failed" instead of deleting
2020-10-13 16:21:41 -07:00
Oliver Gugger
27903f77c4
rpcserver: update order status on failure
Instead of deleting the partial order (which had a bug in it that it
didn't remove the order creation timestamp) we for now only update its
status to failed. We'll want to implement proper housekeeping at one
point to get rid of archived orders. But for now we have the
--active_only flag that helps to easily filter out archived orders on
the command line.
2020-10-13 10:09:43 +02:00
Wilmer Paulino
f45245e8fc
order+rpc: introduce MinUnitsMatch field 2020-10-12 19:51:27 -07:00
Olaoluwa Osuntokun
0f42edccae
Merge pull request #89 from Roasbeef/bid-node-tiers
multi: add new node tier system for bids, a ratings endpoint for querying, and expose node+tier info in leases
2020-10-09 16:02:40 -07:00
Olaoluwa Osuntokun
479090f7d3 rpc: add node pubkey and ratings information to the leases response 2020-10-09 15:55:16 -07:00
Olaoluwa Osuntokun
032649b183 rpc+auctioneer: implement new NodeRatings end point 2020-10-09 15:55:16 -07:00
Olaoluwa Osuntokun
618fe0ad53 auctioneer+rpc: thread through new MinNodeTier for order submission/listing 2020-10-09 15:53:43 -07:00
Olaoluwa Osuntokun
4b41c323c7 poolrpc: add new calls for Bid node rating system, and node rating queries 2020-10-09 15:53:43 -07:00
Oliver Gugger
1af2e1c209
rpcserver: request proper shutdown on terminal error
When a terminal error is received, it is not enough to stop the server
itself to terminate the trader daemon because the main goroutine still
blocks on the read from the shutdown channel.
Instead we have to request a proper shutdown through the signal package
to initiate a full trader daemon stop.
2020-10-09 13:31:25 +02:00
Johan T. Halseth
1aec4b54b7
rpcserver: skip archived orders if active_only set 2020-10-07 11:24:05 +02:00
Olaoluwa Osuntokun
e7d1902231
Merge pull request #97 from Roasbeef/order-duration-buckets
multi: do away with min/max durations for bid/ask and move towards set order duration buckets
2020-10-05 18:13:51 -07:00
Olaoluwa Osuntokun
1ff491c0b6 rpc: don't accept order submission of invalid durations
In this commit, we restrict the validation in SubmitOrder to only accept
durations of orders that show up in the Terms call. The way this is
implemented, we'll be able to easily add new durations in the future
without modifying the client each time too much.
2020-10-05 17:57:16 -07:00
Olaoluwa Osuntokun
281f2a17d2 multi: unify min/max durations into single field of LeaseDuration
In this commit, we replace the existing min/max duration system with a
single field that expresses the expected duration of a lease. Note that
we've left some of the exiting logic in place that select a duration
from a bid in an attempt to make this more of a "soft fork" which will
allow any existing orders to be cleared out as normal before we switch
over.

Once we add multiple durations (this commit assumes a single duration),
we'll need to modify the verification logic to be able to handle
multiple clearing prices for a given batch.
2020-10-05 17:57:16 -07:00
Olaoluwa Osuntokun
aed85f5bd4 multi: label all account modification txns with optional prefix
In this commit, in order to make accounting for account
modification/creation transactions a bit easier, we'll now always add a
label describing the transaction within the account manager. The user is
also able to set their own prefix to the label as well to allow
insertion of custom meta data.
2020-10-05 17:54:10 -07:00
Oliver Gugger
f919298e58
rpcserver+clientdb: store match events for rejects
We also want to know whenever we reject a batch either fully or
partially so we also store an event for each involved order in case of a
reject message.
2020-10-01 13:16:58 +02:00
Oliver Gugger
80733657c5
rpcserver+clientdb: store match events for involved orders
We create and store an event every time an order is involved in a match
making process. We track the three distinct phases a batch goes through
from the trader's point of view so we can visualize this process in the
future.
2020-10-01 13:16:56 +02:00
Oliver Gugger
5e714c4f42
poolrpc+rpcserver: list order events in verbose mode
We add a new verbose flag to the ListOrdersRequest message that causes
the RPC server to include all events of an order in the response.
The orders are now also returned sorted by their creation timestamp.
2020-10-01 13:16:55 +02:00
Oliver Gugger
ab4a9175ec
rpcserver: extract dbOrderStateToRPCState
We'll add some more logic to ListOrders in a next commit so we try to
slim it down a bit by extracting the order state enum conversion.
2020-10-01 13:16:54 +02:00
Olaoluwa Osuntokun
316616d425
Merge pull request #87 from wpaulino/check-tor-addr-without-port
multi: check tor address without port
2020-09-18 12:48:33 -07:00
Wilmer Paulino
d99201399f
multi: check tor address without port
The underlying call to tor.IsOnionHost used to detect Tor addresses
requires the host only, without the port.
2020-09-18 10:54:26 -07:00
Olaoluwa Osuntokun
eb7020a060
multi: add order and clearing rate to leases, show absolute expiry 2020-09-17 17:40:30 -07:00
Wilmer Paulino
9becbf6231
clmrpc: add Leases RPC 2020-09-15 11:57:25 -07:00
Olaoluwa Osuntokun
1aaf24a4ad
Merge pull request #69 from guggero/abandon-retried-channels
Abandon replaced channels
2020-09-11 16:49:10 -07:00
Olaoluwa Osuntokun
b6152281bb
batch: connect out to the taker as maker if behind tor
In this commit, we modify our connection logic to accommodate tor nodes
that wish to sell channels. If we detect a node has even a single Tor
addr, then we'll also try to connect out to the taker that we're selling
a channel to.
2020-09-10 20:22:45 -07:00
Oliver Gugger
de2b86bd28
rpcserver: call AbandonCanceledChannels for replaced batch 2020-09-10 13:47:17 +02:00
Olaoluwa Osuntokun
1e0035d3d4
multi: fix import order 2020-09-09 19:55:16 -07:00
Olaoluwa Osuntokun
ffc9c60b13
multi: rename project from llm to pool 2020-09-09 19:55:10 -07:00
Olaoluwa Osuntokun
fc2bec5cab
orders: deny wumbo orders if lnd node isn't wumbo enabled
Fixes #27.
2020-09-08 16:37:29 -07:00
Olaoluwa Osuntokun
37d4468831
Merge pull request #63 from wpaulino/account-recovery-latest-tx
auctioneer: use StateInitiated for pending/open recovered accounts
2020-09-08 16:22:32 -07:00
Olaoluwa Osuntokun
4f6dc814db
rpc: return reject message if batch parsing fails
Before this commit, if parsing failed, then the entire daemon would
actually shutdown.
2020-09-04 15:38:27 -07:00
Wilmer Paulino
203627643b
clientdb: avoid serialization of latest tx in StateCanceledAfterRecovery
The latest transaction is also not known here, so we shouldn't serialize
it.
2020-09-04 11:36:25 -07:00
Johan T. Halseth
7e55458ff6
clmrpc: add ReservedValue to listorders 2020-09-03 15:22:50 +02:00
Wilmer Paulino
4c83a6663c
rpc: add BumpAccountFee RPC 2020-09-02 12:30:07 -07:00
Wilmer Paulino
f71adf7b67
multi: re-purpose account close tx field to latest tx 2020-09-02 12:10:23 -07:00
Wilmer Paulino
c1ebc0a5f3
rpc: check nil funds destination in CloseAccountRequest
This addresses a panic when the funds destination field of the request
is not populated.
2020-08-27 15:17:04 -07:00
Oliver Gugger
2c3b85dba2
fundingmgr+rpcserver: rename timeout, use explicit type
We are going to use the same timeout for multiple different things and
rename it to be more generic. At the same time we use route.Vertex
instead of [33]byte to make things easier to read.
2020-08-25 09:57:54 +02:00
Olaoluwa Osuntokun
b6a9637b3e
Merge pull request #43 from guggero/new-nodes-only
Partial Batch Reject [1/2]: Reject batch partially on funding error or duplicate nodes
2020-08-24 18:41:51 -07:00
Wilmer Paulino
dba558578a
rpc: add funds destination oneof for CloseAccount
This is essentially the RPC variant of the fee expression found when
closing accounts.
2020-08-24 13:33:17 -07:00
Oliver Gugger
f0766e4514
clmrpc+rpcserver: remove nonces from OrderMatchAccept 2020-08-24 17:47:21 +02:00
Oliver Gugger
68c2f9ae41
rpcserver+fundingmgr: reject matches with existing peers
If a trader wishes to only get channels from new peers, we check each
match against all nodes we already have open or pending channels with.
We don't look at pending closing channels in case a trader wants to buy
new channels as soon as one closed out.
2020-08-24 17:47:20 +02:00
Oliver Gugger
496af7173e
multi: add NewNodesOnly flag
Add a new flag that can specify that a trader only wants channels from
nodes it doesn't already have a channel with.
2020-08-24 17:47:20 +02:00
Oliver Gugger
02bd5a7ef8
order+rpcserver: send correct RPC reject message 2020-08-24 17:47:20 +02:00
Oliver Gugger
4c4c5a2e43
fundingmgr: return matchRejectErr on funding failure 2020-08-24 17:47:12 +02:00
Oliver Gugger
e53190862d
rpcserver+fundingmgr: de-duplicate peer connections
To avoid a race error in lnd when we try to connect to the same node
twice in a short interval, we instead de-duplicate the connection
attempts by node pubkey and only try connecting once per remote peer.
2020-08-21 15:19:49 +02:00
Oliver Gugger
e457d08b01
rpcserver+fundingmgr: extract funding into fundingMgr struct
With this commit we decouple everything funding related from the RPC
server and move the logic into the fundingMgr struct.
2020-08-21 15:19:48 +02:00
Oliver Gugger
06797752c1
rpcserver: move funding related code to own file
This is a pure code move as a preparation for creating a funding manager
struct that handles all the funding related tasks.
2020-08-21 15:19:48 +02:00
Oliver Gugger
75bf4e020a
rpcserver+order: remove funding shim on subsequent prepare
Because we have to always expect an OrderMatchPrepare to be sent
multiple times, we need to make sure we clean up our funding shims from
the previous pending batch.
2020-08-21 15:19:44 +02:00
Oliver Gugger
7fb4ef9782
order+rpcserver: enforce order duration limit and multiple 2020-08-18 13:38:35 +02:00
Oliver Gugger
fa05add3b7
account+rpcserver: handle consecutive batch confirmations
This commit allows the account manager to handle the situation where
an account participates in multiple consecutive batches that might still
be in the mempool. Once the first batch confirms, the database state of
the account might differ from the batch key used in that earlier batch.
We need to cancel old spend and conf watches and only watch the latest
batch for confirmation. While an account is in this pending batch state, no
user modification like deposits or withdrawals are allowed so it's safe
to just jump to the latest batch and wait for confirmations on that one.
2020-08-17 13:53:04 +02:00
Oliver Gugger
584d4e032e
rpcserver: allow orders to be submitted in StatePendingBatch 2020-08-17 11:44:30 +02:00