Commit graph

41 commits

Author SHA1 Message Date
Oliver Gugger
52cdb3d5f9
multi: add simple taproot channel type to order 2023-10-25 10:04:23 +02:00
Oliver Gugger
2d3aef1725
order+server: add flag based batch version 2023-03-08 17:42:06 +01:00
positiveblue
8d54713cef
order: bump latest batch version to ZeroConfChannels 2022-10-18 04:34:21 -07:00
positiveblue
cdb92e11f0
multi: new batch version for unannounced channel and zero conf support 2022-10-18 04:34:21 -07:00
Oliver Gugger
9638c8a24b
order+rpcserver: add MuSig2 batch signing 2022-09-12 17:20:12 +02:00
Oliver Gugger
221ea0bcbe
order: allow account version upgrade during batch 2022-09-12 17:20:12 +02:00
Oliver Gugger
a6c18a9bb1
multi: add new batch version for account auto-upgrade 2022-09-12 17:20:11 +02:00
positiveblue
6027ccd3d6
multi: bump btcec/v2 and btcutil to new versions 2022-03-28 15:22:41 +02:00
Oliver Gugger
cd3b6b65bb
auctioneer+order: rename CurrentBatchVersion->LatestBatchVersion
To make sure the CurrentBatchVersion isn't used anywhere as the default
version anymore by accident, we explicitly rename it.
2021-12-22 09:47:45 +01:00
positiveblue
2f971db8cc
order: set ExtendedAccount as default batch version 2021-12-16 13:15:41 -08:00
positiveblue
f9b444131e
order: add ExtendAccountBatchVersion support
- Add new `ExtendAccountBatchVersion` batchVersion.
- Use the right batch verification flow depending on the version.
2021-11-30 20:18:28 -08: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
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
Oliver Gugger
71b7f419d8
order+funding: use correct multisig key
If we're the provider of a sidecar channel then we don't actually have
the private key of the funding multisig key. Therefore we cannot
re-derive it on demand and have to use the key provided in the sidecar
ticket instead.
2021-04-06 13:41:49 +02:00
Oliver Gugger
4d6fdae004
funding+order: move DefaultBatchStepTimeout
We need to use the DefaultBatchStepTimeout variable outside of the
funding manager as well and move it to the order package to not create a
circular dependency when accessing it from the root package.
2021-03-19 16:50:32 +01:00
Oliver Gugger
0a5096ac55
order: validate self chan balance in deltas
When validating a batch we need to make sure that all three parties
(maker, taker, server) come up with the same account ending state after
matching a bid order with a push amount.
2021-03-19 16:50:32 +01:00
Oliver Gugger
83b458b504
multi: move auctioneer proto to auctioneerrpc package
As a preparation to extract the auctioneer proto package into its own
sub-module, we move it out of the poolrpc package.
2021-01-22 10:41:44 +01:00
Oliver Gugger
05626355ae
multi: use distinct clearing price per duration bucket 2021-01-08 14:02:14 +01:00
Oliver Gugger
1f265865cf
order+auctioneer: rename batch versions to avoid confusion
Because the batch Versions are in the order package, the use of
order.DefaultVersion is confusing and not clear to be related to the
version of the _batch_, just from its name. We fix that by renaming the
versions of the batch.
2021-01-08 14:02:06 +01:00
Oliver Gugger
02cd3ffa28
multi: move cleanup functions to funding package
To delegate the pending batch cleanup to the funding manager, we first
need to move the cleanup functions into the funding package.
2020-12-09 09:16:42 +01:00
Oliver Gugger
2cd6381e25
order: demote scary sounding warn message to debug
Since this error caused quite some confusion among our users, we demote
it to info and change the text to further explain what's happened.
If a trader is involved in a batch and the channel funding fails in the
batch sign phase, a pending channel is never created in lnd. If the next
batch prepare message comes in, we try to clean up all pending channels
of the previous attempt. Because the channel negotiation failed and
there is no pending channel, cleaning up fails with this message.
2020-12-09 09:13:42 +01:00
Oliver Gugger
43ecf1d320
order+rpcserver: refactor AbandonCanceledChannels into function
We also need to make the channel abandonment independent of a particular
format of a pending batch, so we refactor it into a standalone function
instead of a method on the in-memory batch format.
2020-12-08 11:25:13 +01:00
Oliver Gugger
aa7f4a228f
order+rpcserver: refactor CancelPendingFundingShims into function
We want to be able to clean up after a pending batch that is replaced.
We want to do this for both in-memory pending batches but also for
persisted local snapshot batches on startup. Therefore we need to
refactor the cleanup methods into independent functions.
2020-12-08 11:25:13 +01:00
Oliver Gugger
4dd9eb8c6c
order: add DecrementingBatchIDs
To make iterating over batch IDs easier, we add a new helper function
that returns all batch IDs starting at the start key (inclusive) and
ending at the end key (inclusive) by decrementing the public keys. If
the end key cannot be reached by decrementing the start key by a maximum
of 10k times, we abort and return the first 10k items (without the end
key).
2020-11-30 23:44:27 +01:00
Oliver Gugger
5a8825b8b4
order: add AbandonCanceledChannels 2020-09-10 13:47:17 +02:00
Oliver Gugger
f41043b901
order: extract channelOutput from batch verifier
As a preparation to abandon canceled channels, we first extract the
utility method to locate a channel output created in a batch from the
batch verifier into the batch itself.
2020-09-10 13:47:16 +02:00
Olaoluwa Osuntokun
ffc9c60b13
multi: rename project from llm to pool 2020-09-09 19:55:10 -07:00
Oliver Gugger
3df4e2f005
multi: move FeeSchedule to terms package
As a preparation to avoid package import cycles when introducing more
generic terms, we move the FeeSchedule interface and its
LinearFeeSchedule implementation to the terms package.
2020-08-18 13:15:34 +02:00
Olaoluwa Osuntokun
1b498857b2
order+batch: cancel pending funding shims if we reject a batch
In this commit, we ensure that if we need to reject a batch for w/e
reason, then we also unregister all funding shims. Otherwise, if we
repeat a modified version of that batch, then we'd fail early as the
attempt to register than same shim would be rejected.
2020-07-14 20:12:43 -07:00
Wilmer Paulino
509cb4e64e
order: update height hint for accounts in batch 2020-07-01 17:01:23 -07:00
Olaoluwa Osuntokun
57fa63c237
multi: rename, fix modules 2020-06-21 19:37:00 -07:00
Olaoluwa Osuntokun
33246cda7d multi: fix linter issues 2020-05-26 19:58:14 -07:00
Olaoluwa Osuntokun
ad5c24bf2a client/order: log expected script when ending state script validation fails 2020-05-26 19:57:48 -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
Olaoluwa Osuntokun
4d24044ade client/order: add new NewBatchID method 2020-04-29 15:04:49 -07:00
Olaoluwa Osuntokun
853ad0a940 multi: add new OrderSignBegin message, fix OrderMatchSign
We need this method for further synchronization: once this is sent we
expect the traders to respond with signatures for each of the accounts
involved in the batch. The addition of this message also means that the
responder of the channel funding has time to register their shim (done
before they send their Accept message) as we don't send the
OrderSignBegin message until all traders have accepted the batch. The
initiator can now use receipt of the OrderSignBegin as a signal to
initiate the channel funding.

We also fix an existing oversight in the `OrderMatchSign`: it expected a
fully valid witness, but the only thing the traders can produce by
themselves is a signature for their input.
2020-04-29 15:04:42 -07:00
Wilmer Paulino
c2ae197406 order: commit pending batch before providing signatures to auctioneer
Previously, if the connection between the trader and auctioneer was torn
down before the trader received a batch's finalize message, then the
trader would lose all context about the batch they participated in.
Committing the batch before providing our signatures to the auctioneer
ensures that this cannot happen. Follow-up work will allow the trader to
obtain the latest information regarding a pending batch upon
reconnections.
2020-04-24 10:57:42 -07:00
Wilmer Paulino
33c52f1f8c multi: remove expiry from account diffs
The expiry of an account should never change as part of a batch, only as
part of a trader initiated modification.
2020-04-20 11:53:33 -07:00
Oliver Gugger
30faf6188b client: add batch persistence 2020-04-03 21:53:04 +02:00
Oliver Gugger
42adb28ff5 client: verify batch 2020-04-03 21:50:22 +02:00
Oliver Gugger
ac7ad38d08 client: send batch version on connect 2020-04-03 21:50:20 +02:00