Commit graph

219 commits

Author SHA1 Message Date
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
6ff4a1de34
multi: parse and propagate unannounced/zero conf fields for sidecars 2022-10-18 04:34:22 -07:00
positiveblue
244f6f366b
rpcserver: add checks to validate submited orders
Check that we cannot submit inconsistent orders:
- Orders that may result in zero conf channels without supporting them.
2022-10-18 04:34:21 -07:00
positiveblue
8d54713cef
order: bump latest batch version to ZeroConfChannels 2022-10-18 04:34:21 -07:00
positiveblue
d47efba300
multi: parse and propagate channel announcement/confirmation constraints 2022-10-18 04:34:21 -07:00
Jason Brill
890c99b83a
rpc: handle 'StateExpiredPendingUpdate' case for account state 2022-10-13 15:36:36 -04:00
Oliver Gugger
701b999463
multi: calculate locked value based on account version 2022-09-12 17:20:12 +02:00
Oliver Gugger
d109f913c4
multi: remove global shutdown interceptor
During the integration tests we might want to shut down a trader client
through the admin RPC. If that closes the shutdown channel on a package
global interceptor, that means we can't start another trader client
during that test. We need to make sure we can pass in an interceptor for
each trader instance.
2022-09-12 17:20:12 +02:00
Oliver Gugger
9638c8a24b
order+rpcserver: add MuSig2 batch signing 2022-09-12 17:20:12 +02:00
Oliver Gugger
1e7c00a586
order+rpcserver: use account version in fee estimation 2022-09-12 17:20:11 +02:00
Oliver Gugger
a6c18a9bb1
multi: add new batch version for account auto-upgrade 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
986d889b74
multi: fix linter issues 2022-08-03 20:33:06 +02:00
Oliver Gugger
433a3c4bcf
rpcserver+server: bump minimum required lnd version to v0.14.3-beta
With lnd 0.15.0 almost out of the door, it is reasonable for us to ask
users to be on the latest 0.14.x version.
We use the walletrpc.SignPsbt method in Pool which was added in 0.14.2.
2022-06-30 15:39:48 +02:00
Oliver Gugger
7571464968
multi: add chain params and lnd version to account manager 2022-06-30 13:46:59 +02:00
Oliver Gugger
bd58d1e036
multi: improve trace logging 2022-06-17 14:51:02 +02:00
Oliver Gugger
1ba717c741
account+rpcserver: bump account key index on recovery
Fixes #372.
This commit fixes the issue that if the lnd node the trader client is
connected to was also restored from seed, it is starting at account key
derivation index 0. So when recovering accounts we need to make sure we
re-derive the right number of keys from the wallet in order to allow
properly creating new accounts with the recovered node.
2022-06-15 13:23:31 +02:00
Oliver Gugger
3508d7b9a4
multi: bump to latest lndclient and lnd versions 2022-06-01 16:16:57 +02:00
positiveblue
ae5df70783
order: populate allowed/not allowed fields 2022-04-22 00:25:18 -07:00
Oliver Gugger
a2722221fa
Merge pull request #354 from guggero/rollback-default-channel-type
rpcserver: roll back #330
2022-04-19 14:02:47 +02:00
positiveblue
777dce5e08
rpcserver: update recoveryPending attribute
The rpcserver cannot have more than one account recovery process running
at once. The server uses a internal attribute (`recoveryPending`) that
is set to true when a new recovery process starts. However, that
attribute was only set to false if the process ended successfully,
leaving the server unable to try more recoveries after a failure.
2022-04-12 15:26:41 -07:00
Oliver Gugger
bf74283ae2
rpcserver: roll back #330
To fix an accidental market segregation for lnd 0.14.x users that didn't
set an explicit channel type in their bid orders, we roll back the
changes from #330.
We can re-enable this default value selection once a large number of ask
orders support the new channel type.
2022-04-11 18:40:09 +02:00
Oliver Gugger
e8a0127c7d
rpcserver: marshall channel type in order list 2022-03-28 15:46:34 +02:00
positiveblue
6027ccd3d6
multi: bump btcec/v2 and btcutil to new versions 2022-03-28 15:22:41 +02:00
positiveblue
488ebd808a rpcserver: report lease expiries correctly
Thaw height is now absoulte (used to be relative). We could check the
channel type (for type SCRIPT_ENFORCED_LEASE is always absolute) but
we can simply follow the "500,000" value rule.
2022-03-14 23:08:23 -07:00
positiveblue
baf2042a0b
account: client side recovery skeleton 2022-01-27 23:01:37 -08:00
positiveblue
da2108cc82
account: add target to GenerateRecoveryKeys
The default value for server assisted is 500 but the user is able to
give us a hint of how many accounts we are looking for.
2022-01-26 01:17:31 -08:00
positiveblue
f74b90dd2f
rpcserver: split server vs client recovery process 2022-01-26 01:17:30 -08:00
Oliver Gugger
b1b9bd989b
rpcserver: fix nil version in subserver mode
A new variable for the connected lnd node's version was added but was
not given a value when run in subserver mode within LiT.
This commit uses the lnd service's cached version directly and removes
the uninitialized variable.
2022-01-14 14:12:08 +01:00
Oliver Gugger
7c2268fcbb
Merge pull request #330 from lightninglabs/default-script-chan-type
multi: remove static default channel types instead select them based on lnd's verison
2021-12-23 11:56:45 +01:00
Oliver Gugger
e52b1ff5a6
rpcserver+order: make batch version configurable 2021-12-22 09:47:45 +01:00
Oliver Gugger
65045066af
rpcserver+order: refactor ErrVersionMismatch into struct 2021-12-22 09:47:40 +01:00
Olaoluwa Osuntokun
b413ace060
rpc: default to the script enforced chan type if lnd supports it
In this commit, we use the prior commits to allow the server to
dynamically select a channel type based on the lnd version.
2021-12-17 18:02:51 -08:00
positiveblue
1589efe1ea
rpcserver: add Marshaler interface
The Marshaler interface is used to transform internal types to
decorated RPC ones.

