From 2f17d0d2aeed0164d280cebd1020cb65e02dbe65 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Thu, 7 Dec 2023 09:59:39 +0100 Subject: [PATCH 1/3] frdrpcserver: bump REST connection gRPC max recv size --- frdrpcserver/rpcserver.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frdrpcserver/rpcserver.go b/frdrpcserver/rpcserver.go index c21e1d6..6e98e8a 100644 --- a/frdrpcserver/rpcserver.go +++ b/frdrpcserver/rpcserver.go @@ -56,8 +56,8 @@ var ( ) // maxMsgRecvSize is the largest message our REST proxy will receive. We - // set this to 200MiB atm. - maxMsgRecvSize = grpc.MaxCallRecvMsgSize(1 * 1024 * 1024 * 200) + // set this to 400MiB atm. + maxMsgRecvSize = grpc.MaxCallRecvMsgSize(400 * 1024 * 1024) // maxInvoiceQueries is the maximum number of invoices we request from // lnd at a time. From 00e6f47e2b7f7d46851ad108f7e2c9cc910327f1 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Thu, 7 Dec 2023 10:02:34 +0100 Subject: [PATCH 2/3] mod: bump to latest lndclient --- go.mod | 7 +++---- go.sum | 13 ++++++------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index 155b487..0f5c860 100644 --- a/go.mod +++ b/go.mod @@ -7,8 +7,8 @@ require ( github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f github.com/grpc-ecosystem/grpc-gateway/v2 v2.5.0 github.com/jessevdk/go-flags v1.4.0 - github.com/lightninglabs/lndclient v0.17.0-1 - github.com/lightningnetwork/lnd v0.17.0-beta + github.com/lightninglabs/lndclient v0.17.0-5 + github.com/lightningnetwork/lnd v0.17.1-beta github.com/lightningnetwork/lnd/cert v1.2.2 github.com/lightningnetwork/lnd/kvdb v1.4.4 github.com/shopspring/decimal v1.2.0 @@ -27,7 +27,7 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/btcsuite/btcd/btcutil/psbt v1.1.8 // indirect - github.com/btcsuite/btcwallet v0.16.10-0.20230804184612-07be54bc22cf // indirect + github.com/btcsuite/btcwallet v0.16.10-0.20231017144732-e3ff37491e9c // indirect github.com/btcsuite/btcwallet/wallet/txauthor v1.3.2 // indirect github.com/btcsuite/btcwallet/wallet/txrules v1.2.0 // indirect github.com/btcsuite/btcwallet/wallet/txsizes v1.2.3 // indirect @@ -141,7 +141,6 @@ require ( golang.org/x/exp v0.0.0-20230315142452-642cacee5cc0 // indirect golang.org/x/mod v0.10.0 // indirect golang.org/x/net v0.17.0 // indirect - golang.org/x/sync v0.3.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/term v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/go.sum b/go.sum index e237ca0..5fe888d 100644 --- a/go.sum +++ b/go.sum @@ -82,8 +82,8 @@ github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2/go.mod h1:7SFka0XMvUgj3hfZtyd github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= -github.com/btcsuite/btcwallet v0.16.10-0.20230804184612-07be54bc22cf h1:iZrvu/dynDPUcLJFkKiN9wnS4EdjwZSJS1H33Rx/a1Y= -github.com/btcsuite/btcwallet v0.16.10-0.20230804184612-07be54bc22cf/go.mod h1:qUPTONX2GVX7ERHvgh352/WySsfYlrkL4729qX9o9cA= +github.com/btcsuite/btcwallet v0.16.10-0.20231017144732-e3ff37491e9c h1:+7tbYEUj0TYYIvuvE9YP+x5dU3FT/8J6Qh8d5YvQwrE= +github.com/btcsuite/btcwallet v0.16.10-0.20231017144732-e3ff37491e9c/go.mod h1:WSKhOJWUmUOHKCKEzdt+jWAHFAE/t4RqVbCwL2pEdiU= github.com/btcsuite/btcwallet/wallet/txauthor v1.3.2 h1:etuLgGEojecsDOYTII8rYiGHjGyV5xTqsXi+ZQ715UU= github.com/btcsuite/btcwallet/wallet/txauthor v1.3.2/go.mod h1:Zpk/LOb2sKqwP2lmHjaZT9AdaKsHPSbNLm2Uql5IQ/0= github.com/btcsuite/btcwallet/wallet/txrules v1.2.0 h1:BtEN5Empw62/RVnZ0VcJaVtVlBijnLlJY+dwjAye2Bg= @@ -385,8 +385,8 @@ github.com/lib/pq v1.10.3 h1:v9QZf2Sn6AmjXtQeFpdoq/eaNtYP6IN+7lcrygsIAtg= github.com/lib/pq v1.10.3/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf h1:HZKvJUHlcXI/f/O0Avg7t8sqkPo78HFzjmeYFl6DPnc= github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf/go.mod h1:vxmQPeIQxPf6Jf9rM8R+B4rKBqLA2AjttNxkFBL2Plk= -github.com/lightninglabs/lndclient v0.17.0-1 h1:r/25L1P86Wjdj0UmqfMNF3Ph+SJOTeGKlOIjkX3iWiw= -github.com/lightninglabs/lndclient v0.17.0-1/go.mod h1:J2RD7ZcIVreQKy6NTOGJMM7AeGvsMLHO+Aoegkzpijs= +github.com/lightninglabs/lndclient v0.17.0-5 h1:Vb/Qu4IhrRvj55uwugx4O5f1L8TEXrqSOvEVWaGRgfg= +github.com/lightninglabs/lndclient v0.17.0-5/go.mod h1:9Lfhm/cU505Q2Rne5okgPehgXOXaeonYpdTYZ3sr3Eg= github.com/lightninglabs/neutrino v0.16.0 h1:YNTQG32fPR/Zg0vvJVI65OBH8l3U18LSXXtX91hx0q0= github.com/lightninglabs/neutrino v0.16.0/go.mod h1:x3OmY2wsA18+Kc3TSV2QpSUewOCiscw2mKpXgZv2kZk= github.com/lightninglabs/neutrino/cache v1.1.1 h1:TllWOSlkABhpgbWJfzsrdUaDH2fBy/54VSIB4vVqV8M= @@ -395,8 +395,8 @@ github.com/lightninglabs/protobuf-go-hex-display v1.30.0-hex-display h1:pRdza2wl github.com/lightninglabs/protobuf-go-hex-display v1.30.0-hex-display/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= github.com/lightningnetwork/lightning-onion v1.2.1-0.20230823005744-06182b1d7d2f h1:Pua7+5TcFEJXIIZ1I2YAUapmbcttmLj4TTi786bIi3s= github.com/lightningnetwork/lightning-onion v1.2.1-0.20230823005744-06182b1d7d2f/go.mod h1:c0kvRShutpj3l6B9WtTsNTBUtjSmjZXbJd9ZBRQOSKI= -github.com/lightningnetwork/lnd v0.17.0-beta h1:Vzl2W3ClIDdffuQD5IaZwyP7CKR/CbXxWqws72Cq51g= -github.com/lightningnetwork/lnd v0.17.0-beta/go.mod h1:8w27nArqZ1P7U6FP9U78GlaTLNm7u9GhV5Edv1C1yRU= +github.com/lightningnetwork/lnd v0.17.1-beta h1:ya5pXahwrEJ9Sj9TQu0rIsOr1dMK8myuFMslZlmVmhA= +github.com/lightningnetwork/lnd v0.17.1-beta/go.mod h1:wgnCM0tlwxUDZ9y7CeBkXtBJkaY45+R8A3XAgsFS0MA= github.com/lightningnetwork/lnd/cert v1.2.2 h1:71YK6hogeJtxSxw2teq3eGeuy4rHGKcFf0d0Uy4qBjI= github.com/lightningnetwork/lnd/cert v1.2.2/go.mod h1:jQmFn/Ez4zhDgq2hnYSw8r35bqGVxViXhX6Cd7HXM6U= github.com/lightningnetwork/lnd/clock v1.0.1/go.mod h1:KnQudQ6w0IAMZi1SgvecLZQZ43ra2vpDNj7H/aasemg= @@ -726,7 +726,6 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= From bb8671250f32745f9b370b86c9e9b126ca9e11ce Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Thu, 7 Dec 2023 19:49:26 +0100 Subject: [PATCH 3/3] config+faraday: allow lnd request timeout to be configured --- config.go | 3 +++ faraday.go | 1 + 2 files changed, 4 insertions(+) diff --git a/config.go b/config.go index 475af83..9620503 100644 --- a/config.go +++ b/config.go @@ -106,6 +106,9 @@ type LndConfig struct { // TLSCertPath is the path to the tls cert that faraday should use. TLSCertPath string `long:"tlscertpath" description:"Path to TLS cert"` + + // RequestTimeout is the maximum time to wait for a response from lnd. + RequestTimeout time.Duration `long:"requesttimeout" description:"The maximum time to wait for a response from lnd, if not set the default of 30 seconds will be used."` } type Config struct { //nolint:maligned diff --git a/faraday.go b/faraday.go index f3a1d60..7363e8b 100644 --- a/faraday.go +++ b/faraday.go @@ -76,6 +76,7 @@ func Main() error { CustomMacaroonPath: config.Lnd.MacaroonPath, TLSPath: config.Lnd.TLSCertPath, CheckVersion: MinLndVersion, + RPCTimeout: config.Lnd.RequestTimeout, }) if err != nil { return fmt.Errorf("cannot connect to lightning services: %v",