Commit graph

24 commits

Author SHA1 Message Date
positiveblue
e5d78fd3cb
multi: update order/batch verification for outbound liquidity auctions 2022-10-25 05:42:18 -07:00
positiveblue
6027ccd3d6
multi: bump btcec/v2 and btcutil to new versions 2022-03-28 15:22:41 +02:00
Oliver Gugger
65045066af
rpcserver+order: refactor ErrVersionMismatch into struct 2021-12-22 09:47:40 +01: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
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
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
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
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
Wilmer Paulino
e9031a4885
order: enforce min units match in batch verification 2020-10-12 19:51:29 -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
Wilmer Paulino
d6ccb71ff9
order: check order rate against matched batch clearing price 2020-09-16 15:41:37 -07: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
Oliver Gugger
3df4e2f005
multi: move FeeSchedule to terms package
As a preparation to avoid package import cycles when introducing more
generic terms, we move the FeeSchedule interface and its
LinearFeeSchedule implementation to the terms package.
2020-08-18 13:15:34 +02:00
Oliver Gugger
668bc2c279
multi: copy lndclient mocks from loop repository
As a preparation to get rid of the loop dependency, we copy the mocks we
need from the test package of that dependency and use them in our tests.
2020-08-11 10:44:24 +02:00
Johan T. Halseth
a2abc187f3
multi: rename FundingFeeRate to MaxBatchFeeRate
The funding feerate field was previoulsy unused, so we rename it to
"max batch fee rate" in order to use it to communicate to the server the
maximum fee rate we are willing to pay to be included in a batch.

We also increase the default value to 500 sat/vbyte.
2020-08-07 16:34:07 +02:00
Olaoluwa Osuntokun
e31c176f6c
order: increase precision for the smallest per-block lease rate
This is a follow up to #21. In this PR increase the fixed rate
denominator from 1e6 to 1e9 (a factor of 100x), which will allow us to
express a per-block lease rate for the smallest possible order (1 unit,
or 100k sats) over the longest possible lease period (6 months).
2020-07-15 16:27:07 -07:00
Olaoluwa Osuntokun
57fa63c237
multi: rename, fix modules 2020-06-21 19:37:00 -07:00
Olaoluwa Osuntokun
9a2268ad48 client: change order.Kit.AcctKey into raw key bytes
In this commit, we change the key stored within the internal order kit
into a raw pubkey array. Along the way we fix a bug in the verifier
tests due to using a map with pointer keys rather than the actual value
itself.
2020-05-26 19:57:54 -07:00
Wilmer Paulino
33c52f1f8c multi: remove expiry from account diffs
The expiry of an account should never change as part of a batch, only as
part of a trader initiated modification.
2020-04-20 11:53:33 -07:00
Oliver Gugger
a637d5b540 client+order: fix flaky unit tests
Some of the test cases relied on a map's keys always being in the
order they were defined, which is not guaranteed by the runtime.
A data race is also fixed by creating a new instance of the verifier
for each run.
2020-04-09 13:14:30 +02:00
Oliver Gugger
42adb28ff5 client: verify batch 2020-04-03 21:50:22 +02:00