Commit graph

19 commits

Author SHA1 Message Date
positiveblue
6027ccd3d6
multi: bump btcec/v2 and btcutil to new versions 2022-03-28 15:22:41 +02: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
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
Johan T. Halseth
0e665f592a
clientdb: store LocalBatchSnapshot on StorePendingBatch 2020-09-10 10:41:31 +02:00
Johan T. Halseth
daf1e1a0bc
clientdb test: complete tx, don't require t for dummyOrder 2020-09-10 09:51:56 +02:00
Olaoluwa Osuntokun
ffc9c60b13
multi: rename project from llm to pool 2020-09-09 19:55:10 -07:00
Wilmer Paulino
f71adf7b67
multi: re-purpose account close tx field to latest tx 2020-09-02 12:10:23 -07:00
Oliver Gugger
97624499a9
mod: update bbolt to fix go1.14 compat 2020-06-24 10:53:59 +02:00
Olaoluwa Osuntokun
57fa63c237
multi: rename, fix modules 2020-06-21 19:37:00 -07:00
Wilmer Paulino
9f9e7d7cb6 clientdb: prevent test race condition by not modifying global test var 2020-05-05 14:20:49 -07:00
Wilmer Paulino
cb9c14b1b1 clientdb: add DeletePendingBatch 2020-05-05 13:54:36 -07:00
Wilmer Paulino
043a9f7d98 account: properly handle spend on pending batch not finalized
This commit aims to address a current gap within the system where trader
account states can become desynchronized if they participated in a batch
and they never received a Finalize message from the auctioneer.

From now on, if an account spend arrives while a trader has a pending
batch, then we assume they weren't able to receive its Finalize message,
and use the spend as an indication that the batch has been finalized.
This works because if a trader signs for a batch and disconnects, the
batch should have already been persisted, and if the batch was actually
finalized (i.e., broadcast without any changes), then the account should
have been spent.
2020-05-05 13:53:32 -07:00
Wilmer Paulino
d167821bee clientdb+order: store pending batch transaction
This is done as preparation to handle traders recovering from batches
which they've participated in and signed for.
2020-05-05 13:51:17 -07:00
Wilmer Paulino
15c5859239 clientdb+order: remove batch ID parameter from MarkBatchComplete
The parameter isn't necessary as traders can only maintain one pending
batch at a time, and the check is already performed by the BatchStorer.
2020-05-05 13:48:28 -07:00
Wilmer Paulino
9a2d6c4c50 clientdb: stage batch updates under distinct bucket
If trader A provides a signature for a batch, disconnects, and trader B,
who is also in the auction, bails, then the auctioneer will re-attempt
matchmaking. If trader A hasn't reconnected by and a successful batch is
made without them, then the updates would need to be rolled back.
Previously, since we would overwrite the main account and order state,
we'd lack information in order to do so. By staging the update under a
distinct bucket, we can now do so properly by simply removing the state
within it.
2020-04-27 15:51:58 -07:00
Wilmer Paulino
4b95396cdc clientdb: refactor test cases out of TestPersistBatchResult 2020-04-27 15:50:07 -07:00
Wilmer Paulino
6a64971396 clientdb+order: use 2-step commit for batch persistence
This commits serves as preparatory work for committing a pending batch
before providing signatures to the auctioneer. This is achieved by first
storing the batch as pending upon receiving a new batch and marking it
as complete upon receiving a finalize message.
2020-04-24 10:57:41 -07:00
Oliver Gugger
30faf6188b client: add batch persistence 2020-04-03 21:53:04 +02:00