Skip to content

Commit 771bc99

Browse files
authored
Merge pull request #7196 from guggero/v0-15-5-branch-rc2
release: create v0.15.5-rc2 release branch
2 parents 1d3e51e + cc07f66 commit 771bc99

13 files changed

+504
-454
lines changed

build/version.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const (
4848

4949
// AppPreRelease MUST only contain characters from semanticAlphabet
5050
// per the semantic versioning spec.
51-
AppPreRelease = "beta.rc1"
51+
AppPreRelease = "beta.rc2"
5252
)
5353

5454
func init() {

config_builder.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,7 @@ func waitForWalletPassword(cfg *Config,
10181018
"signer config disabled")
10191019
}
10201020

1021-
birthday = initMsg.ExtendedKeyBirthday
1021+
birthday = initMsg.WatchOnlyBirthday
10221022
newWallet, err = loader.CreateNewWatchingOnlyWallet(
10231023
password, birthday,
10241024
)

docs/release-notes/release-notes-0.15.5.md

+14-3
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,22 @@
55
* [A Taproot related key tweak issue was fixed in `btcd` that affected remote
66
signing setups](https://github.com/lightningnetwork/lnd/pull/7130).
77

8-
* [Sleep for one second when funding locked message is not
9-
received](https://github.com/lightningnetwork/lnd/pull/7095) to avoid CPU
10-
spike.
8+
* [Taproot changes addresses are now used by default for the `SendCoins`
9+
RPC](https://github.com/lightningnetwork/lnd/pull/7193).
10+
11+
* [A 1 second interval has been added between `FundingLocked` receipt
12+
checks](https://github.com/lightningnetwork/lnd/pull/7095). This reduces idle
13+
CPU usage for pending/dangling funding attempts.
14+
15+
* [The wallet birthday is now used properly when creating a watch-only wallet
16+
to avoid scanning the whole
17+
chain](https://github.com/lightningnetwork/lnd/pull/7056).
18+
19+
* Taproot outputs are now correctly shown as `SCRIPT_TYPE_WITNESS_V1_TAPROOT` in
20+
the output of `GetTransactions` (`lncli listchaintxns`).
1121

1222
# Contributors (Alphabetical Order)
1323

24+
* Olaoluwa Osuntokun
1425
* Oliver Gugger
1526
* Yong Yu

go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ require (
55
github.com/Yawning/aez v0.0.0-20211027044916-e49e68abd344
66
github.com/btcsuite/btcd v0.23.4
77
github.com/btcsuite/btcd/btcec/v2 v2.2.2
8-
github.com/btcsuite/btcd/btcutil v1.1.2
8+
github.com/btcsuite/btcd/btcutil v1.1.3
99
github.com/btcsuite/btcd/btcutil/psbt v1.1.5
1010
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1
1111
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f
12-
github.com/btcsuite/btcwallet v0.16.2-0.20221109224534-84bf4e34c816
12+
github.com/btcsuite/btcwallet v0.16.5
1313
github.com/btcsuite/btcwallet/wallet/txauthor v1.3.2
1414
github.com/btcsuite/btcwallet/wallet/txrules v1.2.0
1515
github.com/btcsuite/btcwallet/walletdb v1.4.0

go.sum

+4-4
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ github.com/btcsuite/btcd/btcec/v2 v2.2.2/go.mod h1:9/CSmJxmuvqzX9Wh2fXMWToLOHhPd
8787
github.com/btcsuite/btcd/btcutil v1.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9UrLwaeswfjfdF0A=
8888
github.com/btcsuite/btcd/btcutil v1.1.0/go.mod h1:5OapHB7A2hBBWLm48mmw4MOHNJCcUBTwmWH/0Jn8VHE=
8989
github.com/btcsuite/btcd/btcutil v1.1.1/go.mod h1:nbKlBMNm9FGsdvKvu0essceubPiAcI57pYBNnsLAa34=
90-
github.com/btcsuite/btcd/btcutil v1.1.2 h1:XLMbX8JQEiwMcYft2EGi8zPUkoa0abKIU6/BJSRsjzQ=
91-
github.com/btcsuite/btcd/btcutil v1.1.2/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0=
90+
github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ=
91+
github.com/btcsuite/btcd/btcutil v1.1.3/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0=
9292
github.com/btcsuite/btcd/btcutil/psbt v1.1.4/go.mod h1:9AyU6EQVJ9Iw9zPyNT1lcdHd6cnEZdno5wLu5FY74os=
9393
github.com/btcsuite/btcd/btcutil/psbt v1.1.5 h1:x0ZRrYY8j75ThV6xBz86CkYAG82F5bzay4H5D1c8b/U=
9494
github.com/btcsuite/btcd/btcutil/psbt v1.1.5/go.mod h1:kA6FLH/JfUx++j9pYU0pyu+Z8XGBQuuTmuKYUf6q7/U=
@@ -98,8 +98,8 @@ github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtyd
9898
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo=
9999
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA=
100100
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg=
101-
github.com/btcsuite/btcwallet v0.16.2-0.20221109224534-84bf4e34c816 h1:t4wbkXekvTc1eOGDv2h8l6mkLPnqP93hnRHvNtgpiHQ=
102-
github.com/btcsuite/btcwallet v0.16.2-0.20221109224534-84bf4e34c816/go.mod h1:d8AETQyIIWTtC9CnoCMBmDARp9P65oX4IoBdEP3fDK4=
101+
github.com/btcsuite/btcwallet v0.16.5 h1:4DTJ5aYAJomcR0jAb6JP8D0wNSxfz4H7WN/RBtNZY4o=
102+
github.com/btcsuite/btcwallet v0.16.5/go.mod h1:mM19pFB3lGVxOL+kvHhHZAhdSWXKsZGiHvpJVvxL0D8=
103103
github.com/btcsuite/btcwallet/wallet/txauthor v1.2.3/go.mod h1:T2xSiKGpUkSLCh68aF+FMXmKK9mFqNdHl9VaqOr+JjU=
104104
github.com/btcsuite/btcwallet/wallet/txauthor v1.3.2 h1:etuLgGEojecsDOYTII8rYiGHjGyV5xTqsXi+ZQ715UU=
105105
github.com/btcsuite/btcwallet/wallet/txauthor v1.3.2/go.mod h1:Zpk/LOb2sKqwP2lmHjaZT9AdaKsHPSbNLm2Uql5IQ/0=

lnrpc/lightning.pb.go

+417-412
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lnrpc/lightning.proto

+1
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,7 @@ enum OutputScriptType {
637637
SCRIPT_TYPE_NULLDATA = 6;
638638
SCRIPT_TYPE_NON_STANDARD = 7;
639639
SCRIPT_TYPE_WITNESS_UNKNOWN = 8;
640+
SCRIPT_TYPE_WITNESS_V1_TAPROOT = 9;
640641
}
641642

642643
message OutputDetail {

lnrpc/lightning.swagger.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -5746,7 +5746,8 @@
57465746
"SCRIPT_TYPE_MULTISIG",
57475747
"SCRIPT_TYPE_NULLDATA",
57485748
"SCRIPT_TYPE_NON_STANDARD",
5749-
"SCRIPT_TYPE_WITNESS_UNKNOWN"
5749+
"SCRIPT_TYPE_WITNESS_UNKNOWN",
5750+
"SCRIPT_TYPE_WITNESS_V1_TAPROOT"
57505751
],
57515752
"default": "SCRIPT_TYPE_PUBKEY_HASH"
57525753
},

lnrpc/marshall_utils.go

+13-12
Original file line numberDiff line numberDiff line change
@@ -147,28 +147,29 @@ func MarshalUtxos(utxos []*lnwallet.Utxo, activeNetParams *chaincfg.Params) (
147147

148148
// MarshallOutputType translates a txscript.ScriptClass into a
149149
// lnrpc.OutputScriptType.
150-
func MarshallOutputType(o txscript.ScriptClass) (ret OutputScriptType) {
150+
func MarshallOutputType(o txscript.ScriptClass) OutputScriptType {
151151
// Translate txscript ScriptClass type to the proper gRPC proto
152152
// output script type.
153153
switch o {
154154
case txscript.PubKeyHashTy:
155-
ret = OutputScriptType_SCRIPT_TYPE_PUBKEY_HASH
155+
return OutputScriptType_SCRIPT_TYPE_PUBKEY_HASH
156156
case txscript.ScriptHashTy:
157-
ret = OutputScriptType_SCRIPT_TYPE_SCRIPT_HASH
157+
return OutputScriptType_SCRIPT_TYPE_SCRIPT_HASH
158158
case txscript.WitnessV0PubKeyHashTy:
159-
ret = OutputScriptType_SCRIPT_TYPE_WITNESS_V0_PUBKEY_HASH
159+
return OutputScriptType_SCRIPT_TYPE_WITNESS_V0_PUBKEY_HASH
160160
case txscript.WitnessV0ScriptHashTy:
161-
ret = OutputScriptType_SCRIPT_TYPE_WITNESS_V0_SCRIPT_HASH
161+
return OutputScriptType_SCRIPT_TYPE_WITNESS_V0_SCRIPT_HASH
162162
case txscript.PubKeyTy:
163-
ret = OutputScriptType_SCRIPT_TYPE_PUBKEY
163+
return OutputScriptType_SCRIPT_TYPE_PUBKEY
164164
case txscript.MultiSigTy:
165-
ret = OutputScriptType_SCRIPT_TYPE_MULTISIG
165+
return OutputScriptType_SCRIPT_TYPE_MULTISIG
166166
case txscript.NullDataTy:
167-
ret = OutputScriptType_SCRIPT_TYPE_NULLDATA
167+
return OutputScriptType_SCRIPT_TYPE_NULLDATA
168168
case txscript.NonStandardTy:
169-
ret = OutputScriptType_SCRIPT_TYPE_NON_STANDARD
170-
case txscript.WitnessUnknownTy:
171-
ret = OutputScriptType_SCRIPT_TYPE_WITNESS_UNKNOWN
169+
return OutputScriptType_SCRIPT_TYPE_NON_STANDARD
170+
case txscript.WitnessV1TaprootTy:
171+
return OutputScriptType_SCRIPT_TYPE_WITNESS_V1_TAPROOT
172+
default:
173+
return OutputScriptType_SCRIPT_TYPE_WITNESS_UNKNOWN
172174
}
173-
return
174175
}

lnrpc/walletrpc/walletkit.swagger.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,8 @@
798798
"SCRIPT_TYPE_MULTISIG",
799799
"SCRIPT_TYPE_NULLDATA",
800800
"SCRIPT_TYPE_NON_STANDARD",
801-
"SCRIPT_TYPE_WITNESS_UNKNOWN"
801+
"SCRIPT_TYPE_WITNESS_UNKNOWN",
802+
"SCRIPT_TYPE_WITNESS_V1_TAPROOT"
802803
],
803804
"default": "SCRIPT_TYPE_PUBKEY_HASH"
804805
},

lntest/itest/lnd_recovery_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,10 @@ func testOnchainFundRecovery(net *lntest.NetworkHarness, t *harnessTest) {
339339
restoreCheckBalance(finalBalance, 9, 20, promptChangeAddr)
340340

341341
// We should expect a static fee of 36400 satoshis for spending 9
342-
// inputs (3 P2WPKH, 3 NP2WPKH, 3 P2TR) to two P2WPKH outputs. Carol
342+
// inputs (3 P2WPKH, 3 NP2WPKH, 3 P2TR) to two P2TR outputs. Carol
343343
// should therefore only have one UTXO present (the change output) of
344344
// 9 - 8 - fee BTC.
345-
const fee = 36400
345+
const fee = 37000
346346
restoreCheckBalance(finalBalance-minerAmt-fee, 1, 21, nil)
347347

348348
// Last of all, make sure we can also restore a node from the extended

lntest/itest/lnd_wallet_import_test.go

+28-12
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,14 @@ func psbtSendFromImportedAccount(t *harnessTest, srcNode, destNode,
265265
)
266266
switch accountAddrType {
267267
case walletrpc.AddressType_WITNESS_PUBKEY_HASH:
268-
expTxFee = 141
269-
expChangeScriptType = txscript.WitnessV0PubKeyHashTy
268+
if account != defaultImportedAccount {
269+
expTxFee = 141
270+
expChangeScriptType = txscript.WitnessV0PubKeyHashTy
271+
break
272+
}
273+
274+
expTxFee = 153
275+
expChangeScriptType = txscript.WitnessV1TaprootTy
270276

271277
case walletrpc.AddressType_NESTED_WITNESS_PUBKEY_HASH:
272278
if account != defaultImportedAccount {
@@ -275,15 +281,17 @@ func psbtSendFromImportedAccount(t *harnessTest, srcNode, destNode,
275281
break
276282
}
277283

278-
// Spends from the default NP2WKH imported account have the same
279-
// fee rate as the hybrid address type since a NP2WKH input is
280-
// spent and a P2WKH change output is created.
281-
fallthrough
284+
expTxFee = 176
285+
expChangeScriptType = txscript.WitnessV1TaprootTy
282286

283287
case walletrpc.AddressType_HYBRID_NESTED_WITNESS_PUBKEY_HASH:
284288
expTxFee = 164
285289
expChangeScriptType = txscript.WitnessV0PubKeyHashTy
286290

291+
case walletrpc.AddressType_TAPROOT_PUBKEY:
292+
expTxFee = 143
293+
expChangeScriptType = txscript.WitnessV1TaprootTy
294+
287295
default:
288296
t.Fatalf("unsupported addr type %v", accountAddrType)
289297
}
@@ -418,8 +426,14 @@ func fundChanAndCloseFromImportedAccount(t *harnessTest, srcNode, destNode,
418426
)
419427
switch accountAddrType {
420428
case walletrpc.AddressType_WITNESS_PUBKEY_HASH:
421-
expChanTxFee = 153
422-
expChangeScriptType = txscript.WitnessV0PubKeyHashTy
429+
if account != defaultImportedAccount {
430+
expChanTxFee = 153
431+
expChangeScriptType = txscript.WitnessV0PubKeyHashTy
432+
break
433+
}
434+
435+
expChanTxFee = 165
436+
expChangeScriptType = txscript.WitnessV1TaprootTy
423437

424438
case walletrpc.AddressType_NESTED_WITNESS_PUBKEY_HASH:
425439
if account != defaultImportedAccount {
@@ -428,15 +442,17 @@ func fundChanAndCloseFromImportedAccount(t *harnessTest, srcNode, destNode,
428442
break
429443
}
430444

431-
// Spends from the default NP2WKH imported account have the same
432-
// fee rate as the hybrid address type since a NP2WKH input is
433-
// spent and a P2WKH change output is created.
434-
fallthrough
445+
expChanTxFee = 188
446+
expChangeScriptType = txscript.WitnessV1TaprootTy
435447

436448
case walletrpc.AddressType_HYBRID_NESTED_WITNESS_PUBKEY_HASH:
437449
expChanTxFee = 176
438450
expChangeScriptType = txscript.WitnessV0PubKeyHashTy
439451

452+
case walletrpc.AddressType_TAPROOT_PUBKEY:
453+
expChanTxFee = 155
454+
expChangeScriptType = txscript.WitnessV1TaprootTy
455+
440456
default:
441457
t.Fatalf("unsupported addr type %v", accountAddrType)
442458
}

lnwallet/test/test_interface.go

+17-3
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,8 @@ func testGetRecoveryInfo(miner *rpctest.Harness,
432432
func testDualFundingReservationWorkflow(miner *rpctest.Harness,
433433
alice, bob *lnwallet.LightningWallet, t *testing.T) {
434434

435+
t.Skipf("dual funding isn't exposed on the p2p layer")
436+
435437
fundingAmount, err := btcutil.NewAmount(5)
436438
require.NoError(t, err, "unable to create amt")
437439

@@ -2196,9 +2198,9 @@ func testChangeOutputSpendConfirmation(r *rpctest.Harness,
21962198
// TODO(wilmer): replace this once SendOutputs easily supports sending
21972199
// all funds in one transaction.
21982200
txFeeRate := chainfee.SatPerKWeight(2500)
2199-
txFee := btcutil.Amount(14380)
2201+
const txFee = int64(14500)
22002202
output := &wire.TxOut{
2201-
Value: int64(aliceBalance - txFee),
2203+
Value: int64(aliceBalance) - txFee,
22022204
PkScript: bobPkScript,
22032205
}
22042206
tx := sendCoins(t, r, alice, bob, output, txFeeRate, true, 1)
@@ -2564,7 +2566,9 @@ func testCreateSimpleTx(r *rpctest.Harness, w *lnwallet.LightningWallet,
25642566
// _very_ similar to the one we just created being sent. The
25652567
// only difference is that the dry run tx is not signed, and
25662568
// that the change output position might be different.
2567-
tx, sendErr := w.SendOutputs(outputs, feeRate, minConfs, labels.External)
2569+
tx, sendErr := w.SendOutputs(
2570+
outputs, feeRate, minConfs, labels.External,
2571+
)
25682572
switch {
25692573
case test.valid && sendErr != nil:
25702574
t.Fatalf("got unexpected error when sending tx: %v",
@@ -2649,6 +2653,16 @@ func testCreateSimpleTx(r *rpctest.Harness, w *lnwallet.LightningWallet,
26492653
if err := assertSimilarTx(createTx.Tx, tx); err != nil {
26502654
t.Fatalf("transactions not similar: %v", err)
26512655
}
2656+
2657+
// Now that we know both transactions were essentially
2658+
// identical, we'll make sure that a P2TR addr was used as the
2659+
// change output, which is the current default.
2660+
changeTxOut := createTx.Tx.TxOut[createTx.ChangeIndex]
2661+
changeScriptType, _, _, err := txscript.ExtractPkScriptAddrs(
2662+
changeTxOut.PkScript, &w.Cfg.NetParams,
2663+
)
2664+
require.NoError(t, err)
2665+
require.Equal(t, changeScriptType, txscript.WitnessV1TaprootTy)
26522666
}
26532667
}
26542668

0 commit comments

Comments
 (0)