Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MWEB Light Client #8

Open
wants to merge 38 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
97378d8
Allow p2pkh outputs to be spent
hectorchu Jan 8, 2024
83b49cc
Allow shutdown during recovery
hectorchu Jan 8, 2024
8b1b72a
Fix mobile build
hectorchu Jan 8, 2024
0cfc33f
Fix compat with latest ltcd
hectorchu Jan 8, 2024
6d54898
Add mweb type to NewAddress
hectorchu Jan 19, 2024
d54a5a2
Add mweb to lncli NewAddress
hectorchu Jan 21, 2024
f6c6fab
Include mweb utxos in ListUnspent
hectorchu Jan 23, 2024
9897f32
Show correct rawtx
hectorchu Feb 2, 2024
8638181
Add basic mweb integration test
hectorchu Feb 5, 2024
12afd01
Simplify
hectorchu Feb 5, 2024
3bc8546
Remove the need to build and install lnd beforehand
hectorchu Feb 5, 2024
9778db9
Test mweb send within wallet
hectorchu Feb 6, 2024
0d173b8
Check txhash
hectorchu Feb 6, 2024
b9cb835
Add pegout test
hectorchu Feb 6, 2024
4653ec9
Test pegout maturity
hectorchu Feb 6, 2024
5f1e9c3
Add pegin to self test
hectorchu Feb 6, 2024
6d49525
Simplify generate
hectorchu Feb 6, 2024
d5f4ff1
Test send mweb to litecoind
hectorchu Feb 6, 2024
75739e9
Test pegout to litecoind
hectorchu Feb 6, 2024
752d47f
Complex pegin-pegout transaction
hectorchu Feb 7, 2024
7fc99c3
Many inputs/outputs test
hectorchu Feb 7, 2024
161fb0f
Add stress test
hectorchu Feb 15, 2024
a15798a
Tidy up
hectorchu Feb 15, 2024
13ca4da
Stress test lnd -> lnd
hectorchu Feb 15, 2024
8d54b26
Upgraded transaction detail
hectorchu Feb 16, 2024
e0f6b25
Use ConnectPeer method
hectorchu Feb 17, 2024
652eda0
Update test values
hectorchu Feb 18, 2024
0560529
Revert previous commit
hectorchu Feb 19, 2024
01d0b34
v21 doesn't have -rpcwaittimeout
hectorchu Feb 19, 2024
f6742d9
Fix mweb test
hectorchu Feb 23, 2024
eff15e3
Fix build
hectorchu Feb 23, 2024
dc17b5b
Fix protos
hectorchu Feb 23, 2024
e3ca0ed
Switching to go workspaces
hectorchu Feb 28, 2024
7fda18c
Add mweb witness types
hectorchu Mar 1, 2024
9a786eb
Skip mweb segwit outputs in test
hectorchu Mar 1, 2024
49c6ae3
Update fees in test
hectorchu Mar 4, 2024
319fdd1
Generate android protos
hectorchu Mar 8, 2024
e7902a1
Fix crash on systems which don't have localhost
hectorchu Apr 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,6 @@ coverage.txt
# Release build directory (to avoid build.vcs.modified Golang build tag to be
# set to true by having untracked files in the working directory).
/lnd-*/

*.pb.swift
*.java
4 changes: 2 additions & 2 deletions cert/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ module github.com/ltcsuite/lnd/cert

go 1.19

require github.com/stretchr/testify v1.8.2
require github.com/stretchr/testify v1.8.3

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/kr/pretty v0.3.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
13 changes: 2 additions & 11 deletions cert/go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
Expand All @@ -13,20 +12,12 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
4 changes: 2 additions & 2 deletions channeldb/migration_01_to_11/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ func (r *Route) ToSphinxPath() (*sphinx.PaymentPath, error) {
hopData.NextAddress[:], nextHop,
)

payload, err = sphinx.NewLegacyHopPayload(&hopData)
//payload, err = sphinx.NewLegacyHopPayload(&hopData)
if err != nil {
return nil, err
}
Expand All @@ -294,7 +294,7 @@ func (r *Route) ToSphinxPath() (*sphinx.PaymentPath, error) {
return nil, err
}

payload, err = sphinx.NewTLVHopPayload(b.Bytes())
//payload, err = sphinx.NewTLVHopPayload(b.Bytes())
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions clock/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ module github.com/ltcsuite/lnd/clock

go 1.19

require github.com/stretchr/testify v1.8.2
require github.com/stretchr/testify v1.8.3

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/kr/pretty v0.3.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
13 changes: 2 additions & 11 deletions clock/go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
Expand All @@ -13,20 +12,12 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
10 changes: 8 additions & 2 deletions cmd/lncli/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ var newAddressCommand = cli.Command{
Generate a wallet new address. Address-types has to be one of:
- p2wkh: Pay to witness key hash
- np2wkh: Pay to nested witness key hash
- p2tr: Pay to taproot pubkey`,
- p2tr: Pay to taproot pubkey
- mweb: MWEB`,
Action: actionDecorator(newAddress),
}

Expand Down Expand Up @@ -178,9 +179,14 @@ func newAddress(ctx *cli.Context) error {
if unused {
addrType = lnrpc.AddressType_UNUSED_TAPROOT_PUBKEY
}
case "mweb":
addrType = lnrpc.AddressType_MWEB
if unused {
addrType = lnrpc.AddressType_UNUSED_MWEB
}
default:
return fmt.Errorf("invalid address type %v, support address type "+
"are: p2wkh, np2wkh, and p2tr", stringAddrType)
"are: p2wkh, np2wkh, p2tr, and mweb", stringAddrType)
}

client, cleanUp := getClient(ctx)
Expand Down
6 changes: 3 additions & 3 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1385,13 +1385,13 @@ func ValidateConfig(cfg Config, interceptor signal.Interceptor, fileParser,
// At least one RPCListener is required. So listen on localhost per
// default.
if len(cfg.RawRPCListeners) == 0 {
addr := fmt.Sprintf("localhost:%d", defaultRPCPort)
addr := fmt.Sprintf("127.0.0.1:%d", defaultRPCPort)
cfg.RawRPCListeners = append(cfg.RawRPCListeners, addr)
}

// Listen on localhost if no REST listeners were specified.
if len(cfg.RawRESTListeners) == 0 {
addr := fmt.Sprintf("localhost:%d", defaultRESTPort)
addr := fmt.Sprintf("127.0.0.1:%d", defaultRESTPort)
cfg.RawRESTListeners = append(cfg.RawRESTListeners, addr)
}

Expand All @@ -1403,7 +1403,7 @@ func ValidateConfig(cfg Config, interceptor signal.Interceptor, fileParser,
if len(cfg.RawListeners) == 0 {
addr := fmt.Sprintf(":%d", defaultPeerPort)
if cfg.Tor.Active && !cfg.Tor.SkipProxyForClearNetTargets {
addr = fmt.Sprintf("localhost:%d", defaultPeerPort)
addr = fmt.Sprintf("127.0.0.1:%d", defaultPeerPort)
}
cfg.RawListeners = append(cfg.RawListeners, addr)
}
Expand Down
Loading