Commit Graph

13228 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun
9b0718ae35
contractcourt: unify the lease specific HTLC sweeping logic
In this commit, we consolidate the _lease specific_ logic for the
success and timeout HTLC resolvers. We do this with the addition of a
new struct which is then composed via struct embedding with the two
existing structs. This fixes a flake in the integration tests by
ensuring the height is set up front, rather than eventually once the
height matches the lock time.
2022-06-01 16:42:33 -07:00
Olaoluwa Osuntokun
199f9d1139
Merge pull request #6600 from bhandras/invoiceregistry-deadlock
invoices: fix deadlock in the invoice registry
2022-06-01 14:59:55 -07:00
Olaoluwa Osuntokun
addbbc0e1a
Merge pull request #6608 from Roasbeef/btcwallet-psbt-bip32-taproot-fix
build: upgrade to latest version of btcwallet
2022-06-01 13:49:50 -07:00
Olaoluwa Osuntokun
5d98635ab5
build: upgrade to latest version of btcwallet
This commit upgrades to the latest version of btcwallet that fixes an
issue that would cause us to not properly sign a validate populated PSBT
in certain scenarios.

Fixes https://github.com/lightningnetwork/lnd/issues/6579
2022-06-01 10:24:31 -07:00
Olaoluwa Osuntokun
5ba033bed8
Merge pull request #6594 from yyforyongyu/fix-data-race
channeldb: fix data race in TestSerializeRevocationLog
2022-05-31 16:07:51 -07:00
yyforyongyu
2b5d535208
channeldb: fix data race in TestSerializeRevocationLog
When testing serializing revocation log, we need to also copy its
`HTLCEntries` as the serialization of the HTLC involves a writing to the
`htlc.amtTlv` field.
2022-06-01 02:20:44 +08:00
Andras Banki-Horvath
699f9c0d23
docs: update release notes for 0.15.0 2022-05-31 17:36:44 +02:00
Andras Banki-Horvath
98f39deb38
invoices: fix deadlock in hodl subscription handling 2022-05-31 17:36:43 +02:00
Andras Banki-Horvath
cc8a1f0d2b
invoices: fix deadlock in notification handling 2022-05-31 17:36:40 +02:00
Olaoluwa Osuntokun
1e0d6ec0ad
Merge pull request #6586 from Crypt-iQ/nil_htlcset
contractcourt: make empty htlcSets for closed channels
2022-05-28 19:59:25 -07:00
eugene
160d63b88e
contractcourt: make empty htlcSets for closed channels
This prevents a panic where an insert is attempted on a nil map via
updateActiveHTLCs. This panic would occur if the channel arbitrator
was in a buggy state, possibly introduced by power loss or via
SIGKILL.
2022-05-27 16:18:02 -04:00
Olaoluwa Osuntokun
08e4e66574
build: bump version to v0.15.0-beta.rc3 2022-05-23 18:42:48 -07:00
Olaoluwa Osuntokun
e98a739130
Merge pull request #6518 from Crypt-iQ/dupestone
htlcswitch: remove synchronous link handoff, special-case keystone err
2022-05-23 16:51:19 -07:00
Olaoluwa Osuntokun
ab91f85d05
Merge pull request #6563 from yyforyongyu/export-chanstatus
multi: export channel status field in migration25
2022-05-23 11:26:53 -07:00
yyforyongyu
36b646496a
docs: update release note for migrations fix 2022-05-23 05:36:14 +08:00
yyforyongyu
d7bb7cd9a7
migration27: add unit test to cover ChanStatusRestored 2022-05-23 05:13:56 +08:00
yyforyongyu
7cf28773bf
multi: export channel status field in migration25
Previously, in `migration25.OpenChannel`, there was a private field
`chanStatus` used to keep track of the channel status. The following
migrations, `migration26` and `migration27` also have their own
`OpenChannel` defined, with `migration26` inherited from `migration25`,
and `migration27` inherited from `migration26`. The private field
`chanStatus`, however, is NOT inherited and each of the migrations uses
its own. This is fine for reading and writing as, under the hood, the
`chanStatus` is just a `uint8` value. Because each migration has its own
fetcher and putter, it can safely access its private field to read and
write it correctly.

The issue pops up when we use the method
`migration25.FundingTxPresent()`. Because it's evaluating its channel
status using its own private field `chanStatus`, this field would always
be the default value(`ChanStatusDefault`), leading the statement
`!c.hasChanStatus(ChanStatusRestored)` to always be true. Thus a
restored channel will be mistakenly considered to have funding tx
present, causing failures in reading the channel info in the following
migrations.

