Compare commits

...

42 Commits

Author SHA1 Message Date
Slyghtning ac8f146186
Merge pull request #739 from hieblmi/static-addr-staging
Rebase static-addr staging
3 weeks ago
Slyghtning ce6c2e7acd
Merge branch 'static-addr-staging' into static-addr-staging 3 weeks ago
Slyghtning 7c17c27b76
staticaddr: public deposit method scope 4 weeks ago
Slyghtning 239f6b4676
unit: manager tests 4 weeks ago
Slyghtning 45f9b6a53b
staticaddr: add swap client to cmd 4 weeks ago
Slyghtning aaa86f7f62
staticaddr: deposits for server and daemon 4 weeks ago
Slyghtning 0e1b4dc44c
staticaddr: deposit manager and fsm 4 weeks ago
Slyghtning 2b3b3a8961
staticaddr: deposit logger 4 weeks ago
Slyghtning 246d4ddeda
istaticaddr: interfaces 4 weeks ago
Slyghtning edfb154b43
sqlc: deposit queries, models and migrations 4 weeks ago
Slyghtning 8a38b1309d
looprpc: include static address in swap client
We remove the static address client and add its
rpcs into the SwapClient
4 weeks ago
Slyghtning 95e704aa5a
gomod: tidy 4 weeks ago
Slyghtning 34f05ccda5
daemon: integrate static address manager and sql store 4 weeks ago
Slyghtning 5630f39ac9
loop: static address creation client command 4 weeks ago
Slyghtning 995fb6534e
loop: list unspent static address outputs 4 weeks ago
Slyghtning 0eb787ed29
perms: list unspent outputs 4 weeks ago
Slyghtning 9352f17285
staticaddr: list unspent outputs in server 4 weeks ago
Slyghtning 7192cdfa6d
staticaddr: track and list spends in manager 4 weeks ago
Slyghtning 2e397d55bb
looprpc: list unspent static address 4 weeks ago
Slyghtning c2a8b72127
gomod: tidy 4 weeks ago
Slyghtning ffec5e143a
loop: static address creation client command 4 weeks ago
Slyghtning cc97b7b712
perms: static address creation permission 4 weeks ago
Slyghtning 0178eeb3cc
staticaddr: static address server 4 weeks ago
Slyghtning 9baaede4de
staticaddr: static address manager 4 weeks ago
Slyghtning 46b6dd28c9
loopdb: static address store 4 weeks ago
Slyghtning d2a28a0b90
log: static address sub logger 4 weeks ago
Slyghtning 2afdd0929f
looprpc: static address creation 4 weeks ago
Slyghtning 7915aab1c0
swapserverrpc: static address creation support 4 weeks ago
Slyghtning 883d83a85a
sqlc: static address migrations, models, queries 4 weeks ago
Slyghtning 7a8c052e8c
Merge pull request #736 from hieblmi/daemon-chore
daemon: fix wrapped errors and typos
4 weeks ago
Slyghtning 636f8b611b
daemon: fix wrapped errors and typos 4 weeks ago
András Bánki-Horváth e5dd7add8a
Merge pull request #738 from lightninglabs/sweep-logging
sweepbatcher: add more debug logging
1 month ago
Andras Banki-Horvath 75d7641d74
sweepbatcher: add more debug logging 1 month ago
András Bánki-Horváth 13e8c29520
Merge pull request #730 from starius/s-lsat-l402
multi: replace occurrences of "LSAT" to "L402"
1 month ago
Boris Nagaev 5a1f79557d
loopd: re-add GetLsatTokens method in gRPC
This is needed not to break existing client binaries, e.g. `loop listauth`,
Terminal Web, RTL.

The API should be removed in a couple of releases. For now, GetLsatTokens
just prints a warning message about the API being deprecated and that the
client binary should be updated, and calls GetL402Tokens API, as a wrapper.

Type LsatToken used by GetLsatTokens in the past was renamed to L402Token,
but this does not affect binary encoding, so type L402Token can be used
(as part of TokensResponse) without breaking backward compatibility.

Updated release_notes.md.

