2
0
mirror of https://github.com/lightninglabs/loop synced 2024-11-16 00:12:52 +00:00
Commit Graph

82 Commits

Author SHA1 Message Date
George Tsagkarelis
e0d85958f7
multi: move StoreMock to loopdb 2024-01-23 20:38:06 +02:00
George Tsagkarelis
99608ad515
loopdb+sweepbatcher: add sweepbatcher store 2024-01-23 20:38:06 +02:00
sputn1ck
a29f7e4a6b
loopdb: add reservation sqlc code 2024-01-17 15:59:05 +01:00
Konstantin Nick
9f2bf5ca07
Merge pull request #682 from sputn1ck/fix_faulty_timestamps
Fix faulty timestamps
2024-01-04 15:13:54 +01:00
sputn1ck
d36c154151
loopdb: fix unit test 2024-01-04 15:08:20 +01:00
sputn1ck
57fa22b095
loopdb: remove unused code 2024-01-04 15:08:19 +01:00
elbandi
d6be549e17
loopdb: Fix PublicationDeadline
This commit fixes the publication deadline based on the swaps invoice
timestamp.
2024-01-04 15:07:32 +01:00
bitcoin-lightning
aefabfaeed
fix typo in store.go 2024-01-02 13:04:21 +08:00
bitcoin-lightning
864d4e5cdd
fix typo in sqlite.go 2024-01-02 13:03:38 +08:00
Slyghtning
0bd4b7cf89
loopdb: state insufficient confirmed funds 2023-11-27 13:46:18 +01:00
Slyghtning
0fbf253391
loopdb: abandon swap state 2023-11-24 11:09:54 +01:00
sputn1ck
b8ada0416c
loopdb: fix leapyear parsing 2023-10-31 17:08:51 +01:00
Oliver Gugger
08026dab93
multi: update linter, fix issues 2023-10-03 19:36:40 +02:00
sputn1ck
942b0dc1bb
loopdb: change faulty year migration logic
This commit changes how the faulty year migration works, by just
checking if the deadline is far in the future and then
fixing it.
2023-08-24 16:21:25 +02:00
kon
64bdef9238
sqldb: change time parsing function
This commit changes the time parsing function to use the time.Parse
function instead of the prior manual parsing. Only if the year is
far in the future, we replace it with the current year.
2023-08-24 16:09:37 +02:00
sputn1ck
5cafa34ae9
loopdb: fix timestamp parsing 2023-08-08 15:20:00 +02:00
sputn1ck
be9ca71bf2
loopd: convert unix millisecond timestamps to seconds 2023-08-08 08:42:16 +02:00
sputn1ck
f25b5e9626
loopdb: fix faulty timestamps on startup
This commit fixes faulty timestamps caused by using unix milliseconds
as unix seconds on startup.
This commit also adds a test for the lightning-terminal issue that first
reported the bug.
2023-08-07 21:04:30 +02:00
sputn1ck
69b4df0d9b
loopdb: add migrator
This commit adds a migrator to the loopdb package that manages migrating
between 2 databases
2023-06-20 18:59:31 +02:00
sputn1ck
3ee5bb6365
loopdb: add postgres store
This commit adds a postgres store to the loopdb package.
Ths postgres migrator uses a replacer filesystem to replace the
sqlite types to postgres types in the migration.
2023-06-20 18:59:30 +02:00
sputn1ck
ab8923fc38
loopdb: add sqlite test files 2023-06-20 18:59:25 +02:00
sputn1ck
9278c18768
loopdb: add nil check to boltdb liquidity test
This commit adds a nil check to the boltdb liquidity test. There was
a difference between the sqlite and boltdb implementation. This test
covers that.
2023-06-20 18:59:24 +02:00
sputn1ck
0826b748f5
loopdb: add sqlite store implementation 2023-06-20 18:59:23 +02:00
sputn1ck
f8c65bbc4c
loopdb: create base sqlite store 2023-06-20 17:31:40 +02:00
sputn1ck
206e463db7
loopdb: generate sqlc files 2023-06-20 17:31:40 +02:00
sputn1ck
85a757f635
loopdb: implement sqlite queries 2023-06-20 17:31:40 +02:00
sputn1ck
3c58e98a0f
loopdb: add loopdb sqlite migrations 2023-06-20 17:31:39 +02:00
sputn1ck
5d9d7c5c6e
loopdb: add batch insert
This commit adds a batch insert to the interface. This greatly reduces
the time the migration will take. It is not implemented for the boltdb, as
we will not be supporting migrating to the boltdb.
2023-06-20 14:06:05 +02:00
sputn1ck
becc8a38d8
multi: use context in loopdb call
This commit adds a context to our loopdb interface, which we should use
in the sqlite migration.
2023-06-19 12:28:32 +02:00
sputn1ck
960a78be3d
protocol: set musig2 to be the stable version
This commit changes the stable protocol version to be the Musig2 protocol.
The experimental version is set to the stable version
in order for the flag to still work if a user has it set.
2023-04-25 17:26:01 +02:00
Andras Banki-Horvath
da4bcbea10
loopdb: refactor the SwapContract to hold all HTLC keys
This commit adds a new struct to hold all HTLC keys and refactors the
SwapContract which is used by both loopin and loopout swaps to use this
new struct. The newly added internal keys will for now hold the script
keys to keep everything equivalent but are already stored and read back
if the protocol version is set to MuSig2.
2023-03-20 20:08:43 +01:00
Andras Banki-Horvath
cc5e26b9c9
proto: extend protocol with key reveal building blocks and new version
This commit adds a new protocol version which will add MuSig2 loop in
and loop out using key reveal and extends the existing protocol with new
message members to be able to pass around htlc internal public keys.

