Commit graph

882 commits

Author SHA1 Message Date
Wilmer Paulino
bc49e79e72
funding: support opening script enforced channels based on order matched 2021-11-02 16:47:58 -07: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
Wilmer Paulino
321e3c3598
order+auctioneer: allow submission of order channel type to auctioneer 2021-11-02 16:47:53 -07:00
Wilmer Paulino
2adf6939c3
clientdb: store new channel type field as part of tlv stream 2021-11-02 16:47:50 -07:00
Wilmer Paulino
f7dce585ba
order: introduce channel type field
Previously, the channel type was being recorded by the auctioneer only,
but there was no way for a trader to set its preference. Now that we
want to support that, we move the ChannelType definition to the Pool
source code, as done in this commit.

As part of introducing this new field, a new version bump was required
to compute the proper digest of each order.

To remain backwards compatible, we define the default channel type to be
"peer dependent". This implies that the channel type will vary based on
the node features shared between the asker and bidder. We also define a
new channel type to denote that channels resulting from matched orders
must have their lease expiration enforced in the scripts of their
commitment transactions.
2021-11-02 16:47:47 -07:00
Olaoluwa Osuntokun
f566f3ad74
Merge pull request #304 from lightninglabs/cancel-sidecar
sidecar: inform remote side about cancellation
2021-11-02 16:47:17 -07:00
Oliver Gugger
5562b1ef62
Merge pull request #307 from guggero/github-actions
CI: switch from Travis to GitHub Actions
2021-11-01 10:42:43 +01:00
Oliver Gugger
164b335c4d
ci: add GitHub CI workflow 2021-10-29 17:41:12 +02:00
Oliver Gugger
a0a7599d3d
ci: remove Travis CI 2021-10-29 17:33:42 +02:00
Oliver Gugger
856e09e80d
cmd/pool: make min_chan_amt mandatory in auto mode
To avoid running into an error during automatic bid order submission
when offering a sidecar channel, we need to make the --min_chan_amt flag
of the order mandatory.
2021-10-29 17:20:18 +02:00
Oliver Gugger
262eb198c5
multi: inform other side about ticket cancellation
To avoid the other side waiting for an update for a ticket that will
never come if it is canceled, we inform them instead.
2021-10-29 17:20:18 +02:00
Oliver Gugger
ceeb3b3f65
auto_sidecar: fix break within select
This commit fixes an instance of a "break" keyword that didn't have the
desired effect (breaking out of the outer for loop).
This didn't lead to an endless loop just because of the break in the
error case a few lines above where we would leave the loop in case of an
invalid state transition.
2021-10-28 16:12:17 +02:00
Oliver Gugger
4327e35aff
Merge pull request #306 from guggero/close-macaroon-db
macaroons+server: close macaroon DB on server shutdown
2021-10-28 16:09:25 +02:00
Oliver Gugger
8be226351d
macaroons+server: close macaroon DB on server shutdown
In the integration tests we stop the pool daemon but don't exit the main
process. So it can happen that the underlying bbolt DB isn't properly
closed and when the daemon is started again during the test it runs into
a timeout. We fix this by properly closing the DB when the service is
stopped.

The macaroon service doesn't close the backend anymore because in the
lnd context the backend connection could be a shared connection to a
remote DB that we don't want to close when we start/stop the service
itself.
2021-10-28 16:05:58 +02:00
Oliver Gugger
65b206f483
Merge pull request #303 from lightninglabs/lndclient-fix
multi: update lndclient to latest version
2021-10-26 19:19:51 +02:00
Oliver Gugger
b460ba6fee
multi: update lndclient to latest version
With this commit we update to the latest lndclient version of the 0.14.0
branch that reverts a breaking change in the basic client and also fixes
a "close of closed channel" panic.
2021-10-26 12:38:54 +02:00
Jordi Montes
e4416e9e42
Merge pull request #301 from lightninglabs/populate-available-balance
rpcserver: populate accounts with available balance
2021-10-25 13:43:52 -07:00
positiveblue
3a2d356fbe
rpcserver: populate accounts with available balance
The `available_balance` of an account was only being populated for
`ListAccounts`. Populate the field in other operations like `deposit` or
`renew` could save the user some confusions.
2021-10-25 13:26:24 -07:00
Olaoluwa Osuntokun
b1b7b7e6fe
Merge pull request #299 from lightninglabs/0-14-ready
multi: update deps and fix compilation to make pool ready for lnd v0.14
2021-10-20 20:00:11 -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
Olaoluwa Osuntokun
ec4d329563
build: update cert code due to breaking change in package
The DefaultAutogenValidity constant was removed...
2021-10-20 19:25:59 -07:00
Oliver Gugger
429b28b110
multi: prepare for upcoming lnd v0.14.0-beta release 2021-10-20 19:25:54 -07:00
Olaoluwa Osuntokun
d5f944e3fa
build: update to pin against current lnd v0.14.0 2021-10-20 19:25:48 -07:00
Jordi Montes
d8e35fe829
Merge pull request #298 from lightninglabs/verifyAccountSigner
account: check valid signer when resuming accounts
2021-10-20 11:08:23 -07:00
Jordi Montes
d493378fb5
account: check valid signer when resuming accounts
If `poold` is using a different `lndclient.SignerClient` than the one
used during an account creation it won't be able to generate valid
signatures. `poold` wasn't checking the signatures before sending them
to the backend and it was sending invalid
`ClientAuctionMessage_Subscribe` messages.

