Skip to content

Commit

Permalink
Merge pull request #7196 from guggero/v0-15-5-branch-rc2
Browse files Browse the repository at this point in the history
release: create v0.15.5-rc2 release branch
  • Loading branch information
guggero authored Nov 22, 2022
2 parents 1d3e51e + cc07f66 commit 771bc99
Show file tree
Hide file tree
Showing 13 changed files with 504 additions and 454 deletions.
2 changes: 1 addition & 1 deletion build/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const (

// AppPreRelease MUST only contain characters from semanticAlphabet
// per the semantic versioning spec.
AppPreRelease = "beta.rc1"
AppPreRelease = "beta.rc2"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion config_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ func waitForWalletPassword(cfg *Config,
"signer config disabled")
}

birthday = initMsg.ExtendedKeyBirthday
birthday = initMsg.WatchOnlyBirthday
newWallet, err = loader.CreateNewWatchingOnlyWallet(
password, birthday,
)
Expand Down
17 changes: 14 additions & 3 deletions docs/release-notes/release-notes-0.15.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,22 @@
* [A Taproot related key tweak issue was fixed in `btcd` that affected remote
signing setups](https://github.com/lightningnetwork/lnd/pull/7130).

* [Sleep for one second when funding locked message is not
received](https://github.com/lightningnetwork/lnd/pull/7095) to avoid CPU
spike.
* [Taproot changes addresses are now used by default for the `SendCoins`
RPC](https://github.com/lightningnetwork/lnd/pull/7193).

* [A 1 second interval has been added between `FundingLocked` receipt
checks](https://github.com/lightningnetwork/lnd/pull/7095). This reduces idle
CPU usage for pending/dangling funding attempts.

* [The wallet birthday is now used properly when creating a watch-only wallet
to avoid scanning the whole
chain](https://github.com/lightningnetwork/lnd/pull/7056).

* Taproot outputs are now correctly shown as `SCRIPT_TYPE_WITNESS_V1_TAPROOT` in
the output of `GetTransactions` (`lncli listchaintxns`).

# Contributors (Alphabetical Order)

* Olaoluwa Osuntokun
* Oliver Gugger
* Yong Yu
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ require (
github.com/Yawning/aez v0.0.0-20211027044916-e49e68abd344
github.com/btcsuite/btcd v0.23.4
github.com/btcsuite/btcd/btcec/v2 v2.2.2
github.com/btcsuite/btcd/btcutil v1.1.2
github.com/btcsuite/btcd/btcutil v1.1.3
github.com/btcsuite/btcd/btcutil/psbt v1.1.5
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f
github.com/btcsuite/btcwallet v0.16.2-0.20221109224534-84bf4e34c816
github.com/btcsuite/btcwallet v0.16.5
github.com/btcsuite/btcwallet/wallet/txauthor v1.3.2
github.com/btcsuite/btcwallet/wallet/txrules v1.2.0
github.com/btcsuite/btcwallet/walletdb v1.4.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ github.com/btcsuite/btcd/btcec/v2 v2.2.2/go.mod h1:9/CSmJxmuvqzX9Wh2fXMWToLOHhPd
github.com/btcsuite/btcd/btcutil v1.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9UrLwaeswfjfdF0A=
github.com/btcsuite/btcd/btcutil v1.1.0/go.mod h1:5OapHB7A2hBBWLm48mmw4MOHNJCcUBTwmWH/0Jn8VHE=
github.com/btcsuite/btcd/btcutil v1.1.1/go.mod h1:nbKlBMNm9FGsdvKvu0essceubPiAcI57pYBNnsLAa34=
github.com/btcsuite/btcd/btcutil v1.1.2 h1:XLMbX8JQEiwMcYft2EGi8zPUkoa0abKIU6/BJSRsjzQ=
github.com/btcsuite/btcd/btcutil v1.1.2/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0=
github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ=
github.com/btcsuite/btcd/btcutil v1.1.3/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0=
github.com/btcsuite/btcd/btcutil/psbt v1.1.4/go.mod h1:9AyU6EQVJ9Iw9zPyNT1lcdHd6cnEZdno5wLu5FY74os=
github.com/btcsuite/btcd/btcutil/psbt v1.1.5 h1:x0ZRrYY8j75ThV6xBz86CkYAG82F5bzay4H5D1c8b/U=
github.com/btcsuite/btcd/btcutil/psbt v1.1.5/go.mod h1:kA6FLH/JfUx++j9pYU0pyu+Z8XGBQuuTmuKYUf6q7/U=
Expand All @@ -98,8 +98,8 @@ github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/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.2-0.20221109224534-84bf4e34c816 h1:t4wbkXekvTc1eOGDv2h8l6mkLPnqP93hnRHvNtgpiHQ=
github.com/btcsuite/btcwallet v0.16.2-0.20221109224534-84bf4e34c816/go.mod h1:d8AETQyIIWTtC9CnoCMBmDARp9P65oX4IoBdEP3fDK4=
github.com/btcsuite/btcwallet v0.16.5 h1:4DTJ5aYAJomcR0jAb6JP8D0wNSxfz4H7WN/RBtNZY4o=
github.com/btcsuite/btcwallet v0.16.5/go.mod h1:mM19pFB3lGVxOL+kvHhHZAhdSWXKsZGiHvpJVvxL0D8=
github.com/btcsuite/btcwallet/wallet/txauthor v1.2.3/go.mod h1:T2xSiKGpUkSLCh68aF+FMXmKK9mFqNdHl9VaqOr+JjU=
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=
Expand Down
829 changes: 417 additions & 412 deletions lnrpc/lightning.pb.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions lnrpc/lightning.proto
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,7 @@ enum OutputScriptType {
SCRIPT_TYPE_NULLDATA = 6;
SCRIPT_TYPE_NON_STANDARD = 7;
SCRIPT_TYPE_WITNESS_UNKNOWN = 8;
SCRIPT_TYPE_WITNESS_V1_TAPROOT = 9;
}

message OutputDetail {
Expand Down
3 changes: 2 additions & 1 deletion lnrpc/lightning.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -5746,7 +5746,8 @@
"SCRIPT_TYPE_MULTISIG",
"SCRIPT_TYPE_NULLDATA",
"SCRIPT_TYPE_NON_STANDARD",
"SCRIPT_TYPE_WITNESS_UNKNOWN"
"SCRIPT_TYPE_WITNESS_UNKNOWN",
"SCRIPT_TYPE_WITNESS_V1_TAPROOT"
],
"default": "SCRIPT_TYPE_PUBKEY_HASH"
},
Expand Down
25 changes: 13 additions & 12 deletions lnrpc/marshall_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,28 +147,29 @@ func MarshalUtxos(utxos []*lnwallet.Utxo, activeNetParams *chaincfg.Params) (

// MarshallOutputType translates a txscript.ScriptClass into a
// lnrpc.OutputScriptType.
func MarshallOutputType(o txscript.ScriptClass) (ret OutputScriptType) {
func MarshallOutputType(o txscript.ScriptClass) OutputScriptType {
// Translate txscript ScriptClass type to the proper gRPC proto
// output script type.
switch o {
case txscript.PubKeyHashTy:
ret = OutputScriptType_SCRIPT_TYPE_PUBKEY_HASH
return OutputScriptType_SCRIPT_TYPE_PUBKEY_HASH
case txscript.ScriptHashTy:
ret = OutputScriptType_SCRIPT_TYPE_SCRIPT_HASH
return OutputScriptType_SCRIPT_TYPE_SCRIPT_HASH
case txscript.WitnessV0PubKeyHashTy:
ret = OutputScriptType_SCRIPT_TYPE_WITNESS_V0_PUBKEY_HASH
return OutputScriptType_SCRIPT_TYPE_WITNESS_V0_PUBKEY_HASH
case txscript.WitnessV0ScriptHashTy:
ret = OutputScriptType_SCRIPT_TYPE_WITNESS_V0_SCRIPT_HASH
return OutputScriptType_SCRIPT_TYPE_WITNESS_V0_SCRIPT_HASH
case txscript.PubKeyTy:
ret = OutputScriptType_SCRIPT_TYPE_PUBKEY
return OutputScriptType_SCRIPT_TYPE_PUBKEY
case txscript.MultiSigTy:
ret = OutputScriptType_SCRIPT_TYPE_MULTISIG
return OutputScriptType_SCRIPT_TYPE_MULTISIG
case txscript.NullDataTy:
ret = OutputScriptType_SCRIPT_TYPE_NULLDATA
return OutputScriptType_SCRIPT_TYPE_NULLDATA
case txscript.NonStandardTy:
ret = OutputScriptType_SCRIPT_TYPE_NON_STANDARD
case txscript.WitnessUnknownTy:
ret = OutputScriptType_SCRIPT_TYPE_WITNESS_UNKNOWN
return OutputScriptType_SCRIPT_TYPE_NON_STANDARD
case txscript.WitnessV1TaprootTy:
return OutputScriptType_SCRIPT_TYPE_WITNESS_V1_TAPROOT
default:
return OutputScriptType_SCRIPT_TYPE_WITNESS_UNKNOWN
}
return
}
3 changes: 2 additions & 1 deletion lnrpc/walletrpc/walletkit.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,8 @@
"SCRIPT_TYPE_MULTISIG",
"SCRIPT_TYPE_NULLDATA",
"SCRIPT_TYPE_NON_STANDARD",
"SCRIPT_TYPE_WITNESS_UNKNOWN"
"SCRIPT_TYPE_WITNESS_UNKNOWN",
"SCRIPT_TYPE_WITNESS_V1_TAPROOT"
],
"default": "SCRIPT_TYPE_PUBKEY_HASH"
},
Expand Down
4 changes: 2 additions & 2 deletions lntest/itest/lnd_recovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,10 @@ func testOnchainFundRecovery(net *lntest.NetworkHarness, t *harnessTest) {
restoreCheckBalance(finalBalance, 9, 20, promptChangeAddr)

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

// Last of all, make sure we can also restore a node from the extended
Expand Down
40 changes: 28 additions & 12 deletions lntest/itest/lnd_wallet_import_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,14 @@ func psbtSendFromImportedAccount(t *harnessTest, srcNode, destNode,
)
switch accountAddrType {
case walletrpc.AddressType_WITNESS_PUBKEY_HASH:
expTxFee = 141
expChangeScriptType = txscript.WitnessV0PubKeyHashTy
if account != defaultImportedAccount {
expTxFee = 141
expChangeScriptType = txscript.WitnessV0PubKeyHashTy
break
}

expTxFee = 153
expChangeScriptType = txscript.WitnessV1TaprootTy

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

// Spends from the default NP2WKH imported account have the same
// fee rate as the hybrid address type since a NP2WKH input is
// spent and a P2WKH change output is created.
fallthrough
expTxFee = 176
expChangeScriptType = txscript.WitnessV1TaprootTy

case walletrpc.AddressType_HYBRID_NESTED_WITNESS_PUBKEY_HASH:
expTxFee = 164
expChangeScriptType = txscript.WitnessV0PubKeyHashTy

case walletrpc.AddressType_TAPROOT_PUBKEY:
expTxFee = 143
expChangeScriptType = txscript.WitnessV1TaprootTy

default:
t.Fatalf("unsupported addr type %v", accountAddrType)
}
Expand Down Expand Up @@ -418,8 +426,14 @@ func fundChanAndCloseFromImportedAccount(t *harnessTest, srcNode, destNode,
)
switch accountAddrType {
case walletrpc.AddressType_WITNESS_PUBKEY_HASH:
expChanTxFee = 153
expChangeScriptType = txscript.WitnessV0PubKeyHashTy
if account != defaultImportedAccount {
expChanTxFee = 153
expChangeScriptType = txscript.WitnessV0PubKeyHashTy
break
}

expChanTxFee = 165
expChangeScriptType = txscript.WitnessV1TaprootTy

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

// Spends from the default NP2WKH imported account have the same
// fee rate as the hybrid address type since a NP2WKH input is
// spent and a P2WKH change output is created.
fallthrough
expChanTxFee = 188
expChangeScriptType = txscript.WitnessV1TaprootTy

case walletrpc.AddressType_HYBRID_NESTED_WITNESS_PUBKEY_HASH:
expChanTxFee = 176
expChangeScriptType = txscript.WitnessV0PubKeyHashTy

case walletrpc.AddressType_TAPROOT_PUBKEY:
expChanTxFee = 155
expChangeScriptType = txscript.WitnessV1TaprootTy

default:
t.Fatalf("unsupported addr type %v", accountAddrType)
}
Expand Down
20 changes: 17 additions & 3 deletions lnwallet/test/test_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,8 @@ func testGetRecoveryInfo(miner *rpctest.Harness,
func testDualFundingReservationWorkflow(miner *rpctest.Harness,
alice, bob *lnwallet.LightningWallet, t *testing.T) {

t.Skipf("dual funding isn't exposed on the p2p layer")

fundingAmount, err := btcutil.NewAmount(5)
require.NoError(t, err, "unable to create amt")

Expand Down Expand Up @@ -2196,9 +2198,9 @@ func testChangeOutputSpendConfirmation(r *rpctest.Harness,
// TODO(wilmer): replace this once SendOutputs easily supports sending
// all funds in one transaction.
txFeeRate := chainfee.SatPerKWeight(2500)
txFee := btcutil.Amount(14380)
const txFee = int64(14500)
output := &wire.TxOut{
Value: int64(aliceBalance - txFee),
Value: int64(aliceBalance) - txFee,
PkScript: bobPkScript,
}
tx := sendCoins(t, r, alice, bob, output, txFeeRate, true, 1)
Expand Down Expand Up @@ -2564,7 +2566,9 @@ func testCreateSimpleTx(r *rpctest.Harness, w *lnwallet.LightningWallet,
// _very_ similar to the one we just created being sent. The
// only difference is that the dry run tx is not signed, and
// that the change output position might be different.
tx, sendErr := w.SendOutputs(outputs, feeRate, minConfs, labels.External)
tx, sendErr := w.SendOutputs(
outputs, feeRate, minConfs, labels.External,
)
switch {
case test.valid && sendErr != nil:
t.Fatalf("got unexpected error when sending tx: %v",
Expand Down Expand Up @@ -2649,6 +2653,16 @@ func testCreateSimpleTx(r *rpctest.Harness, w *lnwallet.LightningWallet,
if err := assertSimilarTx(createTx.Tx, tx); err != nil {
t.Fatalf("transactions not similar: %v", err)
}

// Now that we know both transactions were essentially
// identical, we'll make sure that a P2TR addr was used as the
// change output, which is the current default.
changeTxOut := createTx.Tx.TxOut[createTx.ChangeIndex]
changeScriptType, _, _, err := txscript.ExtractPkScriptAddrs(
changeTxOut.PkScript, &w.Cfg.NetParams,
)
require.NoError(t, err)
require.Equal(t, changeScriptType, txscript.WitnessV1TaprootTy)
}
}

Expand Down

0 comments on commit 771bc99

Please sign in to comment.