See https://github.com/lightninglabs/loop/pull/730#discussion_r1579251294
1 month ago
Boris Nagaev 14dc8e165d
looprpc: additional_bindings for /v1/lsat/tokens
Provide backward compatibility for clients using this API endpoint.
1 month ago
Boris Nagaev 7bb04ae6ac
loopd: recorgnize maxlsatcost and maxlsatfee flags
The flags were re-added in hidden mode so that users who specified them
could start the daemon after upgrading. If a flag is used, a deprecation
warning is printed.

Updated release_notes.md.
1 month ago
Boris Nagaev 0e7927ac96
multi: replace LSAT with L402
git mv ./cmd/loop/lsat.go ./cmd/loop/l402.go
sed 's@lsat@l402@g' -i `git grep -l lsat`
sed 's@Lsat@L402@g' -i `git grep -l Lsat`
sed 's@LSAT@L402@g' -i `git grep -l LSAT`
make rpc

Updated release_notes.md.
1 month ago
Boris Nagaev bfc3f44aa1
update aperture to include lsat to l402 renaming
Fix the build:
go mod tidy
sed 's@\<lsat\>@l402@g' -i `git grep -l -w aperture/lsat`
make rpc
1 month ago
Boris Nagaev b99cde172a
go: bump protobuf to v1.33.0-hex-display 1 month ago
Boris Nagaev 368432ebb4
looprpc,swapserverrpc: update Go image to 1.21.9-bookworm
This is needed to update protobuf. Version 1.33 breaks in Go 1.16 with
the following error: "//go:build comment without // +build comment".

Distribution was updated from buster (10) to bookworm (12).
protoc was updated from v3.6.1 to v3.21.12.
1 month ago
Boris Nagaev e30cb5f2a8
multi: apply make fmt 1 month ago