With this change `poold` will detect invalid signatures before sending
them, instead of waiting for the backend to send back an error.
2021-10-20 10:40:05 -07:00
Oliver Gugger
2fd67d40a5
Merge pull request #292 from lightninglabs/fix-account-conf-target-fee
rpcserver: fix feeRate when using conf target
2021-10-05 13:32:31 +02:00
Jordi Montes
ba7f69f703
Merge pull request #291 from lightninglabs/add-check-to-init-account
account: handle invalid InitAccount parameters
2021-10-04 11:07:03 -07:00
positiveblue
abe2492749 rpcserver: handle invalid InitAccount parameters
Add check for requests with relative AND absolute height provided
instead of using the absolute one by default.

The same check for sats/kw and confirmation target has been moved to the
`switch` statement instead of having it in an extra `if`.
2021-10-04 10:21:15 -07:00
positiveblue
85916ebe16 rpcserver: fix feeRate when using conf target
The `feeRate` variable was shadowing inside the `req.GetConfTarget() > 0`
switch case. The server was returning an error when the `feeRate` was
estimated using the confirmation target.
2021-10-04 09:00:48 -07:00
Jordi Montes
9e5e1a8c52
Merge pull request #288 from lightninglabs/issue-191
Add sats_per_byte option to newAccounts cmd
2021-10-01 12:43:42 -07:00
positiveblue
c90f15878d cmd/pool: add sats_per_vbyte to account new 2021-10-01 09:54:26 -07:00
positiveblue
68a38b34d7 account: use raw sat/byte when making an account
Generally the confirmation target is much less granular than a direct sat/byte
due to jumps in the confirmation confidence intervals. Changed the
account manager to take the `feeRate` instead of the `confTarget`. The
caller will be the one with the responsability of calculating the
`freeRate`. If the caller does not provide a value (`freeRate=0`) we
will calculate it from the default confTarget (6 blocks).
2021-09-29 21:14:08 -07:00
positiveblue
15a1b79a1b poolrpc: add optional raw sat/byte parameter to InitAccountRequest 2021-09-29 19:55:09 -07:00
Olaoluwa Osuntokun
53df9a3084
Merge pull request #287 from lightninglabs/sidecar-crud
sidecar: add ListSidecars and CancelSidecar RPCs
2021-09-29 17:13:28 -07:00
Oliver Gugger
3f8f556a44
cmd/pool: add sidecar list and cancel commands 2021-09-29 15:41:35 +02:00
Oliver Gugger
e111facc28
rpcserver+poolrpc: add ListSidecars and CancelSidecar RPCs
With this commit we add two new RPCs for handling sidecar tickets.
ListSidecars will show all sidecar tickets known to the local database,
including those where our node is on the receiving end of a sidecar
channel.
CancelSidecar will cancel a specific sidecar ticket. If an order was
created for it, that bid order will be canceled. Doing so will make sure
the ticket isn't executed any further.
2021-09-29 15:41:34 +02:00
Oliver Gugger
7b2d457dd3
multi: update ticket state after submitting order
When manually submitting an order, we want to update the state of the
ticket in the main database to the same state that we update the ticket
that's stored within the orders's TLV data.
2021-09-29 15:41:34 +02: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
811c6df4cf
sidecar+acceptor: add IsTerminal to ticket state 2021-09-29 15:15:25 +02:00
Oliver Gugger
93b5e6a5c7
multi: fix formatting and comments 2021-09-29 15:15:24 +02:00
Olaoluwa Osuntokun
f633d70032
Merge pull request #285 from guggero/decode-ticket
Add DecodeSidecarTicket RPC
2021-09-28 14:42:06 -07:00
Oliver Gugger
3d015ec18d
cmd/pool: use DecodeSidecarTicket RPC for printticket 2021-09-22 17:00:43 +02:00
Oliver Gugger
a5cf85aba2
multi: add DecodeSidecarTicket RPC
To make it possible to decode a sidecar ticket through RPC instead of
only relying on the output of the CLI, we add the DecodeSidecarTicket
RPC method to the trader daemon.
2021-09-22 17:00:43 +02:00
Oliver Gugger
877302d851
codec_test: update test to cover all fields 2021-09-06 13:56:51 +02:00
Oliver Gugger
37c7c68641
Merge pull request #279 from carlaKC/mod-bump
gomod: bump to lndclient 13-7
2021-08-23 09:54:07 +02:00
Olaoluwa Osuntokun
d7948977c5
Merge pull request #282 from guggero/fix-nil-pointer-crash
auctioneer: fix stream nil panic
2021-08-20 11:29:12 -07:00
carla
a4cd7a6056
github: add pull request template with minimum lnd version warning 2021-08-20 16:49:43 +02:00
carla
234f4d80fb
gomod: bump to lndclient 13-7
This commit bumps pool to lndclient 13-7 so that code that depends
on lnd 0.13 can import pool. As is, pool is running with lndclient 0.12,
but pins minimum version to 0.11, so we are already in a state where
some of the apis available at compile time are not enforced by minimum
run version.

This commit bumps this minimum version up to 0.12 to minimize the
difference between the compile and runtime lnd version.
2021-08-20 16:49:41 +02:00
Oliver Gugger
c8afe06fc5
auctioneer: fix stream nil panic
We were missing a few selects on the quit channel which could lead to us
making another iteration in the loop while the server stream was already
set to nil. We fix that by making sure we always return one way or
another if the quit channel is closed.
Just to make the panic impossible to happen again, we also return from
the loop early if the server stream is nil, just in case.
2021-08-20 16:43:17 +02:00