We fix this by exporting the `ChanStatus` field so its value can be set
by following migrations.
2022-05-23 03:55:00 +08:00
Olaoluwa Osuntokun
164a9c6f68
build: bump version to v0.15.0-beta.rc2 2022-05-20 00:08:28 -07:00
Olaoluwa Osuntokun
3e5b5d52f0
Merge pull request #6551 from yyforyongyu/fix-migration
channeldb: change balance fields to tlv records and migrate historical bucket
2022-05-19 16:35:31 -07:00
yyforyongyu
dae8e430d3
docs: update release note re patched fields 2022-05-20 06:55:34 +08:00
yyforyongyu
3458b2eb7d
channeldb+migration27: patch balance fields for historical chan
This commit adds a new migration to patch the two balance fields,
`InitialLocalBalance` and `InitialRemoteBalance` for the historical
channels. Because they are not saved previously, for historical channels
prior to the revocation log PR, these fields will be empty.
2022-05-20 06:55:31 +08:00
yyforyongyu
55746e427e
channeldb+migration26: migrate balance fields into tlv records 2022-05-19 03:34:24 +08:00
yyforyongyu
de2bcbf925
migration25: export methods to be used for following migrations
This commit exports several private methods to be used in later
migrations. It's safe to do so as no actual logic or migration scheme is
changed.
2022-05-19 03:34:13 +08:00
yyforyongyu
2ec459df6c
channeldb: use TLV for InitialLocalBalance and InitialRemoteBalance
This commit changes the encoding scheme for the fields
`InitialLocalBalance` and `InitialRemoteBalance` and use TLV instead.
2022-05-18 19:46:09 +08:00
Oliver Gugger
e319fb888e
Merge pull request #6547 from Crypt-iQ/boltfix_05-22
channeldb: copy value from boltdb's Get instead of using it directly
2022-05-17 19:43:03 +02:00
eugene
759d74ee15
release-notes: update for 0.15.0 2022-05-17 11:27:11 -04:00
eugene
2e3246aafe
channeldb: copy value from boltdb's Get instead of using it directly
This can cause an intermittent panic otherwise if bbolt remaps itself
via munmap and mmap. From bbolt's documentation:

* Byte slices returned from Bolt are only valid during a transaction.
Once the transaction has been committed or rolled back then the memory
they point to can be reused by a new page or can be unmapped from
virtual memory and you'll see an unexpected fault address panic when
accessing it.
2022-05-17 11:14:40 -04:00
Olaoluwa Osuntokun
b31640e6b0
build: bump version to v0.15.0-beta.rc1 2022-05-16 20:16:01 -07:00
Oliver Gugger
04fb034259
Merge pull request #6535 from ErikEk/config-rpccookie-path
config: fix path to bitcoind/litecoind rpccookie and config
2022-05-16 16:06:04 +02:00
Oliver Gugger
6b57e92a37
Merge pull request #6529 from guggero/constrainmacaroon
lncli: add constrainmacaroon command
2022-05-16 15:57:52 +02:00
ErikEk
b6f56d3398 config: fix path to bitcoind.rpccookie and bitcoind.config 2022-05-16 13:55:16 +02:00
Oliver Gugger
4b313a54f8
Merge pull request #6536 from ErikEk/cookie-missing-error-msg-fix
config: error msg for missing bitcoind cookie file
2022-05-16 13:49:04 +02:00
Oliver Gugger
c647d32cf7
Merge pull request #6540 from yyforyongyu/6537-fix-push-amount
rpcserver: fix wrong unit used in PushAmountSat
2022-05-16 13:48:02 +02:00
ErikEk
fbf00f6e26 config: cookie missing error fix 2022-05-16 10:48:53 +02:00
yyforyongyu
6b34ebbe44
rpcserver: fix wrong unit used in PushAmountSat 2022-05-16 05:49:05 +08:00
Olaoluwa Osuntokun
2c4136da1b
Merge pull request #6525 from Crypt-iQ/amp_preimage_fix
invoices: properly set Preimage field for success resolution
2022-05-13 15:15:03 -07:00
Oliver Gugger
8f94aac00a
docs: add release notes 2022-05-13 13:41:10 +02:00
Oliver Gugger
968393975b
cmd/lncli: add constrainmacaroon command 2022-05-13 13:41:10 +02:00
Oliver Gugger
f4e1f60e4d
cmd/lncli: extract macaroon caveat flags
As a preparation for re-using the macaroon caveat/constraints CLI flags,
we extract the parsing and adding of those constraints into its own
function.
2022-05-13 13:38:53 +02:00
Olaoluwa Osuntokun
7106ea59db
Merge pull request #6524 from guggero/aezeed-bump
aezeed+keychain: bump internal version of seed to 1
2022-05-12 16:35:49 -07:00
Olaoluwa Osuntokun
9f101f46ec
Merge pull request #6528 from guggero/list-leased-outputs
btcwallet bump: add Taproot fields to FundPsbt, add pkScript and value to ListLeases
2022-05-12 16:24:00 -07:00
Oliver Gugger
5e411ac5f3
docs: add release notes 2022-05-12 12:49:15 +02:00
Oliver Gugger
51a480129b
walletunlocker+keychain+config_builder: use new aezeed version 2022-05-12 12:49:14 +02:00
Oliver Gugger
daa5966119
aezeed: make seed generation fully deterministic
This commit fixes a TODO to make the seed generation fully deterministic
by providing the option to pass in a custom randomness source.
2022-05-12 12:49:14 +02:00
Oliver Gugger
63e28a27b8
aezeed: re-encode salt correctly 2022-05-12 12:49:14 +02:00
Oliver Gugger
f67776375f
aezeed: re-format test cases, use require 2022-05-12 12:49:13 +02:00
Oliver Gugger
a02112464a
aezeed: remove unnecessary casts 2022-05-12 12:47:07 +02:00
Oliver Gugger
83f1c2c9b6
aezeed: fix typos and formatting 2022-05-12 12:47:06 +02:00
Oliver Gugger
5240fa9983
docs: add release notes 2022-05-12 10:28:14 +02:00
Oliver Gugger
cb3cb4c8ab
cmd/lncli: add pk script and value to JSON 2022-05-12 10:24:42 +02:00