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

build: create v0.17.1-rc1 branch #8138

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
6521576
lncli: fix description of connect/disconnect peer
kilrau Oct 3, 2023
3c605db
Merge branch 'v0-17-0-branch-rc1-8053' into v0-17-0-branch-rc1
Roasbeef Oct 31, 2023
75406d1
htlcswitch/hop: use InvalidOnionVersion for replayed packets
Crypt-iQ Aug 29, 2023
28c260e
release-notes: update for 0.17.1
Crypt-iQ Oct 6, 2023
738e0c6
Merge branch 'v0-17-0-branch-rc1-7937' into v0-17-0-branch-rc1
Roasbeef Oct 31, 2023
7ebc538
sweep: use longer variable name for clarity in `addToState`
yyforyongyu Sep 5, 2023
dde605d
sweeper: add more docs and debug logs
yyforyongyu Sep 5, 2023
c2148ad
sweep: prioritize smaller inputs when adding wallet UTXOs
yyforyongyu Sep 6, 2023
91719b0
contractcourt+itest: relax anchor sweeping for CPFP purpose
yyforyongyu Sep 14, 2023
2cb208e
docs: update release notes
yyforyongyu Sep 14, 2023
0cb9ccd
itest: update test `testMultiHopHtlcLocalChainClaim` to skip CPFP
yyforyongyu Sep 15, 2023
b8464dd
itest: fix `testMultiHopRemoteForceCloseOnChainHtlcTimeout`
yyforyongyu Sep 15, 2023
7be5409
itest: update related tests to reflect anchor sweeping
yyforyongyu Sep 15, 2023
5c4f2c1
Merge branch 'v0-17-0-branch-rc1-7965' into v0-17-0-branch-rc1
Roasbeef Oct 31, 2023
a0448eb
gomod: update btcwallet version
yyforyongyu Sep 20, 2023
58193ef
Merge branch 'v0-17-0-branch-rc1-8019' into v0-17-0-branch-rc1
Roasbeef Oct 31, 2023
42dd0fa
multi: clarify co-op closure failures.
ziggie1984 Oct 12, 2023
6806a13
Merge branch 'v0-17-0-branch-rc1-8090' into v0-17-0-branch-rc1
Roasbeef Oct 31, 2023
52fdf70
gomod: update btcwallet re rescan race fix
yyforyongyu Oct 13, 2023
c0b14c7
Merge branch 'v0-17-0-branch-rc1-8094' into v0-17-0-branch-rc1
Roasbeef Oct 31, 2023
35bfd27
chainrpc: update proto to expose GetBlockHeader
jharveyb Oct 26, 2023
b04927f
multi: add GetBlockHeader to BlockChainIO
jharveyb Oct 26, 2023
6a4dabc
chainrpc+lncli: expose GetBlockHeader + add to CLI
jharveyb Oct 26, 2023
6ea7d92
itest: add GetBlockHeader to ChainKit tests
jharveyb Oct 26, 2023
452af8f
doc: add release notes for 8111
jharveyb Oct 26, 2023
db6acec
Merge branch 'v0-17-1-branch-rc1-8111' into v0-17-1-branch-rc1
Roasbeef Oct 31, 2023
280a97c
multi: skip InitRemoteMusigNonces if we've already called it
Crypt-iQ Oct 13, 2023
b2a5368
itest: assertions to check channel status
hieblmi Oct 10, 2023
9fa2057
itest: simple taproot channel status
hieblmi Oct 10, 2023
6c7bca2
docs/release-notes: add entry for nonce init fix
Roasbeef Oct 25, 2023
948f873
Merge branch 'v0-17-1-branch-rc1-8104' into v0-17-1-branch-rc1
Roasbeef Oct 31, 2023
76862ed
macaroons: reject unknown macaroon versions
Roasbeef Oct 30, 2023
2c2ba34
Merge branch 'v0-17-1-branch-rc1-8132' into v0-17-1-branch-rc1
Roasbeef Oct 31, 2023
c840957
build: bump version to v0.17.1-beta.rc1
Roasbeef Oct 31, 2023
464ddb4
cmd/lncli: fix linter complaint by running make fmt
guggero Oct 5, 2023
155f66b
Merge branch 'v0-17-1-branch-rc1-8063' into v0-17-1-branch-rc1
Roasbeef Nov 1, 2023
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
4 changes: 2 additions & 2 deletions build/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ const (
AppMinor uint = 17

// AppPatch defines the application patch for this binary.
AppPatch uint = 0
AppPatch uint = 1

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

func init() {
Expand Down
40 changes: 40 additions & 0 deletions cmd/lncli/chainrpc_active.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ func chainCommands() []cli.Command {
getBlockCommand,
getBestBlockCommand,
getBlockHashCommand,
getBlockHeaderCommand,
},
},
}
Expand Down Expand Up @@ -113,6 +114,45 @@ func getBlock(ctx *cli.Context) error {
return nil
}