It decouples that functionality form the rpcServer so it is easier to
test exhaustively.
2021-12-14 20:40:02 -08:00
positiveblue
29135cf864
account: add the account Manager interface 2021-12-14 20:40:02 -08:00
positiveblue
8365bfd5a8
order: add the order Manager interface 2021-12-14 20:12:40 -08:00
positiveblue
9e36c749b6
poolrpc: add auto_renew_extension_blocks to NextBatchInfoResponse 2021-12-02 22:55:21 -08:00
Oliver Gugger
7f2f481810
Merge pull request #305 from lightninglabs/auto-renew
multi: extend account expiry after using it
2021-11-29 16:03:21 +01:00
positiveblue
dae849c332
account: support expiry update for deposits/withdraws 2021-11-09 17:58:43 -08:00
Wilmer Paulino
2b3b29e33a
chaninfo: allow channel info submission for script enforced channels 2021-11-02 16:48:03 -07:00
Wilmer Paulino
f9c2861354
order+auctioneer: parse height hint from auctioneer's proposed batch
The auctioneer will now provide a height hint along with every proposed
batch it sends to traders. This height hint is then used by each trader
to base off their absolute lease expiration height, such that they can
agree on the same value and avoid any divergences due to block
propagation discrepancies between them.
2021-11-02 16:47:55 -07:00
Oliver Gugger
262eb198c5
multi: inform other side about ticket cancellation
To avoid the other side waiting for an update for a ticket that will
never come if it is canceled, we inform them instead.
2021-10-29 17:20:18 +02:00
positiveblue
3a2d356fbe
rpcserver: populate accounts with available balance
The `available_balance` of an account was only being populated for
`ListAccounts`. Populate the field in other operations like `deposit` or
`renew` could save the user some confusions.
2021-10-25 13:26:24 -07:00
Oliver Gugger
2fd67d40a5
Merge pull request #292 from lightninglabs/fix-account-conf-target-fee
rpcserver: fix feeRate when using conf target
2021-10-05 13:32:31 +02:00
positiveblue
abe2492749 rpcserver: handle invalid InitAccount parameters
Add check for requests with relative AND absolute height provided
instead of using the absolute one by default.

The same check for sats/kw and confirmation target has been moved to the
`switch` statement instead of having it in an extra `if`.
2021-10-04 10:21:15 -07:00
positiveblue
85916ebe16 rpcserver: fix feeRate when using conf target
The `feeRate` variable was shadowing inside the `req.GetConfTarget() > 0`
switch case. The server was returning an error when the `feeRate` was
estimated using the confirmation target.
2021-10-04 09:00:48 -07:00
positiveblue
68a38b34d7 account: use raw sat/byte when making an account
Generally the confirmation target is much less granular than a direct sat/byte
due to jumps in the confirmation confidence intervals. Changed the
account manager to take the `feeRate` instead of the `confTarget`. The
caller will be the one with the responsability of calculating the
`freeRate`. If the caller does not provide a value (`freeRate=0`) we
will calculate it from the default confTarget (6 blocks).
2021-09-29 21:14:08 -07:00
Oliver Gugger
e111facc28
rpcserver+poolrpc: add ListSidecars and CancelSidecar RPCs
With this commit we add two new RPCs for handling sidecar tickets.
ListSidecars will show all sidecar tickets known to the local database,
including those where our node is on the receiving end of a sidecar
channel.
CancelSidecar will cancel a specific sidecar ticket. If an order was
created for it, that bid order will be canceled. Doing so will make sure
the ticket isn't executed any further.
2021-09-29 15:41:34 +02:00
Oliver Gugger
7b2d457dd3
multi: update ticket state after submitting order
When manually submitting an order, we want to update the state of the
ticket in the main database to the same state that we update the ticket
that's stored within the orders's TLV data.
2021-09-29 15:41:34 +02:00