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

[psbt saga part 3/4]: taprpc: add CommitVirtualPsbts and PublishAndLogTransfer RPC methods #787

Merged
merged 20 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
60a9027
mod+itest: update to lnd version with FundPsbt update, fix itest
guggero Mar 4, 2024
d706465
tapfreighter+tapsend: add PrepareAnchoringTemplate function
guggero Mar 4, 2024
2977238
proof: add encoding/decoding convenience funcs
guggero Mar 4, 2024
f08c9b8
rpcserver: use convenience methods, fix code style
guggero Mar 4, 2024
8cc32f3
multi: add input proofs for passive assets
guggero Mar 4, 2024
64d486e
rpcserver+taprpc: return passive assets in FundVirtualPsbts
guggero Mar 4, 2024
b24d2cd
tapsend+tapfreighter: move anchor script generation
guggero Mar 4, 2024
90f63da
tapsend: refactor and extend packet validation
guggero Mar 4, 2024
ff9af11
commitment: fix panic with Delete on empty commitment
guggero Mar 4, 2024
ce6a9f6
tapfreighter: allow internal key to be unknown
guggero Mar 4, 2024
7e7dc19
tapsend+tapfreighter: move asset pruning
guggero Mar 4, 2024
d78ba83
tapsend+tapfreighter: refactor and unify packet creation
guggero Mar 4, 2024
f8946c4
multi: add CommitVirtualPsbts RPC
guggero Mar 4, 2024
1f0f671
tapfreighter: prepare parcel for logging multiple vPackets
guggero Mar 4, 2024
f0d1950
multi: add PublishAndLogTransfer RPC
guggero Mar 4, 2024
b582d49
tapfreighter: turn on full validation before logging
guggero Mar 4, 2024
23bc175
multi: unlock lnd's outputs on permanent failure
guggero Mar 4, 2024
16c7c3f
itest: add external commitment via PSBT itest
guggero Mar 4, 2024
f7a791f
itest: reduce proof courier ack timeout
guggero Mar 4, 2024
8280b00
itest: further reduce itest run time
guggero Mar 4, 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
5 changes: 5 additions & 0 deletions commitment/asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@ func (c *AssetCommitment) Delete(oldAsset *asset.Asset) error {
return ErrAssetTypeMismatch
}

// Deleting from an empty tree is a no-op.
if len(c.assets) == 0 {
return nil
}

key := oldAsset.AssetCommitmentKey()

// TODO(bhandras): thread the context through.
Expand Down
10 changes: 10 additions & 0 deletions fn/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,13 @@ func IsCanceled(err error) bool {

return false
}

// IsRpcErr returns true if the given error is a gRPC error with the given
// candidate error as the cause.
func IsRpcErr(err error, candidate error) bool {
if err == nil {
return false
}

return strings.Contains(err.Error(), candidate.Error())
}
60 changes: 27 additions & 33 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ module github.com/lightninglabs/taproot-assets
go 1.21

