Commit graph

105 commits

Author SHA1 Message Date
Oliver Gugger
e768140d1e
cmd/pool+auctioneer: fix default number of keys during recovery
This commit fixes an issue where the derivation index of an account was
greater than the default number of keys we attempted during account
recovery.
2023-02-08 16:45:57 +01:00
positiveblue
7669c7ffde
multi: parse and propagate auction type field for orders 2022-10-18 06:51:55 -07:00
positiveblue
a6b7196c1e
multi: parse and propagate IsPublic field for orders 2022-10-18 04:34:22 -07:00
positiveblue
d47efba300
multi: parse and propagate channel announcement/confirmation constraints 2022-10-18 04:34:21 -07:00
Oliver Gugger
312e206dac
multi: implement taproot accounts 2022-09-12 17:20:11 +02:00
Oliver Gugger
a63985d614
multi: add account version to RPCs and manager 2022-09-12 17:20:10 +02:00
Oliver Gugger
bd58d1e036
multi: improve trace logging 2022-06-17 14:51:02 +02:00
Oliver Gugger
581d7ca5d6
auctioneer: add new server account state to recovery 2022-06-08 12:41:23 +02:00
Oliver Gugger
0d92b407c0
Merge pull request #360 from lightninglabs/missing-order-state
order: Mark missing orders as failed in the client db
2022-05-03 20:13:54 +02:00
positiveblue
1b48f7c6a6
auctioneer: populate node id filter lists 2022-04-22 00:26:40 -07:00
positiveblue
1b578c47bb
order: Mark missing invoices as failed in the client db 2022-04-21 23:47:59 -07:00
positiveblue
6027ccd3d6
multi: bump btcec/v2 and btcutil to new versions 2022-03-28 15:22:41 +02:00
Oliver Gugger
cd3b6b65bb
auctioneer+order: rename CurrentBatchVersion->LatestBatchVersion
To make sure the CurrentBatchVersion isn't used anywhere as the default
version anymore by accident, we explicitly rename it.
2021-12-22 09:47:45 +01:00
Oliver Gugger
1f50c7839a
server+auctioneer: make batch version configurable 2021-12-22 09:47:44 +01:00
positiveblue
cb53898136
auctioneerrpc: add auto_renew_extension_blocks to TermsResponse 2021-12-02 22:53:46 -08:00
Wilmer Paulino
321e3c3598
order+auctioneer: allow submission of order channel type to auctioneer 2021-11-02 16:47:53 -07:00
Oliver Gugger
429b28b110
multi: prepare for upcoming lnd v0.14.0-beta release 2021-10-20 19:25:54 -07:00
Oliver Gugger
c8afe06fc5
auctioneer: fix stream nil panic
We were missing a few selects on the quit channel which could lead to us
making another iteration in the loop while the server stream was already
set to nil. We fix that by making sure we always return one way or
another if the quit channel is closed.
Just to make the panic impossible to happen again, we also return from
the loop early if the server stream is nil, just in case.
2021-08-20 16:43:17 +02:00
Oliver Gugger
edf67bc1b0
auctioneer: fix linter issue
The new version of RPC structs contains an internal lock and therefore
they shouldn't be memory copied anymore. The linter fortunately picked
up on this and warned us, so we pass in the pointer here directly
instead.
2021-07-29 14:01:24 +02:00
Oliver Gugger
a6f7d8445e
auctioneer: retry connection (almost) forever 2021-07-23 17:15:17 +02:00
Oliver Gugger
3deb8df8be
auctioneer+rpc: react to correct error if auth fails
It turns out that on startup the auctioneer can get overwhelmed if
hundreds of traders try to authenticate all at once. So some of them run
into a timeout (which sounds like it's the trader's fault but the
timeout covers the whole 3-way handshake and is actually delayed by the
server, not the client) which wasn't handled correctly.

We now inspect the correct error if the authentication fails and try
reconnecting.
2021-07-23 17:15:17 +02:00
Olaoluwa Osuntokun
3369357053
auctioneer: add client methods for HashMail stream deletion 2021-05-24 22:28:49 -07:00
Olaoluwa Osuntokun
05cb020997
rpc: add automated sidecar negotiation for the recipient
In this commit, we add automated sidecar negotiation for the recipient.
We'll use the new expose mailbox system to communicate with the provider
of the ticket to incrementally transform and complete it.

We add a new state machine attached to the sidecar acceptor that drives
the sidecar ticket to completion. We have two main states to handle:
sending the ticket w/ our node's information to the provider, and then
waiting for the final ticket from the provider that contains the order
information.

rpc: add automated ticket negotiation for the sidecar provider

