Commit graph

17 commits

Author SHA1 Message Date
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
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
Johan T. Halseth
0e665f592a
clientdb: store LocalBatchSnapshot on StorePendingBatch 2020-09-10 10:41:31 +02:00
Johan T. Halseth
169daf8131
clientdb: return updated order, account on modification 2020-09-10 09:51:57 +02:00
Olaoluwa Osuntokun
ffc9c60b13
multi: rename project from llm to pool 2020-09-09 19:55:10 -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
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
d9738f7368 clientdb: specify src and dst buckets for updateAccountTX 2020-04-27 15:50:03 -07:00
Wilmer Paulino
210415b8b2 clientdb: specify src and dst buckets for updateOrderTX 2020-04-27 15:48:42 -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