Commit graph

168 commits

Author SHA1 Message Date
Olaoluwa Osuntokun
08003b5eb9
clmrpc: make account expiry a one of to allow relative values 2020-07-01 18:40:50 -07:00
Olaoluwa Osuntokun
feebc8c32c
Merge pull request #7 from guggero/peer-spam
rpcserver: wait between peer connects
2020-06-26 12:32:10 -07:00
Oliver Gugger
b094a1c1c4
rpcserver: wait between peer connects 2020-06-26 21:28:03 +02:00
Olaoluwa Osuntokun
57d4b80b5d
Merge pull request #5 from Roasbeef/README
docs: add initial README
2020-06-25 16:10:56 -07:00
Olaoluwa Osuntokun
823b9676a2
docs: add initial README 2020-06-25 16:10:29 -07:00
Oliver Gugger
468bb3e7e4
Merge pull request #2 from guggero/recover-account-initiated
Recover account in StateInitiated
2020-06-25 09:46:26 +02:00
Oliver Gugger
cc22edb9f1
account+auctioneer: remove need to find key again 2020-06-25 09:28:46 +02:00
Oliver Gugger
136c8d91d5
account: don't fund recovered accounts again
If we encounter an account in the state initiated when performing the
account recovery, we certainly don't want to send funds to it again. If
lnd finds the transaction that funded the account, great. We can try to
recover it. If the transaction isn't found, it is very likely that it
was never broadcast. We update the account's state to
StateRecoveryFailed in that case.
2020-06-25 09:26:36 +02:00
Oliver Gugger
9e55d476ff
clmrpc+account+rpcserver: add state recovery failed
Add a new client side state that denotes that account recovery for a
certain account failed.
2020-06-25 09:26:36 +02:00
Oliver Gugger
ad597c3bed
auctioneer: also recover reserved account
React to the special error that is sent from the auctioneer if it only
knows of a reservation. The RPC information is turned into a special
error so it can be handled by the account manager later.
2020-06-25 09:26:25 +02:00
Oliver Gugger
85cae324b0
auctioneer: add recovery on reserved account error
We need the same error on the server and client side so we add it to
the client part of the repository. The new error message contains all
information about an account that was only reserved but never completed.
2020-06-25 09:20:51 +02:00
Oliver Gugger
3c6e40e66e
clmrpc: add error type for reserved account
If we only have a reservation on the auctioneer's side when a
trader tries to connect, we cannot create a full account subscription
and therefore not follow the normal message flow for recovery. Instead
we return a special error message that contains the information we have
that should be enough to restore the account on the trader's side.