In this commit, we add automated ticket negotiation for the sidecar
provider. The provider's state machine is a bit more involved as it
needs to do more in order to finalize the ticket. It starts by making a
new stream, and waiting for the recipient to send over the sidecar
information with their node information. From there it submits the bid,
checkpoints the state, and then adds the bid information before sending
the ticket back to the recipient.
2021-05-09 19:25:06 -07:00
Olaoluwa Osuntokun
d1eff48e83
auctioneer: extend client w/ HashMail stream related methods 2021-05-09 19:24:49 -07:00
Oliver Gugger
8d9371e962
auctioneer+auctioneerrpc: add SubscribeSidecar server RPC 2021-04-06 13:36:31 +02:00
Oliver Gugger
2b46e31e6c
multi: add sidecar ticket to RPC bid order
The local database can now store a sidecar ticket with a bid order. We
now also need to accept it on the local RPC interface and forward it to
the auctioneer.
2021-04-06 13:36:30 +02:00
Oliver Gugger
f56eb50981
auctioneer+account: rename SubscribeAccountUpdates
The name SubscribeAccountUpdates could indicate that this is a
long-running operation. The method returns after successful
authentication of the stream though. That's why we rename it to
StartAccountSubscription and update the comment to make it more clear
that this should return after a few seconds at the most.
2021-04-02 14:18:11 +02:00
Oliver Gugger
2a790a1884
multi: add self chan balance to order submission RPCs
With everything prepared we now parse the self chan balance from the
client request and set it on the server request.
2021-03-19 16:50:31 +01:00
Oliver Gugger
30bf63635c
auctioneer+poolrpc+rpcserver: add market info to getinfo call
With the server now exposing this new RPC, we want to add the output of
it to the getinfo call to give users an idea what the current market
situation looks like.
2021-03-17 13:08:48 +01:00
kon
4537447933 auctioneer: add tor proxy 2021-02-04 09:58:57 +01:00
Oliver Gugger
25622682ae
auctioneer: add mutex for subscribedAccts
Because the subscribedAccts map is potentially also accessed by multiple
goroutines at the same time, we add a mutex for it as well.
2021-02-02 09:57:13 +01:00
Oliver Gugger
42c6ac72f2
auctioneer: move mutex lock inside connectServerStream
This commit fixes a missing mutex lock in the SendAuctionMessage. To
make it possible to hold it there, we need to remove the deferred unlock
in connectAndAuthenticate into connectServerStream. Otherwise we'd run
into deadlocks.
2021-02-02 09:57:11 +01:00
Oliver Gugger
6134952464
auctioneer: add IsSubscribed method
The IsSubscribed() method informs about the subscription connection
status to the auctioneer server.
2021-02-02 09:57:09 +01:00
Oliver Gugger
e245576d70
auctioneer+server: send user agent to auctioneer
Send the static user agent plus the dynamic initiator string (if
provided) to the auctioneer in the InitAccount and SubmitOrder RPCs.
2021-01-29 12:56:23 +01:00
Oliver Gugger
83b458b504
multi: move auctioneer proto to auctioneerrpc package
As a preparation to extract the auctioneer proto package into its own
sub-module, we move it out of the poolrpc package.
2021-01-22 10:41:44 +01:00
Wilmer Paulino
bcdd267e22
rpc: add RenewAccount RPC 2021-01-08 14:02:25 +01:00
Oliver Gugger
83795453c7
multi: expose duration bucket state 2021-01-08 14:02:10 +01:00
Oliver Gugger
31b832ae80
multi: remove max order duration
Because the order/lease duration is now governed by the lease durations,
the maximum order duration is no longer needed.
2021-01-08 14:02:09 +01:00
Oliver Gugger
1f265865cf
order+auctioneer: rename batch versions to avoid confusion
Because the batch Versions are in the order package, the use of
order.DefaultVersion is confusing and not clear to be related to the
version of the _batch_, just from its name. We fix that by renaming the
versions of the batch.
2021-01-08 14:02:06 +01:00
Oliver Gugger
8e12f3b86c
auctioneer: map closed account state correctly on recovery
This commit fixes a wrong assumption the recovery was implemented with.
The auctioneer will only switch to the closed state once the closing TX
confirms. We therefore shouldn't map this to pending closed as that'll
try to re-broadcast the close TX (which fails for confirmed
transactions).
2021-01-04 18:14:18 +01:00
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
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
fde059c096
poolrpc: add batch query RPCs 2020-11-30 23:44:22 +01: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
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
Wilmer Paulino
8c0c6f49e2
auctioneer: include input sig scripts for account deposits
This ensures that the auctioneer can arrive at the correct transaction
such that it can continue to track the state of the account on the
chain.
2020-11-09 18:01:38 -08:00
Wilmer Paulino
1e7864eeca
auctioneer: add next batch tick and fee params to Terms RPC 2020-10-30 16:28:00 -07:00
Wilmer Paulino
8173e4874a
auctioneer: cancel order with nonce preimage instead
This prevents traders from canceling an order that does not belong to
them. Previously, the order nonce was required, but this could be
learned from any trader by matching with it throughout batch execution.
2020-10-21 13:10:54 -07:00