2
0
mirror of https://github.com/lightninglabs/loop synced 2024-11-09 19:10:47 +00:00
Commit Graph

1563 Commits

Author SHA1 Message Date
Slyghtning
3ee3963030
sweepbatcher: log confirmed batch tx id 2024-09-02 15:42:51 +02:00
Boris Nagaev
8978afede9
Merge pull request #817 from starius/fix-typo
sweepbatcher: fix typo in log message
2024-09-01 22:07:26 -03:00
Boris Nagaev
dba3d15b02
sweepbatcher: fix typo in log message 2024-09-01 13:00:36 -03:00
Boris Nagaev
9751780fae
Merge pull request #815 from starius/publish-errors-handler
sweepbatcher: add option WithPublishErrorHandler
2024-08-28 13:12:38 -03:00
Boris Nagaev
7c93dff830
sweepbatcher: add option WithPublishErrorHandler
WithPublishErrorHandler sets the callback used to handle publish errors.
It can be used to filter out noisy messages.
2024-08-27 19:26:29 -03:00
Boris Nagaev
6b852c1c0b
go.mod: update btcwallet
Update it to the version having symbol chain.ErrInsufficientFee.
2024-08-27 19:26:29 -03:00
Boris Nagaev
54bf02294e
go.mod: update lnd to v0.18.3-beta.rc1
This is needed to update btcwallet dependency.
2024-08-27 19:26:29 -03:00
Boris Nagaev
898efbf2ae
sweepbatcher: fix godoc 2024-08-27 10:57:41 -03:00
Boris Nagaev
876ed401db
Merge pull request #813 from starius/sweepbatcher-max-inputs
sweepbatcher: set max batch size to 1000 sweeps
2024-08-27 10:03:36 -03:00
Boris Nagaev
7780aca492
sweepbatcher: log the reason of acceptance failure
Add Info log message in cases when addSweep returns accept=false and err=nil.
2024-08-26 20:53:29 -03:00
Boris Nagaev
f21a21ee41
sweepbatcher: set max batch size to 1000 sweeps
This is needed to avoid non-standard batch transactions (larger than 400k wu).
A non-cooperative input is 393 wu, so 1000 inputs are still under 400k wu.
2024-08-26 14:17:24 -03:00
Boris Nagaev
a6e9a2b652
Merge pull request #791 from starius/sweepbatcher-mixed-batches
sweepbatcher: add mixed batches as an option
2024-08-21 14:11:24 -03:00
Boris Nagaev
b171f76b27
sweepbatcher: make greedy algo mixed batch aware 2024-08-21 14:05:50 -03:00
Boris Nagaev
d007cf6e20
sweepbatcher: use coopFailed in greedy selection
Treat coopFailed flag the same as nonCoopHint. The former is what we found in
previos signing attempts, the later is what the caller signalled to us.
2024-08-21 14:05:50 -03:00
Boris Nagaev
26eda00ef2
sweepbatcher: add mixed batches option
Option WithMixedBatch instructs sweepbatcher to create mixed batches with regard
to cooperativeness. Such a batch can include both sweeps signed both
cooperatively and non-cooperatively. If cooperative signing fails for a sweep,
transaction is updated to sign that sweep non-cooperatively and another round of
cooperative signing runs on the remaining sweeps. The remaining sweeps are
signed in non-cooperative (more expensive) way. If the whole procedure fails for
whatever reason, the batch is signed non-cooperatively (the fallback).
2024-08-21 14:05:50 -03:00
Boris Nagaev
58d9445bc5
test/signer_mock: return signatures of real size
Size of a signature affects the weight of transaction, which is verified
in tests.

Also method SignOutputRaw now returns the number of signatures matching
the number of signature descriptors to prevent crashes in tests where
multiple inputs are signed.
2024-08-21 14:05:50 -03:00
Boris Nagaev
2c2c427a6d
sweepbatcher: factor out method createPsbt
Unload method publishBatchCoop. Also this code will be reused in new method
for mixed batches soon.
2024-08-21 14:05:50 -03:00
Boris Nagaev
5cd6c0c83c
sweepbatcher: coopSignBatchTx accepts wire.MsgTx
... instead of psbt.Packet.

