Commit graph

84 commits

Author SHA1 Message Date
Elle Mouton
6dd03c0edc
multi: update lnd, aperture and lndclient deps
This includes upgrading the logging framework to the V2 framework. This
new framework lets us deprecate the `maxlogfiles` and
`maxlogfilesize` config options.
2025-03-05 12:31:15 +02:00
Matt Morehouse
8b239fab7e
clientdb: move WriteElement[s] to own package
Move WriteElement[s] to the codec package so that packages other than
clientdb can use it.

For the codec package, we avoid depending on other packages within Pool
so that no circular dependencies develop. This requires us to move some
of the uintXX casting logic in clientdb/codec.go to call sites.
2023-05-16 17:30:59 -05:00
positiveblue
a66a63e895
fmt: run go fmt
Since v1.19.0 `go fmt` also formats comments. This commit is only to
ensure that `go fmt ./...` does not modify any of our commited files.
2023-01-06 01:53:15 -08:00
positiveblue
d1b9a63da5
order: add auction type field to order struct/db 2022-10-18 06:44:01 -07:00
positiveblue
05ff9e2635
order: add IsPublic field 2022-10-18 04:34:22 -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
7bc48a7a7d
account+clientdb: add version to account 2022-09-12 17:20:10 +02:00
Oliver Gugger
986d889b74
multi: fix linter issues 2022-08-03 20:33:06 +02:00
positiveblue
355be1556c
clientdb: add node filter lists to order tlv data 2022-04-22 00:26:38 -07:00
positiveblue
c6fe105367
order: add DeleteOrder to store interface 2022-04-13 13:44:10 -07:00
positiveblue
6027ccd3d6
multi: bump btcec/v2 and btcutil to new versions 2022-03-28 15:22:41 +02:00
Wilmer Paulino
2adf6939c3
clientdb: store new channel type field as part of tlv stream 2021-11-02 16:47:50 -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
36a13039e5
clientdb: add SidecarsByID 2021-09-29 15:41:34 +02:00
Oliver Gugger
95dcc4e94f
clientdb: remove bid template in terminal state 2021-09-29 15:41:33 +02:00
Oliver Gugger
93b5e6a5c7
multi: fix formatting and comments 2021-09-29 15:15:24 +02:00
Olaoluwa Osuntokun
3dee849502
clientdb: permit sub-buckets in main sidecar bucket
A prior check is now invalidated as the sidecar bucket houses a
sub-bucket that we use to store the set of bid information related to a
sidecar channel.
2021-05-24 22:28:39 -07:00
Olaoluwa Osuntokun
515a6ef476
clientdb: add new method to insert a sidecar ticket along w/ a bid
In this commit, we add a new method that lets us insert a sidecar ticket
as well as a bid in an atomic manner. We'll use this later when offering
this new type of automated ticket.
2021-05-09 19:24:58 -07:00
Oliver Gugger
16fc005a61
macaroons+clientdb: add timeout to DB open
To make sure we don't just block for forever if another Pool daemon
process is already running, we add a timeout and error out if obtaining
the unique file lock fails after 5 seconds.
2021-04-27 10:19:55 +02:00
Oliver Gugger
5f7f4cd7f4
multi: add sidecar channel info to leases list
A sidecar channel uses different multisig keys than a normal order so we
need to fix the lookup in the batch transaction. While we're at it, we
might as well return the self chan balance and whether it was a sidecar
channel in the leases response.
2021-04-07 14:19: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
f84debaeff
sidecar+clientdb: add sidecar storage
Both the trader offering to buy a sidecar channel for another node as
well as the recipient node will need to store the involved sidecar
tickets in their local databases. We add a simple store interface and
its implementation that will be used in future commits.
2021-04-01 22:34:07 +02:00
Oliver Gugger
b308f2ee35
clientdb: add self channel balance to bid order
With the additional data encoded as tlv, we can simply add the new
self channel balance field to the tlv stream.
2021-03-19 16:50:31 +01:00
Oliver Gugger
8f817aba5f
clientdb: add extra data as tlv stream to order
To make it way easier to add more data to orders, we add an extra key
in the order's bucket that will contain all future additional data
encoded as a tlv stream.
The PR containing this commit will likely become quite large as is and
therefore we don't want to overload it more by also adding a DB
migration. This can always be done in the future.
2021-03-19 16:50:30 +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
c76ae07895
clientdb: test snapshot serialization for all versions 2021-01-08 14:02:15 +01:00
Oliver Gugger
05626355ae
multi: use distinct clearing price per duration bucket 2021-01-08 14:02:14 +01:00
Oliver Gugger
a27fd7c1a0
multi: add and use new order version
We add a new order version that is allowed to submit lease durations
outside of the default/legacy 2016 block duration.
No new fields are added, so nothing changes in the serialization or the
digest. This version only signals that the client is able to process
batch requests with multiple duration buckets.
2021-01-08 14:02:11 +01:00
Oliver Gugger
713eba5279
clientdb: properly serialize batch version
Even though there still only is one batch version, we want to properly
encode/decode it as a preparation for future version changes.
2021-01-08 14:02:08 +01:00
Oliver Gugger
b589cb7e70
clientdb: remove unused pending batch TX key
Because we now only use the batch TX from the local pending batch
snapshot, the redundant information in the pending batch TX key is not
needed anymore.
2020-12-09 09:42:30 +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
4b2291aaa8
clientdb: add fetchPendingBatchSnapshot
In preparation for loading the full local pending batch snapshot instead
of only the ID when starting the daemon, we add a new function to the
database to retrieve the snapshot.
2020-12-09 09:42:29 +01:00
Oliver Gugger
9714deb848
multi: specify DB filename when opening clientdb
To make it possible to open any DB in the debug CLI, we allow specifying
the file name too instead of only the path.
2020-11-24 14:27:45 +01:00
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
b0dc59a39e
order+clientdb: remove unused DelOrder method 2020-10-13 10:11:37 +02:00
Wilmer Paulino
664a55ad3b
clientdb: store order MinUnitsMatch field 2020-10-12 19:51:28 -07:00
Olaoluwa Osuntokun
273fb46088 clientdb: add new key within order bucket for min node tier
In this commit, we add a new key within the order bucket that stores
just the node tier for a given order. The current code only _expects_ a
node tier to exist for Bid orders, however things have been designed
such that, we can easily add tier options for Ask orders as well.