The commit also fixes some minor formatting issues in the server proto.
2023-03-20 20:08:42 +01:00
George Tsagkarelis
7c6abc0d67
loopdb: add tests for new store methods 2023-03-09 00:43:06 +02:00
George Tsagkarelis
4f20239dbb
loopdb: extend store methods for fetching single swap 2023-03-09 00:43:06 +02:00
sputn1ck
4baf88c414
multi: fix linter issues
This commit fixes outstanding linter issues, that we're not found by
running `make lint` locally. The linter issues were found by running
`docker run -v $(pwd):/build loop-tools golangci-lint run --whole-files`

I added the `revive` to the excludes as it would be to much of a
refactor and IMO seems unneccesary. E.g.
`interface.go:222:6: exported: type name will be used as
loop.LoopInTerms by other packages, and that stutters; consider
 calling this InTerms (revive)`. I think `loop.LoopInTerms` is fine.
2022-12-15 18:08:38 +01:00
Andras Banki-Horvath
a252e2c706
loopdb: add the local pubkey's keylocator to the persisted contract 2022-06-30 16:59:57 +02:00
Andras Banki-Horvath
00cf4bf71c
multi: make the next protocol version optional 2022-06-30 16:59:54 +02:00
Andras Banki-Horvath
9b37d744a0
multi: add ProtocolVersion_HTLC_V3 2022-06-30 16:59:54 +02:00
yyforyongyu
26edd21889
loopdb: add new bucket to save liquidity params
This commit adds a new bucket to save liquidity parameters. We've
skipped the serialization and deserialization implementations here and
leave them to be handled by the liquidity package.
2022-06-07 19:19:53 +08:00
sputn1ck
a1271fee40
multi: fix linter issues 2022-05-20 10:16:46 +02:00
Harsha Goli
7a16e3b25d
multi: bump btcec/v2 and btcutil to new versions 2022-03-25 11:00:16 +01:00
Andras Banki-Horvath
0f002733f6
loop: extend server protocol for routing plugin recommendations
This commits extends the server protocol with routing plugin
recommendations and routing result reporting.
2022-02-14 10:14:42 +01:00
carla
167cef4f6b
loopdb: alias swapserverrpc with looprpc
Packages importing loop can't import this package without aliasing
the import.
2021-12-13 15:23:36 +02:00
carla
dad103530f
multi: move server proto files to their own directory
Protobuf does not allow naming conflicts for files within the same
process, because all proto messages register themselves in a global
registry.

This is problematic because the server's itests import the client's
looprpc package to make rpc queries to the loopd client, thus importing
duplicate common.proto and server.proto from the client's looprc package
(since they're both in there as well).

This change moves the server's proto files into their own directory so
that they are not imported when we want to use the client's files. We
cannot change the package name for the server, because that would be
a breaking change (the package name is included in URIS). Fortunately,
we have the go_package option which allows us to place generated files
in a different location.
2021-12-13 13:56:40 +02:00
carla
26886731d4
multi: remove shadowed label variable in loopin swaps
We already have a Label field in the embedded SwapContract
field for loop in swaps. This commit removes an erroneously
added Label field in LoopInContract which may be a cause of
ambiguity when referencing this field.
2021-12-09 13:40:34 +02:00
Andras Banki-Horvath
f786aaa016
loop: add support for the probe API 2021-07-30 13:22:12 +02:00
carla
71501ef2e8
looprpc: add server cancelation rpc to server.proto 2021-05-24 08:40:12 +02:00
Oliver Gugger
39c8c9278d
loopd+loopdb: add timeout to DB open
To make sure we don't just block for forever if another Loop daemon
process is already running, we add a timeout and error out if obtaining
the unique file lock fails after 5 seconds.
2021-04-28 17:16:27 +02:00
carla
692620d367
liquidity: add fee budget to swap suggestions
Add a dated fee budget to our swap suggestions. This budget only applies
to automatically dispatched swaps (which will be added in later
commits). We choose to apply the fee budget to our suggestions so that
they perfectly replicate what the autolooper would do. The budget has a
start date so that it can be refreshed once it has been used up over a
period (rather than having to endlessly increase it).
2020-10-12 13:34:54 +02:00
carla
7b56804bbe
multi: move label validation to rpc and simplify validation function
Previously labels with reserved prefixes were added to provide us
with a way to identify automatically dispatched loops. This commit moves
the validation of these labels to the rpc level so that it will only
apply to user-initiated swaps.
2020-10-12 13:34:52 +02:00