The trader still has to provide a valid signature with the trader key
so no probing for this information should be possible by any third
party.
2020-06-25 09:19:22 +02:00
Oliver Gugger
beaa9f49c3
account+auctioneer: send expiry and trader key in reservation 2020-06-25 09:17:37 +02:00
Oliver Gugger
7ddbeafa91
clmrpc: add expiry and trader key to account reservation
To be able to recover an account that was only reserved before the
data loss occurred at the trader, we need to store more information
in the auctioneer's reservation. Specifically we also need to store
the account expiry, the trader key and the value. Previously the
value was only validated, now it will also be stored in the
reservation.
2020-06-25 09:17:37 +02:00
Olaoluwa Osuntokun
20e092db28
Merge pull request #6 from guggero/linter-fix
lint: fix linter issue, limit concurrency only on Travis
2020-06-24 12:34:33 -07:00
Oliver Gugger
97624499a9
mod: update bbolt to fix go1.14 compat 2020-06-24 10:53:59 +02:00
Oliver Gugger
9fc0b7101e
travis: disable coverage for private repo 2020-06-24 10:53:59 +02:00
Oliver Gugger
cafe3dfd7c
makefile: use lowercase llm for easy search/replace 2020-06-24 10:31:16 +02:00
Oliver Gugger
3543466604
Makefile+lint: only limit concurrency on Travis 2020-06-24 09:58:17 +02:00
Oliver Gugger
bb09760864
clientdb: fix formatting 2020-06-24 09:55:42 +02:00
Oliver Gugger
336a72e545
Merge pull request #4 from Roasbeef/travis
build: add basic travis config
2020-06-24 09:54:55 +02:00
Olaoluwa Osuntokun
e83e66c163
build: force travis to use go modules 2020-06-23 19:03:41 -07:00
Olaoluwa Osuntokun
b5bf85129a
build: add basic travis config 2020-06-23 18:58:44 -07:00
Olaoluwa Osuntokun
6416e02f69
Merge pull request #3 from guggero/fix-order-deletion
clientdb: fix order deletion
2020-06-23 18:43:42 -07:00
Olaoluwa Osuntokun
a5f195b03a
Merge pull request #1 from guggero/makefile
make: add Makefile, .gitignore and lint config
2020-06-23 18:39:45 -07:00
Oliver Gugger
b120e5b21c
clientdb: fix order deletion 2020-06-23 15:38:53 +02:00
Oliver Gugger
7b045393ac
make: add Makefile, .gitignore and lint config 2020-06-23 10:45:34 +02:00
Olaoluwa Osuntokun
57fa63c237
multi: rename, fix modules 2020-06-21 19:37:00 -07:00
Wilmer Paulino
182bd1badf agora: add account deposit command 2020-06-17 18:34:56 -07:00
Wilmer Paulino
f521327cb5 clmrpc: add DepositAccount RPC 2020-06-17 18:34:54 -07:00
Wilmer Paulino
7c0a5070ea account: add support for lnd-backed account deposits 2020-06-17 18:34:53 -07:00
Wilmer Paulino
a92022392f account: allow inputs in transaction creation
This serves as prepatory work to introduce account deposits, as they
rely on a set of additional inputs being provided.
2020-06-17 18:34:52 -07:00
Wilmer Paulino
b7e48b5432 account: add basic coin selection heuristic
Most of the code is heavily borrowed from the chanfunding package in
lnd, except for some minor changes to account for the difference in
weights. Ideally, that package is refactored and abstracted such that it
doesn't only apply for channel funding.
2020-06-17 18:34:51 -07:00
Wilmer Paulino
573e3ea987 account: refactor withdrawal logic out from createNewAccountOutput
Some of the refactored methods will become useful with the introduction
of account deposits.
2020-06-17 18:34:50 -07:00
Wilmer Paulino
10efa7d582 clientdb: store global random lock ID upon database initialization 2020-06-17 18:34:49 -07:00
Oliver Gugger
e4e7236cc0 clmrpc: add README.md 2020-06-05 21:25:53 +02:00
Oliver Gugger
69ebc705e8 clmrpc: re-generate with updated grpc-gateway 2020-06-05 21:25:52 +02:00
Oliver Gugger
adcb145e76 client+cmd: add recover command 2020-06-05 16:24:33 +02:00
Oliver Gugger
679efaa7b7 client: perform account recovery 2020-06-05 16:24:33 +02:00
Oliver Gugger
a81167c6a0 client: add account recovery 2020-06-05 16:24:30 +02:00
Oliver Gugger
7b65bb70fa client: treat error differently in recovery mode 2020-06-05 16:24:07 +02:00
Oliver Gugger
f3bd20f88f client: refactor chan type in subscription 2020-06-05 16:23:43 +02:00
Oliver Gugger
eab2b0b47b client: refactor connect and auth into method 2020-06-05 16:23:43 +02:00
Oliver Gugger
31a3220708 clmrpc: add account recovery 2020-06-05 16:23:43 +02:00
Oliver Gugger
62c95e422e clmrpc: add account recovery messages 2020-06-04 14:49:15 +02:00
Oliver Gugger
c5ea06b26d client+clmrpc: use enum for OrderState 2020-05-27 14:57:56 +02:00
Oliver Gugger
6cc5240fda server+itest: validate maximum account value 2020-05-27 14:57:56 +02:00
Oliver Gugger
909a5bbc3e client: send account value on account reservation 2020-05-27 14:57:55 +02:00
Oliver Gugger
c46bfef959 client+clmrpc: unify data types for amounts, fees and blocks
We use the same proto message types everywhere for these kinds
of fields:
- absolute amounts (sats): uint64
- fee rates (sat/kWU): uint64
- fee rates (ppm): uint32
- blocks (absolute and relative): uint32

Additionally we unify the comments and remove the [ json_name = "" ]
declarations in the trader proto as they aren't needed with the
jsonpb marshaller that we use.
Then we align the naming of the account key to be called trader key
everywhere instead of user's sub key.
2020-05-27 14:33:34 +02:00
Olaoluwa Osuntokun
33246cda7d multi: fix linter issues 2020-05-26 19:58:14 -07:00