Make the code simpler. Function worked with packet.UnsignedTx only,
so it is easier to pass tx directly.
2024-08-21 14:05:50 -03:00
András Bánki-Horváth
ff144c7e25
Merge pull request #812 from bhandras/use-looprpc-tag
build: use tagged looprpc v1.0.0
2024-08-21 17:44:51 +02:00
Andras Banki-Horvath
dbc56ff8c9
build: use tagged looprpc v1.0.0 2024-08-21 17:36:09 +02:00
András Bánki-Horváth
b76163ffcb
Merge pull request #811 from bhandras/looprpc-mod
looprpc: Convert looprpc into a Versioned Module
2024-08-21 17:30:53 +02:00
Andras Banki-Horvath
64886dfc66
looprpc: convert looprpc into a versioned module
This commit transforms the looprpc subpackage into a versioned module.
By doing so, projects that rely solely on the generated RPC code from
the proto files will benefit from significantly reduced dependencies
during compilation.
2024-08-21 16:46:33 +02:00
Boris Nagaev
07791664c6
Merge pull request #809 from starius/sweepbatcher-tx-label
sweepbatcher: customize transaction labels
2024-08-13 10:46:20 -03:00
Boris Nagaev
7fb7c2bda1
sweepbatcher: customize transaction labels
Previously sweepbatcher used loop/labels.LoopOutBatchSweepSuccess to assign
transactions labels. The value is "BatchOutSweepSuccess -- $batch_id", which
does not fit use cases outside of loop-out. Now there is option WithTxLabeler
which sets a function used to generate the label.
2024-08-13 10:42:00 -03:00
Boris Nagaev
98fa740375
Merge pull request #801 from starius/sweepbatcher-wait
sweepbatcher: add options WithInitialDelay and WithPublishDelay
2024-08-13 10:34:32 -03:00
Boris Nagaev
9af6718089
sweepbatcher: test InitialDelay and PublishDelay
Tested scenarios:

1. For a regular sweep newly added it waits for initialDelay + publishDelay
   before publishing a transaction.
2. For a sweep recovered from DB it does not wait before publishing tx.
3. If a sweep is about to expire, initialDelay is skipped.
2024-08-13 10:28:11 -03:00
Boris Nagaev
3f56345492
sweepbatcher: add option WithPublishDelay
WithPublishDelay sets the delay of batch publishing that is applied in the
beginning, after the appearance of a new block in the network or after the
end of initial delay (see WithInitialDelay). It is needed to prevent
unnecessary transaction publishments when a spend is detected on that block.
Default value depends on the network: 5 seconds in mainnet, 0.5s in testnet.
For batches recovered from DB this value is always 0s.
2024-08-13 09:20:31 -03:00
Boris Nagaev
e178d32717
sweepbatcher: add option WithInitialDelay
WithInitialDelay instructs sweepbatcher to wait for the duration provided
after new batch creation before it is first published. This facilitates
better grouping. It only affects newly created batches, not batches loaded from
DB, so publishing does happen in case of a daemon restart (especially important
in case of a crashloop). Defaults to 0s. If a sweep is about to expire (time
until timeout is less that 2x initialDelay), then waiting is skipped.
2024-08-13 09:20:31 -03:00
Boris Nagaev
429eb85e14
sweepbatcher: use lnd/clock for timers
Added option: WithClock. Use it for publishDelay timer.
It will be used for testing.
2024-08-13 09:20:31 -03:00
Boris Nagaev
d7fa4ab94d
test.Guard: make timeout configurable 2024-08-13 09:20:31 -03:00
Boris Nagaev
be69653bf0
sweepbatcher/store: remove unused field clock 2024-08-13 09:20:31 -03:00
Boris Nagaev
ce4a4d97a5
sweepbatcher: rename a private const
Renamed defaultPublishDelay to defaultTestnetPublishDelay. Its godoc was already
for defaultTestnetPublishDelay, but the const was named defaultPublishDelay.
2024-08-13 09:20:31 -03:00
Boris Nagaev
6d3a488f2f
Merge pull request #802 from lightninglabs/dependabot/go_modules/github.com/docker/docker-25.0.6incompatible
build(deps): bump github.com/docker/docker and cli from 24.0.9+incompatible to 27.1.1+incompatible
2024-08-12 12:44:06 -03:00
Boris Nagaev
1aec52c719
go.mod: update docker and cli to 27.1.1
Fix build in https://github.com/lightninglabs/loop/pull/802
2024-08-12 12:29:18 -03:00
dependabot[bot]
fa3b9b3a96
build(deps): bump github.com/docker/docker
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 24.0.9+incompatible to 25.0.6+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v24.0.9...v25.0.6)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-12 12:29:18 -03:00
Boris Nagaev
7cfee83912
Merge pull request #804 from starius/fix-AddSuccessToEstimator
swap: fix leaf estimation in AddSuccessToEstimator
2024-08-12 12:28:41 -03:00
Boris Nagaev
fa8703f052
swap: fix leaf estimation in AddSuccessToEstimator
According to AddTapscriptInput's godoc, the first argument (leafWitnessSize)
must include not the whole size of witness, but only the size of data consumed
by the revealed script. Previously the value was too high, because it also
included the following extra elements: number_of_witness_elements (1 byte),
witness script and its size, control block and its size.