@ -152,8 +152,8 @@ func NewClient(dbDir string, loopDB loopdb.SwapStore,
LndServices: cfg.Lnd,
Server: swapServerClient,
Conn: swapServerClient.conn,
Store: loopDB,
L402Store: l402Store,
Store: loopDB,
CreateExpiryTimer: func(d time.Duration) <-chan time.Time {
return time.NewTimer(d).C
},

@ -53,7 +53,7 @@ type ListenerCfg struct {
// on the passed TLS configuration.
restListener func(*tls.Config) (net.Listener, error)
// getLnd returns a grpc connection to an lnd instance.
// getLnd returns a grpc connection to a lnd instance.
getLnd func(lndclient.Network, *lndConfig) (*lndclient.GrpcLndServices,
error)
}
@ -120,9 +120,9 @@ func New(config *Config, lisCfg *ListenerCfg) *Daemon {
// Start starts loopd in daemon mode. It will listen for grpc connections,
// execute commands and pass back swap status information.
func (d *Daemon) Start() error {
// There should be no reason to start the daemon twice. Therefore return
// an error if that's tried. This is mostly to guard against Start and
// StartAsSubserver both being called.
// There should be no reason to start the daemon twice. Therefore,
// return an error if that's tried. This is mostly to guard against
// Start and StartAsSubserver both being called.
if atomic.AddInt32(&d.started, 1) != 1 {
return errOnlyStartOnce
}
@ -137,7 +137,7 @@ func (d *Daemon) Start() error {
// With lnd connected, initialize everything else, such as the swap
// server client, the swap client RPC server instance and our main swap
// and error handlers. If this fails, then nothing has been started yet
// and error handlers. If this fails, then nothing has been started yet,
// and we can just return the error.
err = d.initialize(true)
if errors.Is(err, bbolt.ErrTimeout) {
@ -324,7 +324,7 @@ func (d *Daemon) startWebServers() error {
err := d.restServer.Serve(d.restListener)
// ErrServerClosed is always returned when the proxy is
// shut down, so don't log it.
if err != nil && err != http.ErrServerClosed {
if err != nil && !errors.Is(err, http.ErrServerClosed) {
// Notify the main error handler goroutine that
// we exited unexpectedly here. We don't have to
// worry about blocking as the internal error
@ -343,7 +343,7 @@ func (d *Daemon) startWebServers() error {
log.Infof("RPC server listening on %s", d.grpcListener.Addr())
err = d.grpcServer.Serve(d.grpcListener)
if err != nil && err != grpc.ErrServerStopped {
if err != nil && !errors.Is(err, grpc.ErrServerStopped) {
// Notify the main error handler goroutine that
// we exited unexpectedly here. We don't have to
// worry about blocking as the internal error
@ -719,9 +719,9 @@ func (d *Daemon) initialize(withMacaroonService bool) error {
var runtimeErr error
// There are only two ways this goroutine can exit. Either there
// is an internal error or the caller requests shutdown. In both
// cases we wait for the stop to complete before we signal the
// caller that we're done.
// is an internal error or the caller requests a shutdown.
// In both cases we wait for the stop to complete before we
// signal the caller that we're done.
select {
case runtimeErr = <-d.internalErrChan:
log.Errorf("Runtime error in daemon, shutting down: "+
@ -730,7 +730,7 @@ func (d *Daemon) initialize(withMacaroonService bool) error {
case <-d.quit:
}
// We need to shutdown before sending the error on the channel,
// We need to shut down before sending the error on the channel,
// otherwise a caller might exit the process too early.
d.stop()
cleanupMacaroonStore()
@ -761,7 +761,7 @@ func (d *Daemon) stop() {
d.mainCtxCancel()
}
// As there is no swap activity anymore, we can forcefully shutdown the
// As there is no swap activity anymore, we can forcefully shut down the
// gRPC and HTTP servers now.
log.Infof("Stopping gRPC server")
if d.grpcServer != nil {

@ -3,6 +3,7 @@ package sweepbatcher
import (
"bytes"
"context"
"encoding/hex"
"fmt"
"math"
"sync"
@ -700,9 +701,11 @@ func (b *batch) publishBatch(ctx context.Context) (btcutil.Amount, error) {
batchTx.TxIn[i].Witness = witness
}
b.log.Debugf("attempting to publish non-coop tx with feerate=%v, "+
"totalfee=%v, sweeps=%v, destAddr=%s", b.rbfCache.FeeRate, fee,
len(batchTx.TxIn), address.String())
b.log.Infof("attempting to publish non-coop tx=%v with feerate=%v, "+
"totalfee=%v, sweeps=%d, destAddr=%s", batchTx.TxHash(),
b.rbfCache.FeeRate, fee, len(batchTx.TxIn), address)
b.debugLogTx("serialized non-coop sweep", batchTx)
err = b.wallet.PublishTransaction(
ctx, batchTx, labels.LoopOutBatchSweepSuccess(b.id),
@ -846,9 +849,11 @@ func (b *batch) publishBatchCoop(ctx context.Context) (btcutil.Amount,
return fee, err, false
}
b.log.Debugf("attempting to publish coop tx with feerate=%v, "+
"totalfee=%v, sweeps=%v, destAddr=%s", b.rbfCache.FeeRate, fee,
len(batchTx.TxIn), address.String())
b.log.Infof("attempting to publish coop tx=%v with feerate=%v, "+
"totalfee=%v, sweeps=%d, destAddr=%s", batchTx.TxHash(),
b.rbfCache.FeeRate, fee, len(batchTx.TxIn), address)
b.debugLogTx("serialized coop sweep", batchTx)
err = b.wallet.PublishTransaction(
ctx, batchTx, labels.LoopOutBatchSweepSuccess(b.id),
@ -866,6 +871,17 @@ func (b *batch) publishBatchCoop(ctx context.Context) (btcutil.Amount,
return fee, nil, true
}
func (b *batch) debugLogTx(msg string, tx *wire.MsgTx) {
// Serialize the transaction and convert to hex string.
buf := bytes.NewBuffer(make([]byte, 0, tx.SerializeSize()))
if err := tx.Serialize(buf); err != nil {
b.log.Errorf("failed to serialize tx for debug log: %v", err)
return
}
b.log.Debugf("%s: %s", msg, hex.EncodeToString(buf.Bytes()))
}
// coopSignBatchTx collects the necessary signatures from the server in order
// to cooperatively sweep the funds.
func (b *batch) coopSignBatchTx(ctx context.Context, packet *psbt.Packet,

Loading…
Cancel
Save