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.
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.
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.
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.
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.
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.
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.
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.
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.
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`.
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.
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).
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.
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.
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.
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.
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.