Tests for greedy_batch_selection were affected by this change.
2024-08-12 12:18:36 -03:00
András Bánki-Horváth
a5180ffcd3
Merge pull request #808 from drawdrop/master
chore: fix some function names
2024-08-12 17:05:52 +02:00
drawdrop
b4193dfb28 chore: fix some function names
Signed-off-by: drawdrop <cricis@icloud.com>
2024-08-12 22:59:32 +08:00
András Bánki-Horváth
44d46010a0
Merge pull request #807 from lightninglabs/alexbosworth-patch-5 2024-08-08 21:11:44 +02:00
Alex Bosworth
c367598869
version: bump version to v0.28.7-beta 2024-08-08 11:02:11 -07:00
Boris Nagaev
0c8d12a75e
Merge pull request #806 from starius/client-last-hop
client: fill LastHop in FetchSwaps
2024-08-08 10:08:40 -03:00
Boris Nagaev
ed3db3bab2
client: fill LastHop in FetchSwaps
Loop used to "forget" last_hop of swaps created before its restart.
The commit fixes this.

Added test TestFetchSwapsLastHop for this. Filled field abandonChans in test
utility function newSwapClient because the field is used in new test.

Fixes https://github.com/lightninglabs/loop/issues/798
2024-08-08 10:00:36 -03:00
Boris Nagaev
8c97c60bb4
Merge pull request #803 from starius/loop-cli-path-opts-fix
cmd/loop: fix path options and loopDir interaction
2024-08-05 10:44:19 -03:00
Boris Nagaev
dd57e8fb4e
cmd/loop: fix path options and loopDir interaction
According to the comment in the code, loopdir should affect tls cert path and
macaroon path only if custom values were not set for them. However the actual
code ignored custom tls cert path and macaroon path if loopdir and/or network
was changed. For instance, the following call:

loop --network regtest --tlscertpath tls.cert --macaroonpath loop.macaroon

resulted in using ~/.loop/regtest/tls.cert and ~/.loop/regtest/loop.macaroon
instead of the files provided.

This commit fixes the code to match the description in the comment.
Also the comment was updated to mention custom network setting in addition
to custom loopdir.
2024-08-05 00:37:41 -03:00
András Bánki-Horváth
d8361e3105
Merge pull request #795 from yingshanghuangqiao/master
chore: fix some comments
2024-07-22 10:59:13 +02:00
yingshanghuangqiao
57ebc3ff16 chore: fix some comments
Signed-off-by: yingshanghuangqiao <yingshanghuangqiao@foxmail.com>
2024-07-22 16:11:16 +08:00
András Bánki-Horváth
70b0af1452
Merge pull request #794 from crystalstall/master
chore: fix some comments for struct field
2024-07-19 08:36:47 +02:00
crystalstall
27a234db66 chore: fix some comments for struct field
Signed-off-by: crystalstall <crystalruby@qq.com>
2024-07-19 14:20:07 +08:00
Boris Nagaev
4c490398e4
Merge pull request #787 from starius/sweepbatcher-greedy-batch-selection
sweepbatcher: add greedy batch selection algorithm
2024-07-18 14:19:03 -03:00