require (
github.com/btcsuite/btcd v0.23.5-0.20230905170901-80f5a0ffdf36
github.com/btcsuite/btcd v0.24.1-0.20240309015614-f0ec9fbccec8
github.com/btcsuite/btcd/btcec/v2 v2.3.2
github.com/btcsuite/btcd/btcutil v1.1.4-0.20230904040416-d4f519f5dc05
github.com/btcsuite/btcd/btcutil v1.1.5
github.com/btcsuite/btcd/btcutil/psbt v1.1.8
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f
github.com/btcsuite/btcwallet v0.16.10-0.20231017144732-e3ff37491e9c
github.com/btcsuite/btcwallet/wallet/txrules v1.2.0
github.com/btcsuite/btcwallet/wallet/txsizes v1.2.3
github.com/btcsuite/btcwallet v0.16.10-0.20240206195028-1f3534b00d14
github.com/btcsuite/btcwallet/wallet/txrules v1.2.1
github.com/btcsuite/btcwallet/wallet/txsizes v1.2.4
github.com/btcsuite/btcwallet/wtxmgr v1.5.1
github.com/caddyserver/certmagic v0.17.2
github.com/davecgh/go-spew v1.1.1
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1
Expand All @@ -26,22 +27,22 @@ require (
github.com/lib/pq v1.10.7
github.com/lightninglabs/aperture v0.1.21-beta.0.20230705004936-87bb996a4030
github.com/lightninglabs/lightning-node-connect/hashmailrpc v1.0.2
github.com/lightninglabs/lndclient v0.17.0-4
github.com/lightninglabs/neutrino/cache v1.1.1
github.com/lightningnetwork/lnd v0.17.1-beta
github.com/lightninglabs/lndclient v1.0.1-0.20240301093332-e39221e5a641
github.com/lightninglabs/neutrino/cache v1.1.2
github.com/lightningnetwork/lnd v0.17.0-beta.rc6.0.20240301195848-f61761277f14
github.com/lightningnetwork/lnd/cert v1.2.2
github.com/lightningnetwork/lnd/clock v1.1.1
github.com/lightningnetwork/lnd/ticker v1.1.1
github.com/lightningnetwork/lnd/tlv v1.1.1
github.com/lightningnetwork/lnd/tlv v1.2.3
github.com/lightningnetwork/lnd/tor v1.1.2
github.com/ory/dockertest/v3 v3.10.0
github.com/prometheus/client_golang v1.14.0
github.com/stretchr/testify v1.8.4
github.com/urfave/cli v1.22.9
golang.org/x/exp v0.0.0-20230315142452-642cacee5cc0
golang.org/x/net v0.17.0
golang.org/x/sync v0.3.0
golang.org/x/term v0.13.0
golang.org/x/exp v0.0.0-20231226003508-02704c960a9b
golang.org/x/net v0.19.0
golang.org/x/sync v0.5.0
golang.org/x/term v0.15.0
golang.org/x/time v0.0.0-20220224211638-0e9765cccd65
google.golang.org/grpc v1.59.0
google.golang.org/protobuf v1.31.0
Expand All @@ -59,11 +60,9 @@ require (
github.com/Yawning/aez v0.0.0-20211027044916-e49e68abd344 // indirect
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect
github.com/aead/siphash v1.0.1 // indirect
github.com/andybalholm/brotli v1.0.3 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/btcsuite/btcwallet/wallet/txauthor v1.3.2 // indirect
github.com/btcsuite/btcwallet/walletdb v1.4.0 // indirect
github.com/btcsuite/btcwallet/wtxmgr v1.5.0 // indirect
github.com/btcsuite/btcwallet/wallet/txauthor v1.3.4 // indirect
github.com/btcsuite/btcwallet/walletdb v1.4.1 // indirect
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd // indirect
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 // indirect
github.com/btcsuite/winsvc v1.0.0 // indirect
Expand All @@ -77,12 +76,11 @@ require (
github.com/decred/dcrd/crypto/blake256 v1.0.0 // indirect
github.com/decred/dcrd/lru v1.0.0 // indirect
github.com/docker/cli v20.10.17+incompatible // indirect
github.com/docker/docker v20.10.24+incompatible // indirect
github.com/docker/docker v24.0.7+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/dsnet/compress v0.0.1 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/fergusstrange/embedded-postgres v1.10.0 // indirect
github.com/fergusstrange/embedded-postgres v1.25.0 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
Expand All @@ -92,7 +90,7 @@ require (
github.com/google/btree v1.0.1 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.0-rc.3 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
Expand All @@ -117,31 +115,28 @@ require (
github.com/kkdai/bstream v1.0.0 // indirect
github.com/klauspost/compress v1.13.6 // indirect
github.com/klauspost/cpuid/v2 v2.2.3 // indirect
github.com/klauspost/pgzip v1.2.5 // indirect
github.com/libdns/libdns v0.2.1 // indirect
github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf // indirect
github.com/lightninglabs/lightning-node-connect v0.2.5-alpha // indirect
github.com/lightninglabs/neutrino v0.16.0 // indirect
github.com/lightningnetwork/lightning-onion v1.2.1-0.20230823005744-06182b1d7d2f // indirect
github.com/lightningnetwork/lnd/fn v1.0.4 // indirect
github.com/lightningnetwork/lnd/healthcheck v1.2.3 // indirect
github.com/lightningnetwork/lnd/kvdb v1.4.4 // indirect
github.com/lightningnetwork/lnd/kvdb v1.4.5 // indirect
github.com/lightningnetwork/lnd/queue v1.1.1 // indirect
github.com/ltcsuite/ltcd v0.0.0-20190101042124-f37f8bf35796 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mholt/acmez v1.0.4 // indirect
github.com/mholt/archiver/v3 v3.5.0 // indirect
github.com/miekg/dns v1.1.50 // indirect
github.com/mitchellh/mapstructure v1.4.1 // indirect
github.com/moby/term v0.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mwitkow/grpc-proxy v0.0.0-20230212185441-f345521cb9c9 // indirect
github.com/nwaples/rardecode v1.1.2 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.2 // indirect
github.com/opencontainers/runc v1.1.5 // indirect
github.com/pierrec/lz4/v4 v4.1.8 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
Expand All @@ -158,7 +153,6 @@ require (
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 // indirect
github.com/tv42/zbase32 v0.0.0-20160707012821-501572607d02 // indirect
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
Expand All @@ -185,11 +179,11 @@ require (
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.23.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/mod v0.10.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/tools v0.9.1 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.16.0 // indirect
google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
Expand Down
Loading
Loading