Along the way we modify the `orderCallback` to include the node tier
information as its read from a distinct bucket. In the future, we'll
likely want to make this into a struct so the function signature doesn't
ever expand.
2020-10-09 15:53:43 -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
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
c147e8c96f
clientdb: store and retrieve order events
We create new store methods to store and retrieve order events. We also
emit and store the "created" and "state changed" events when appropriate.
2020-10-01 13:16:52 +02:00
Oliver Gugger
24dc11625b
clientdb: create and use copyOrder for applying batch updates
To make sure the source bucket in updateOrder always is the root order
bucket, we extract the single case were it didn't use to be that way
into its own function called copyOrder and use that for applying the
final batch updates.
2020-10-01 13:16:51 +02:00
Oliver Gugger
a6c363708f
clientdb: add migration for existing orders
With this commit we add a migration that adds a fake order
creation timestamp to all orders that existed before this code is first
run.
2020-10-01 13:16:50 +02:00
Oliver Gugger
046a9a4bda
clientdb: add event storage
This commit adds the ability to store and retrieve
events to/from the main event bucket but also their references in the
owner's buckets.
2020-10-01 13:16:48 +02:00
Oliver Gugger
4964dfca6c
order+clientdb: add order specific events
We add a couple of order specific events which we use to track the
activity around orders. Some events track the timestamps at which we
persist a change to orders, other events track more volatile occurrences
of the match making process.
2020-10-01 13:16:47 +02:00
Johan T. Halseth
0e665f592a
clientdb: store LocalBatchSnapshot on StorePendingBatch 2020-09-10 10:41:31 +02:00
Johan T. Halseth
60d7a0a48b
clientdb: add batch ID index bucket for snapshots 2020-09-10 10:41:31 +02:00
Johan T. Halseth
7c3a4d8492
clientdb: define LocalBatchSnapshot 2020-09-10 10:41:07 +02:00
Johan T. Halseth
169daf8131
clientdb: return updated order, account on modification 2020-09-10 09:51:57 +02:00
Johan T. Halseth
daf1e1a0bc
clientdb test: complete tx, don't require t for dummyOrder 2020-09-10 09:51:56 +02:00