var getBlockHeaderCommand = cli.Command{
Name: "getblockheader",
Usage: "Get a block header.",
Category: "On-chain",
Description: "Returns a block header with a particular block hash.",
ArgsUsage: "hash",
Action: actionDecorator(getBlockHeader),
}

func getBlockHeader(ctx *cli.Context) error {
ctxc := getContext()
args := ctx.Args()

// Display the command's help message if we do not have the expected
// number of arguments/flags.
if !args.Present() {
return cli.ShowCommandHelp(ctx, "getblockheader")
}

blockHash, err := chainhash.NewHashFromStr(args.First())
if err != nil {
return err
}

req := &chainrpc.GetBlockHeaderRequest{BlockHash: blockHash[:]}

client, cleanUp := getChainClient(ctx)
defer cleanUp()

resp, err := client.GetBlockHeader(ctxc, req)
if err != nil {
return err
}

printRespJSON(resp)

return nil
}

var getBestBlockCommand = cli.Command{
Name: "getbestblock",
Category: "On-chain",
Expand Down
9 changes: 5 additions & 4 deletions cmd/lncli/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ func sendMany(ctx *cli.Context) error {
var connectCommand = cli.Command{
Name: "connect",
Category: "Peers",
Usage: "Connect to a remote lnd peer.",
Usage: "Connect to a remote lightning peer.",
ArgsUsage: "<pubkey>@host",
Description: `
Connect to a peer using its <pubkey> and host.
Expand Down Expand Up @@ -680,9 +680,10 @@ func connectPeer(ctx *cli.Context) error {
}

var disconnectCommand = cli.Command{
Name: "disconnect",
Category: "Peers",
Usage: "Disconnect a remote lnd peer identified by public key.",
Name: "disconnect",
Category: "Peers",
Usage: "Disconnect a remote lightning peer identified by " +
"public key.",
ArgsUsage: "<pubkey>",
Flags: []cli.Flag{
cli.StringFlag{
Expand Down
8 changes: 4 additions & 4 deletions cmd/lncli/neutrino_active.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,16 @@ func isBanned(ctx *cli.Context) error {
return nil
}

var getBlockHeaderCommand = cli.Command{
var getBlockHeaderNeutrinoCommand = cli.Command{
Name: "getblockheader",
Usage: "Get a block header.",
Category: "Neutrino",
Description: "Returns a block header with a particular block hash.",
ArgsUsage: "hash",
Action: actionDecorator(getBlockHeader),
Action: actionDecorator(getBlockHeaderNeutrino),
}

func getBlockHeader(ctx *cli.Context) error {
func getBlockHeaderNeutrino(ctx *cli.Context) error {
ctxc := getContext()
args := ctx.Args()

Expand Down Expand Up @@ -239,7 +239,7 @@ func neutrinoCommands() []cli.Command {
addPeerCommand,
disconnectPeerCommand,
isBannedCommand,
getBlockHeaderCommand,
getBlockHeaderNeutrinoCommand,
getCFilterCommand,
},
},
Expand Down
37 changes: 27 additions & 10 deletions contractcourt/channel_arbitrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -1309,9 +1309,23 @@ func (c *ChannelArbitrator) sweepAnchors(anchors *lnwallet.AnchorResolutions,
return err
}

// Create a force flag that's used to indicate whether we
// should force sweeping this anchor.
var force bool

// Check the deadline against the default value. If it's less
// than the default value of 144, it means there is a deadline
// and we will perform a CPFP for this commitment tx.
if deadline < anchorSweepConfTarget {
// Signal that this is a force sweep, so that the
// anchor will be swept even if it isn't economical
// purely based on the anchor value.
force = true
}

log.Debugf("ChannelArbitrator(%v): pre-confirmation sweep of "+
"anchor of %s commit tx %v", c.cfg.ChanPoint,
anchorPath, anchor.CommitAnchor)
"anchor of %s commit tx %v, force=%v", c.cfg.ChanPoint,
anchorPath, anchor.CommitAnchor, force)

witnessType := input.CommitmentAnchor

Expand All @@ -1337,20 +1351,17 @@ func (c *ChannelArbitrator) sweepAnchors(anchors *lnwallet.AnchorResolutions,
)

// Sweep anchor output with a confirmation target fee
// preference. Because this is a cpfp-operation, the anchor will
// only be attempted to sweep when the current fee estimate for
// the confirmation target exceeds the commit fee rate.
//
// Also signal that this is a force sweep, so that the anchor
// will be swept even if it isn't economical purely based on the
// anchor value.
// preference. Because this is a cpfp-operation, the anchor
// will only be attempted to sweep when the current fee
// estimate for the confirmation target exceeds the commit fee
// rate.
_, err = c.cfg.Sweeper.SweepInput(
&anchorInput,
sweep.Params{
Fee: sweep.FeePreference{
ConfTarget: deadline,
},
Force: true,
Force: force,
ExclusiveGroup: &exclusiveGroup,
},
)
Expand Down Expand Up @@ -1427,6 +1438,9 @@ func (c *ChannelArbitrator) findCommitmentDeadline(heightHint uint32,

if htlc.RefundTimeout < deadlineMinHeight {
deadlineMinHeight = htlc.RefundTimeout
log.Tracef("ChannelArbitrator(%v): outgoing HTLC has "+
"deadline: %v", c.cfg.ChanPoint,
deadlineMinHeight)
}
}

Expand Down Expand Up @@ -1455,6 +1469,9 @@ func (c *ChannelArbitrator) findCommitmentDeadline(heightHint uint32,

if htlc.RefundTimeout < deadlineMinHeight {
deadlineMinHeight = htlc.RefundTimeout
log.Tracef("ChannelArbitrator(%v): incoming HTLC has "+
"deadline: %v", c.cfg.ChanPoint,
deadlineMinHeight)
}
}

Expand Down
4 changes: 4 additions & 0 deletions contractcourt/channel_arbitrator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ func (*mockChainIO) GetBlock(blockHash *chainhash.Hash) (*wire.MsgBlock, error)
return nil, nil
}

func (*mockChainIO) GetBlockHeader(*chainhash.Hash) (*wire.BlockHeader, error) {
return nil, nil
}

type chanArbTestCtx struct {
t *testing.T

Expand Down
76 changes: 76 additions & 0 deletions docs/release-notes/release-notes-0.17.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Release Notes
- [Bug Fixes](#bug-fixes)
- [New Features](#new-features)
- [Functional Enhancements](#functional-enhancements)
- [RPC Additions](#rpc-additions)
- [lncli Additions](#lncli-additions)
- [Improvements](#improvements)
- [Functional Updates](#functional-updates)
- [RPC Updates](#rpc-updates)
- [lncli Updates](#lncli-updates)
- [Breaking Changes](#breaking-changes)
- [Performance Improvements](#performance-improvements)
- [Technical and Architectural Updates](#technical-and-architectural-updates)
- [BOLT Spec Updates](#bolt-spec-updates)
- [Testing](#testing)
- [Database](#database)
- [Code Health](#code-health)
- [Tooling and Documentation](#tooling-and-documentation)

# Bug Fixes

* [LND now sets the `BADONION`](https://github.com/lightningnetwork/lnd/pull/7937)
bit when sending `update_fail_malformed_htlc`. This avoids a force close
with other implementations.

* A bug that would cause taproot channels to sometimes not display as active
[has been fixed](https://github.com/lightningnetwork/lnd/pull/8104).

* [`lnd` will now properly reject macaroons with unknown versions.](https://github.com/lightningnetwork/lnd/pull/8132)

# New Features
## Functional Enhancements

- Previously, when a channel was force closed locally, its anchor was always
force-swept when the CPFP requirements are met. This is now
[changed](https://github.com/lightningnetwork/lnd/pull/7965) to only attempt
CPFP based on the deadline of the commitment transaction. The anchor output
will still be offered to the sweeper during channel force close, while the
actual sweeping won't be forced(CPFP) unless a relevant HTLC will timeout in
144 blocks. If CPFP before this deadline is needed, user can use `BumpFee`
instead.

## RPC Additions

* [`chainrpc` `GetBlockHeader`](https://github.com/lightningnetwork/lnd/pull/8111)
can be used to get block headers with any chain backend.

## lncli Additions

# Improvements
## Functional Updates
## RPC Updates
## lncli Updates
## Code Health
## Breaking Changes
## Performance Improvements

- When facing a large mempool, users may experience deteriorated performance,
which includes slow startup and shutdown, clogging RPC response when calling
`getinfo`, and CPU spikes. This is now improved with [the upgrade to the
latest `btcwallet`](https://github.com/lightningnetwork/lnd/pull/8019). In
addition, it's strongly recommended to upgrade `bitcoind` to version `v24.0`
and above to take advantage of the new RPC method `gettxspendingprevout`,
which will further decrease CPU usage and memory consumption.

# Technical and Architectural Updates
## BOLT Spec Updates
## Testing
## Database
## Code Health
## Tooling and Documentation

# Contributors (Alphabetical Order)
* Eugene Siegel
* Olaoluwa Osuntokun
* Yong Yu
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/btcsuite/btcd/btcutil/psbt v1.1.8
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f
github.com/btcsuite/btcwallet v0.16.10-0.20230804184612-07be54bc22cf
github.com/btcsuite/btcwallet v0.16.10-0.20231017144732-e3ff37491e9c
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
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,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=
Expand Down
9 changes: 8 additions & 1 deletion htlcswitch/hop/iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,14 @@ func (p *OnionProcessor) DecodeHopIterators(id []byte,
if replays.Contains(uint16(i)) {
log.Errorf("unable to process onion packet: %v",
sphinx.ErrReplayedPacket)
resp.FailCode = lnwire.CodeTemporaryChannelFailure

// We set FailCode to CodeInvalidOnionVersion even
// though the ephemeral key isn't the problem. We need
// to set the BADONION bit since we're sending back a
// malformed packet, but as there isn't a specific
// failure code for replays, we reuse one of the
// failure codes that has BADONION.
resp.FailCode = lnwire.CodeInvalidOnionVersion
continue
}

Expand Down
4 changes: 4 additions & 0 deletions htlcswitch/link.go
Original file line number Diff line number Diff line change
Expand Up @@ -1267,6 +1267,10 @@ func (l *channelLink) htlcManager() {
return
}

l.log.Infof("Channel is in an unclean state " +
"(lingering updates), graceful shutdown of " +
"channel link not possible")

// Otherwise, the channel has lingering updates, send
// an error and continue.
req.err <- ErrLinkFailedShutdown
Expand Down
4 changes: 4 additions & 0 deletions itest/list_on_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,10 @@ var allTestCases = []*lntest.TestCase{
Name: "taproot",
TestFunc: testTaproot,
},
{
Name: "simple taproot channel activation",
TestFunc: testSimpleTaprootChannelActivation,
},
{
Name: "wallet import account",
TestFunc: testWalletImportAccount,
Expand Down
Loading
Loading