Commit graph

145 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
d1b9a63da5
order: add auction type field to order struct/db 2022-10-18 06:44:01 -07:00
positiveblue
a6b7196c1e
multi: parse and propagate IsPublic field for orders 2022-10-18 04:34:22 -07:00
positiveblue
05ff9e2635
order: add IsPublic field 2022-10-18 04:34:22 -07:00
positiveblue
40b2cfdd07
sidecar: new version for unannounced/zero conf channels
A sidecar ticket will always use the minimum version needed to encode
all the relavant information for that offer. In that way the tickets
from a provider with a newer version can be redeemed by recipeients
using older versions as long as the ticket does not encode new
functionalities.
2022-10-18 04:34:22 -07:00
positiveblue
8d54713cef
order: bump latest batch version to ZeroConfChannels 2022-10-18 04:34:21 -07:00
positiveblue
cdb92e11f0
multi: new batch version for unannounced channel and zero conf support 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
positiveblue
241f295957
order: add channel announcement and zero conf constraint fields
Includes the definition of matchable orders based on the new constraint
fields.
2022-10-18 04:34:20 -07:00
Oliver Gugger
701b999463
multi: calculate locked value based on account version 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
221ea0bcbe
order: allow account version upgrade during batch 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
986d889b74
multi: fix linter issues 2022-08-03 20:33:06 +02:00
positiveblue
0c062755a0
order: check node id filters when validating matches 2022-04-22 00:26:41 -07:00
positiveblue
ae5df70783
order: populate allowed/not allowed fields 2022-04-22 00:25:18 -07:00
positiveblue
4e564bb00b
mock: generate new mocks 2022-04-13 14:30:08 -07:00
positiveblue
c6fe105367
order: add DeleteOrder to store interface 2022-04-13 13:44:10 -07:00
positiveblue
573f86dc83
mod: update lndclient to use new SignOutputRaw 2022-04-04 11:35:20 +02:00
positiveblue
6027ccd3d6
multi: bump btcec/v2 and btcutil to new versions 2022-03-28 15:22:41 +02:00
Oliver Gugger
23d9b8da2b
order: only extend re-created accounts 2022-01-03 16:57:02 +01:00
Oliver Gugger
e9d65b20cf
order: fix linter complaint 2022-01-03 16:57:01 +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
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
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
c83f8a56e4
order: add functional options to allow caller to pick a default chantype
In this commit, we add a new set of functional options that will allow
the caller to pick an default channel type w/o forcing the main parse
function to be aware of this logic.
2021-12-17 18:02:46 -08:00
positiveblue
2f971db8cc
order: set ExtendedAccount as default batch version 2021-12-16 13:15:41 -08:00
positiveblue
5d93deab0f
order: generate mocks for order/interfaces.go
The `mockgen` tool seems to have a bug and it is not able to parse a
valid go file. I had to change the `[sha256.Size]byte` to `[size]byte`
and define `hashSize` in the order package in the same way it is defined in
the sha256 one.
2021-12-14 20:39:55 -08:00
positiveblue
8365bfd5a8
order: add the order Manager interface 2021-12-14 20:12:40 -08:00
positiveblue
f9b444131e
order: add ExtendAccountBatchVersion support
- Add new `ExtendAccountBatchVersion` batchVersion.
- Use the right batch verification flow depending on the version.
2021-11-30 20:18:28 -08: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
Wilmer Paulino
321e3c3598
order+auctioneer: allow submission of order channel type to auctioneer 2021-11-02 16:47:53 -07:00
Wilmer Paulino
f7dce585ba
order: introduce channel type field
Previously, the channel type was being recorded by the auctioneer only,
but there was no way for a trader to set its preference. Now that we
want to support that, we move the ChannelType definition to the Pool
source code, as done in this commit.

As part of introducing this new field, a new version bump was required
to compute the proper digest of each order.

To remain backwards compatible, we define the default channel type to be
"peer dependent". This implies that the channel type will vary based on
the node features shared between the asker and bidder. We also define a
new channel type to denote that channels resulting from matched orders
must have their lease expiration enforced in the scripts of their
commitment transactions.
2021-11-02 16:47:47 -07:00
Olaoluwa Osuntokun
9c5d6a17d4
order+account: account for new dust limit w/ smaller acct in test
For the batch verify test, the dust limit is now smaller by 160
satoshis, so we reduce the main account by this amount in order to
commit a minimal diff, rather than overhaul the test to be more robust.
2021-10-20 19:37:59 -07:00
Olaoluwa Osuntokun
d5f944e3fa
build: update to pin against current lnd v0.14.0 2021-10-20 19:25:48 -07:00
Olaoluwa Osuntokun
2dcc903495
sidecar: update ticket w/ new offer field to indicate auto negotiation 2021-05-09 19:24:56 -07:00
Olaoluwa Osuntokun
c9640659cc
funding: sign offered ticket w/ trader account key
This change allows us to later use a ticket as a means to authenticate
communication between the provider and the recipient of a sidecar
channel.
2021-05-09 19:24:54 -07:00
Oliver Gugger
1a68069bc2
order: add NewQuote function
We port over the order quote calculation from the CLI to the order
package so we can also offer the same calculation over RPC.
2021-05-05 15:55:45 +02:00
Oliver Gugger
71b7f419d8
order+funding: use correct multisig key
If we're the provider of a sidecar channel then we don't actually have
the private key of the funding multisig key. Therefore we cannot
re-derive it on demand and have to use the key provided in the sidecar
ticket instead.
2021-04-06 13:41:49 +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
2f56378898
order+clientdb: add sidecar ticket to bid order
With this commit we add the optional sidecar ticket to bid orders.
Because the node submitting the bid order doesn't necessarily need to be
the node creating the offer, we just store the ticket as is and don't
require it to be in the database already.
2021-04-02 14:18:10 +02:00
Oliver Gugger
4d6fdae004
funding+order: move DefaultBatchStepTimeout
We need to use the DefaultBatchStepTimeout variable outside of the
funding manager as well and move it to the order package to not create a
circular dependency when accessing it from the root package.
2021-03-19 16:50:32 +01:00
Oliver Gugger
0a5096ac55
order: validate self chan balance in deltas
When validating a batch we need to make sure that all three parties
(maker, taker, server) come up with the same account ending state after
matching a bid order with a push amount.
2021-03-19 16:50:32 +01: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
cbacb85f45
order: add SelfChanBalance field to bid orders
With this commit we add the new SelfChanBalance to the bid order. We
also add a new version for orders that signals compatibility with that
new field. A version increase on the ask side is needed to make sure the changes in
the asker's account balance are interpreted correctly on batch
validation.
2021-03-19 16:50:31 +01:00
Oliver Gugger
5a2bc0cde9
order: store local node pubkey
The order manager already stores the local lnd node's identity public
key. We return it in an exported method so the RPC server can access it
as well without needing to query it again.
To make sure we only allow querying it after the manager is started, we
add an atomic flag for the startup state.
2021-02-02 09:57:07 +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
Oliver Gugger
05626355ae
multi: use distinct clearing price per duration bucket 2021-01-08 14:02:14 +01:00